Class: AWSCDK::Environment
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Environment
- Defined in:
- environment.rb
Overview
The deployment environment for a stack.
Instance Attribute Summary collapse
-
#account ⇒ String?
readonly
The AWS account ID for this environment.
-
#region ⇒ String?
readonly
The AWS region for this environment.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(account: nil, region: nil) ⇒ Environment
constructor
A new instance of Environment.
- #to_jsii ⇒ Object
Constructor Details
#initialize(account: nil, region: nil) ⇒ Environment
Returns a new instance of Environment.
9 10 11 12 13 14 |
# File 'environment.rb', line 9 def initialize(account: nil, region: nil) @account = account Jsii::Type.check_type(@account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "account") unless @account.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: Aws.ACCOUNT_ID which means that the stack will be account-agnostic.
The AWS account ID for this environment.
This can be either a concrete value such as 585191031104 or Aws.ACCOUNT_ID which
indicates that account ID will only be determined during deployment (it
will resolve to the CloudFormation intrinsic {"Ref":"AWS::AccountId"}).
Note that certain features, such as cross-stack references and
environmental context providers require concrete region information and
will cause this stack to emit synthesis errors.
27 28 29 |
# File 'environment.rb', line 27 def account @account end |
#region ⇒ String? (readonly)
Default: Aws.REGION which means that the stack will be region-agnostic.
The AWS region for this environment.
This can be either a concrete value such as eu-west-2 or Aws.REGION
which indicates that account ID will only be determined during deployment
(it will resolve to the CloudFormation intrinsic {"Ref":"AWS::Region"}).
Note that certain features, such as cross-stack references and
environmental context providers require concrete region information and
will cause this stack to emit synthesis errors.
39 40 41 |
# File 'environment.rb', line 39 def region @region end |
Class Method Details
.jsii_properties ⇒ Object
41 42 43 44 45 46 |
# File 'environment.rb', line 41 def self.jsii_properties { :account => "account", :region => "region", } end |
Instance Method Details
#to_jsii ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'environment.rb', line 48 def to_jsii result = {} result.merge!({ "account" => @account, "region" => @region, }) result.compact end |