Class: AWSCDK::Environment

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
environment.rb

Overview

The deployment environment for a stack.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account: nil, region: nil) ⇒ Environment

Returns a new instance of Environment.

Parameters:

  • account (String, nil) (defaults to: nil)

    The AWS account ID for this environment.

  • region (String, nil) (defaults to: nil)

    The AWS region for this environment.



9
10
11
12
13
14
# File 'environment.rb', line 9

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

#accountString? (readonly)

Note:

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.

Returns:

  • (String, nil)


27
28
29
# File 'environment.rb', line 27

def 
  @account
end

#regionString? (readonly)

Note:

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.

Returns:

  • (String, nil)


39
40
41
# File 'environment.rb', line 39

def region
  @region
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
# File 'environment.rb', line 41

def self.jsii_properties
  {
    :account => "account",
    :region => "region",
  }
end

Instance Method Details

#to_jsiiObject



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