Class: AWSCDK::Interfaces::ResourceEnvironment
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Interfaces::ResourceEnvironment
- Defined in:
- interfaces/resource_environment.rb
Overview
Represents the environment a given resource lives in.
Used as the return value for the IEnvironmentAware.env property.
Instance Attribute Summary collapse
-
#account ⇒ String
readonly
The AWS Account ID that this resource belongs to.
-
#region ⇒ String
readonly
The AWS Region that this resource belongs to.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(account:, region:) ⇒ ResourceEnvironment
constructor
A new instance of ResourceEnvironment.
- #to_jsii ⇒ Object
Constructor Details
#initialize(account:, region:) ⇒ ResourceEnvironment
Returns a new instance of ResourceEnvironment.
11 12 13 14 15 16 |
# File 'interfaces/resource_environment.rb', line 11 def initialize(account:, region:) @account = account Jsii::Type.check_type(@account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "account") @region = region Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") end |
Instance Attribute Details
#account ⇒ String (readonly)
The AWS Account ID that this resource belongs to.
Since this can be a Token (for example, when the account is
CloudFormation's AWS::AccountId intrinsic), make sure to use
Token.compareStrings() instead of comparing the values with direct
string equality.
26 27 28 |
# File 'interfaces/resource_environment.rb', line 26 def account @account end |
#region ⇒ String (readonly)
The AWS Region that this resource belongs to.
Since this can be a Token (for example, when the region is CloudFormation's
AWS::Region intrinsic), make sure to use Token.compareStrings() instead
of comparing the values with direct string equality.
34 35 36 |
# File 'interfaces/resource_environment.rb', line 34 def region @region end |
Class Method Details
.jsii_properties ⇒ Object
36 37 38 39 40 41 |
# File 'interfaces/resource_environment.rb', line 36 def self.jsii_properties { :account => "account", :region => "region", } end |
Instance Method Details
#to_jsii ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'interfaces/resource_environment.rb', line 43 def to_jsii result = {} result.merge!({ "account" => @account, "region" => @region, }) result.compact end |