Class: AWSCDK::Greengrass::CfnFunctionDefinitionVersion::ExecutionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
greengrass/cfn_function_definition_version.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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(isolation_mode: nil, run_as: nil) ⇒ ExecutionProperty

Returns a new instance of ExecutionProperty.

Parameters:



640
641
642
643
644
645
# File 'greengrass/cfn_function_definition_version.rb', line 640

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::CfnFunctionDefinitionVersion::RunAsProperty.new(**run_as.transform_keys(&:to_sym)) : run_as
  Jsii::Type.check_type(@run_as, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ncmVlbmdyYXNzLkNmbkZ1bmN0aW9uRGVmaW5pdGlvblZlcnNpb24uUnVuQXNQcm9wZXJ0eSJ9XX19")), "runAs") unless @run_as.nil?
end

Instance Attribute Details

#isolation_modeString? (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 DefaultConfig property 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 Environment property 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.



658
659
660
# File 'greengrass/cfn_function_definition_version.rb', line 658

def isolation_mode
  @isolation_mode
end

#run_asAWSCDK::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 DefaultConfig property 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 Environment property 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 .



670
671
672
# File 'greengrass/cfn_function_definition_version.rb', line 670

def run_as
  @run_as
end

Class Method Details

.jsii_propertiesObject



672
673
674
675
676
677
# File 'greengrass/cfn_function_definition_version.rb', line 672

def self.jsii_properties
  {
    :isolation_mode => "isolationMode",
    :run_as => "runAs",
  }
end

Instance Method Details

#to_jsiiObject



679
680
681
682
683
684
685
686
# File 'greengrass/cfn_function_definition_version.rb', line 679

def to_jsii
  result = {}
  result.merge!({
    "isolationMode" => @isolation_mode,
    "runAs" => @run_as,
  })
  result.compact
end