Class: AWSCDK::ResourceProps

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

Overview

Construction properties for Resource.

Direct Known Subclasses

EC2::KeyPairProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account: nil, environment_from_arn: nil, physical_name: nil, region: nil) ⇒ ResourceProps

Returns a new instance of ResourceProps.

Parameters:

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

    The AWS account ID this resource belongs to.

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

    ARN to deduce region and account from.

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

    The value passed in by users to the physical name prop of the resource.

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

    The AWS region this resource belongs to.



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 = 
  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

#accountString? (readonly)

Note:

Default: - the resource is in the same account as the stack it belongs to

The AWS account ID this resource belongs to.

Returns:

  • (String, nil)


26
27
28
# File 'resource_props.rb', line 26

def 
  @account
end

#environment_from_arnString? (readonly)

Note:

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.

Returns:

  • (String, nil)


36
37
38
# File 'resource_props.rb', line 36

def environment_from_arn
  @environment_from_arn
end

#physical_nameString? (readonly)

Note:

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.

  • undefined implies that a physical name will be allocated by CloudFormation during deployment.
  • a concrete value implies a specific physical name
  • PhysicalName.GENERATE_IF_NEEDED is 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.

Returns:

  • (String, nil)


47
48
49
# File 'resource_props.rb', line 47

def physical_name
  @physical_name
end

#regionString? (readonly)

Note:

Default: - the resource is in the same region as the stack it belongs to

The AWS region this resource belongs to.

Returns:

  • (String, nil)


52
53
54
# File 'resource_props.rb', line 52

def region
  @region
end

Class Method Details

.jsii_propertiesObject



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_jsiiObject



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