Class: AWSCDK::Interfaces::ResourceEnvironment

Inherits:
Jsii::Struct
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account:, region:) ⇒ ResourceEnvironment

Returns a new instance of ResourceEnvironment.

Parameters:

  • account (String)

    The AWS Account ID that this resource belongs to.

  • region (String)

    The AWS Region that this resource belongs to.



11
12
13
14
15
16
# File 'interfaces/resource_environment.rb', line 11

def initialize(account:, region:)
  @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

#accountString (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.

Returns:

  • (String)


26
27
28
# File 'interfaces/resource_environment.rb', line 26

def 
  @account
end

#regionString (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.

Returns:

  • (String)


34
35
36
# File 'interfaces/resource_environment.rb', line 34

def region
  @region
end

Class Method Details

.jsii_propertiesObject



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_jsiiObject



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