Class: AWSCDK::Greengrass::CfnFunctionDefinition::EnvironmentProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
greengrass/cfn_function_definition.rb

Overview

The environment configuration for a Lambda function on the AWS IoT Greengrass core.

In an CloudFormation template, Environment is a property of the FunctionConfiguration property type.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_sysfs: nil, execution: nil, resource_access_policies: nil, variables: nil) ⇒ EnvironmentProperty

Returns a new instance of EnvironmentProperty.

Parameters:



643
644
645
646
647
648
649
650
651
652
# File 'greengrass/cfn_function_definition.rb', line 643

def initialize(access_sysfs: nil, execution: nil, resource_access_policies: nil, variables: nil)
  @access_sysfs = access_sysfs
  Jsii::Type.check_type(@access_sysfs, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "accessSysfs") unless @access_sysfs.nil?
  @execution = execution.is_a?(Hash) ? ::AWSCDK::Greengrass::CfnFunctionDefinition::ExecutionProperty.new(**execution.transform_keys(&:to_sym)) : execution
  Jsii::Type.check_type(@execution, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ncmVlbmdyYXNzLkNmbkZ1bmN0aW9uRGVmaW5pdGlvbi5FeGVjdXRpb25Qcm9wZXJ0eSJ9XX19")), "execution") unless @execution.nil?
  @resource_access_policies = resource_access_policies
  Jsii::Type.check_type(@resource_access_policies, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZ3JlZW5ncmFzcy5DZm5GdW5jdGlvbkRlZmluaXRpb24uUmVzb3VyY2VBY2Nlc3NQb2xpY3lQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "resourceAccessPolicies") unless @resource_access_policies.nil?
  @variables = variables
  Jsii::Type.check_type(@variables, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "variables") unless @variables.nil?
end

Instance Attribute Details

#access_sysfsBoolean, ... (readonly)

Indicates whether the function is allowed to access the /sys directory on the core device, which allows the read device information from /sys .

This property applies only to Lambda functions that run in a Greengrass container.



660
661
662
# File 'greengrass/cfn_function_definition.rb', line 660

def access_sysfs
  @access_sysfs
end

#executionAWSCDK::IResolvable, ... (readonly)

Settings for the Lambda execution environment in AWS IoT Greengrass .



665
666
667
# File 'greengrass/cfn_function_definition.rb', line 665

def execution
  @execution
end

#resource_access_policiesAWSCDK::IResolvable, ... (readonly)

A list of the resources in the group that the function can access, with the corresponding read-only or read-write permissions. The maximum is 10 resources.

This property applies only for Lambda functions that run in a Greengrass container.



672
673
674
# File 'greengrass/cfn_function_definition.rb', line 672

def resource_access_policies
  @resource_access_policies
end

#variablesObject? (readonly)

Environment variables for the Lambda function.



677
678
679
# File 'greengrass/cfn_function_definition.rb', line 677

def variables
  @variables
end

Class Method Details

.jsii_propertiesObject



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

def self.jsii_properties
  {
    :access_sysfs => "accessSysfs",
    :execution => "execution",
    :resource_access_policies => "resourceAccessPolicies",
    :variables => "variables",
  }
end

Instance Method Details

#to_jsiiObject



688
689
690
691
692
693
694
695
696
697
# File 'greengrass/cfn_function_definition.rb', line 688

def to_jsii
  result = {}
  result.merge!({
    "accessSysfs" => @access_sysfs,
    "execution" => @execution,
    "resourceAccessPolicies" => @resource_access_policies,
    "variables" => @variables,
  })
  result.compact
end