Class: AWSCDK::Greengrass::CfnFunctionDefinition::ExecutionProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Greengrass::CfnFunctionDefinition::ExecutionProperty
- Defined in:
- greengrass/cfn_function_definition.rb
Overview
Configuration settings for the Lambda execution environment on the AWS IoT Greengrass core.
In an CloudFormation template, Execution is a property of the DefaultConfig property type for a function definition version and the Environment property type for a function.
Instance Attribute Summary collapse
-
#isolation_mode ⇒ String?
readonly
The containerization that the Lambda function runs in.
-
#run_as ⇒ AWSCDK::IResolvable, ...
readonly
The user and group permissions used to run the Lambda function.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(isolation_mode: nil, run_as: nil) ⇒ ExecutionProperty
constructor
A new instance of ExecutionProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(isolation_mode: nil, run_as: nil) ⇒ ExecutionProperty
Returns a new instance of ExecutionProperty.
710 711 712 713 714 715 |
# File 'greengrass/cfn_function_definition.rb', line 710 def initialize(isolation_mode: nil, run_as: nil) @isolation_mode = isolation_mode Jsii::Type.check_type(@isolation_mode, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "isolationMode") unless @isolation_mode.nil? @run_as = run_as.is_a?(Hash) ? ::AWSCDK::Greengrass::CfnFunctionDefinition::RunAsProperty.new(**run_as.transform_keys(&:to_sym)) : run_as Jsii::Type.check_type(@run_as, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ncmVlbmdyYXNzLkNmbkZ1bmN0aW9uRGVmaW5pdGlvbi5SdW5Bc1Byb3BlcnR5In1dfX0=")), "runAs") unless @run_as.nil? end |
Instance Attribute Details
#isolation_mode ⇒ String? (readonly)
The containerization that the Lambda function runs in.
Valid values are GreengrassContainer or NoContainer . Typically, this is GreengrassContainer . For more information, see Containerization in the Developer Guide .
- When set on the
DefaultConfigproperty of a function definition version, this setting is used as the default containerization for all Lambda functions in the function definition version. - When set on the
Environmentproperty of a function, this setting applies to the individual function and overrides the default. Omit this value to run the function with the default containerization.
We recommend that you run in a Greengrass container unless your business case requires that you run without containerization.
728 729 730 |
# File 'greengrass/cfn_function_definition.rb', line 728 def isolation_mode @isolation_mode end |
#run_as ⇒ AWSCDK::IResolvable, ... (readonly)
The user and group permissions used to run the Lambda function.
Typically, this is the ggc_user and ggc_group. For more information, see Run as in the Developer Guide .
- When set on the
DefaultConfigproperty of a function definition version, this setting is used as the default access identity for all Lambda functions in the function definition version. - When set on the
Environmentproperty of a function, this setting applies to the individual function and overrides the default. You can override the user, group, or both. Omit this value to run the function with the default permissions.
Running as the root user increases risks to your data and device. Do not run as root (UID/GID=0) unless your business case requires it. For more information and requirements, see Running a Lambda Function as Root .
740 741 742 |
# File 'greengrass/cfn_function_definition.rb', line 740 def run_as @run_as end |
Class Method Details
.jsii_properties ⇒ Object
742 743 744 745 746 747 |
# File 'greengrass/cfn_function_definition.rb', line 742 def self.jsii_properties { :isolation_mode => "isolationMode", :run_as => "runAs", } end |
Instance Method Details
#to_jsii ⇒ Object
749 750 751 752 753 754 755 756 |
# File 'greengrass/cfn_function_definition.rb', line 749 def to_jsii result = {} result.merge!({ "isolationMode" => @isolation_mode, "runAs" => @run_as, }) result.compact end |