Class: AWSCDK::ResourceProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ResourceProps
- Defined in:
- resource_props.rb
Overview
Construction properties for Resource.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#account ⇒ String?
readonly
The AWS account ID this resource belongs to.
-
#environment_from_arn ⇒ String?
readonly
ARN to deduce region and account from.
-
#physical_name ⇒ String?
readonly
The value passed in by users to the physical name prop of the resource.
-
#region ⇒ String?
readonly
The AWS region this resource belongs to.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(account: nil, environment_from_arn: nil, physical_name: nil, region: nil) ⇒ ResourceProps
constructor
A new instance of ResourceProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(account: nil, environment_from_arn: nil, physical_name: nil, region: nil) ⇒ ResourceProps
Returns a new instance of ResourceProps.
11 12 13 14 15 16 17 18 19 20 |
# File 'resource_props.rb', line 11 def initialize(account: nil, environment_from_arn: nil, physical_name: nil, region: nil) @account = account Jsii::Type.check_type(@account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "account") unless @account.nil? @environment_from_arn = environment_from_arn Jsii::Type.check_type(@environment_from_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "environmentFromArn") unless @environment_from_arn.nil? @physical_name = physical_name Jsii::Type.check_type(@physical_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "physicalName") unless @physical_name.nil? @region = region Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil? end |
Instance Attribute Details
#account ⇒ String? (readonly)
Default: - the resource is in the same account as the stack it belongs to
The AWS account ID this resource belongs to.
26 27 28 |
# File 'resource_props.rb', line 26 def account @account end |
#environment_from_arn ⇒ String? (readonly)
Default: - take environment from account, region parameters, or use Stack environment.
ARN to deduce region and account from.
The ARN is parsed and the account and region are taken from the ARN. This should be used for imported resources.
Cannot be supplied together with either account or region.
36 37 38 |
# File 'resource_props.rb', line 36 def environment_from_arn @environment_from_arn end |
#physical_name ⇒ String? (readonly)
Default: - The physical name will be allocated by CloudFormation at deployment time
The value passed in by users to the physical name prop of the resource.
undefinedimplies that a physical name will be allocated by CloudFormation during deployment.- a concrete value implies a specific physical name
PhysicalName.GENERATE_IF_NEEDEDis a marker that indicates that a physical will only be generated by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated by CloudFormation.
47 48 49 |
# File 'resource_props.rb', line 47 def physical_name @physical_name end |
#region ⇒ String? (readonly)
Default: - the resource is in the same region as the stack it belongs to
The AWS region this resource belongs to.
52 53 54 |
# File 'resource_props.rb', line 52 def region @region end |
Class Method Details
.jsii_properties ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'resource_props.rb', line 54 def self.jsii_properties { :account => "account", :environment_from_arn => "environmentFromArn", :physical_name => "physicalName", :region => "region", } end |
Instance Method Details
#to_jsii ⇒ Object
63 64 65 66 67 68 69 70 71 72 |
# File 'resource_props.rb', line 63 def to_jsii result = {} result.merge!({ "account" => @account, "environmentFromArn" => @environment_from_arn, "physicalName" => @physical_name, "region" => @region, }) result.compact end |