Class: AWSCDK::Lambda::FunctionAttributes
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Lambda::FunctionAttributes
- Defined in:
- lambda/function_attributes.rb
Overview
Represents a Lambda function defined outside of this stack.
Instance Attribute Summary collapse
-
#architecture ⇒ AWSCDK::Lambda::Architecture?
readonly
The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64).
-
#function_arn ⇒ String
readonly
The ARN of the Lambda function.
-
#role ⇒ AWSCDK::IAM::IRole?
readonly
The IAM execution role associated with this function.
-
#same_environment ⇒ Boolean?
readonly
Setting this property informs the CDK that the imported function is in the same environment as the stack.
-
#security_group ⇒ AWSCDK::EC2::ISecurityGroup?
readonly
The security group of this Lambda, if in a VPC.
-
#skip_permissions ⇒ Boolean?
readonly
Setting this property informs the CDK that the imported function ALREADY HAS the necessary permissions for what you are trying to do.
-
#tenancy_config ⇒ AWSCDK::Lambda::TenancyConfig?
readonly
The tenancy configuration of this Lambda Function.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(function_arn:, architecture: nil, role: nil, same_environment: nil, security_group: nil, skip_permissions: nil, tenancy_config: nil) ⇒ FunctionAttributes
constructor
A new instance of FunctionAttributes.
- #to_jsii ⇒ Object
Constructor Details
#initialize(function_arn:, architecture: nil, role: nil, same_environment: nil, security_group: nil, skip_permissions: nil, tenancy_config: nil) ⇒ FunctionAttributes
Returns a new instance of FunctionAttributes.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lambda/function_attributes.rb', line 14 def initialize(function_arn:, architecture: nil, role: nil, same_environment: nil, security_group: nil, skip_permissions: nil, tenancy_config: nil) @function_arn = function_arn Jsii::Type.check_type(@function_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "functionArn") @architecture = architecture Jsii::Type.check_type(@architecture, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLkFyY2hpdGVjdHVyZSJ9")), "architecture") unless @architecture.nil? @role = role Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil? @same_environment = same_environment Jsii::Type.check_type(@same_environment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "sameEnvironment") unless @same_environment.nil? @security_group = security_group Jsii::Type.check_type(@security_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklTZWN1cml0eUdyb3VwIn0=")), "securityGroup") unless @security_group.nil? @skip_permissions = Jsii::Type.check_type(@skip_permissions, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "skipPermissions") unless @skip_permissions.nil? @tenancy_config = tenancy_config Jsii::Type.check_type(@tenancy_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLlRlbmFuY3lDb25maWcifQ==")), "tenancyConfig") unless @tenancy_config.nil? end |
Instance Attribute Details
#architecture ⇒ AWSCDK::Lambda::Architecture? (readonly)
Default: - Architecture.X86_64
The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64).
41 42 43 |
# File 'lambda/function_attributes.rb', line 41 def architecture @architecture end |
#function_arn ⇒ String (readonly)
The ARN of the Lambda function.
Format: arn:
36 37 38 |
# File 'lambda/function_attributes.rb', line 36 def function_arn @function_arn end |
#role ⇒ AWSCDK::IAM::IRole? (readonly)
The IAM execution role associated with this function.
If the role is not specified, any role-related operations will no-op.
47 48 49 |
# File 'lambda/function_attributes.rb', line 47 def role @role end |
#same_environment ⇒ Boolean? (readonly)
Default: - depends: true, if the Stack is configured with an explicit env (account and region) and the account is the same as this function. For environment-agnostic stacks this will default to false.
Setting this property informs the CDK that the imported function is in the same environment as the stack.
This affects certain behaviours such as, whether this function's permission can be modified.
When not configured, the CDK attempts to auto-determine this. For environment agnostic stacks, i.e., stacks
where the account is not specified with the env property, this is determined to be false.
Set this to property ONLY IF the imported function is in the same account as the stack it's imported in.
59 60 61 |
# File 'lambda/function_attributes.rb', line 59 def same_environment @same_environment end |
#security_group ⇒ AWSCDK::EC2::ISecurityGroup? (readonly)
The security group of this Lambda, if in a VPC.
This needs to be given in order to support allowing connections to this Lambda.
66 67 68 |
# File 'lambda/function_attributes.rb', line 66 def security_group @security_group end |
#skip_permissions ⇒ Boolean? (readonly)
Default: false
Setting this property informs the CDK that the imported function ALREADY HAS the necessary permissions for what you are trying to do.
When not configured, the CDK attempts to auto-determine whether or not additional permissions are necessary on the function when grant APIs are used. If the CDK tried to add permissions on an imported lambda, it will fail.
Set this property ONLY IF you are committing to manage the imported function's permissions outside of CDK. You are acknowledging that your CDK code alone will have insufficient permissions to access the imported function.
79 80 81 |
# File 'lambda/function_attributes.rb', line 79 def @skip_permissions end |
#tenancy_config ⇒ AWSCDK::Lambda::TenancyConfig? (readonly)
Default: - Tenant isolation is not enabled
The tenancy configuration of this Lambda Function.
84 85 86 |
# File 'lambda/function_attributes.rb', line 84 def tenancy_config @tenancy_config end |
Class Method Details
.jsii_properties ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 |
# File 'lambda/function_attributes.rb', line 86 def self.jsii_properties { :function_arn => "functionArn", :architecture => "architecture", :role => "role", :same_environment => "sameEnvironment", :security_group => "securityGroup", :skip_permissions => "skipPermissions", :tenancy_config => "tenancyConfig", } end |
Instance Method Details
#to_jsii ⇒ Object
98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lambda/function_attributes.rb', line 98 def to_jsii result = {} result.merge!({ "functionArn" => @function_arn, "architecture" => @architecture, "role" => @role, "sameEnvironment" => @same_environment, "securityGroup" => @security_group, "skipPermissions" => @skip_permissions, "tenancyConfig" => @tenancy_config, }) result.compact end |