Class: AWSCDK::ARNComponents

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource:, service:, account: nil, arn_format: nil, partition: nil, region: nil, resource_name: nil) ⇒ ARNComponents

Returns a new instance of ARNComponents.

Parameters:

  • resource (String)

    Resource type (e.g. "table", "autoScalingGroup", "certificate"). For some resource types, e.g. S3 buckets, this field defines the bucket name.

  • service (String)

    The service namespace that identifies the AWS product (for example, 's3', 'iam', 'codepipeline').

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

    The ID of the AWS account that owns the resource, without the hyphens.

  • arn_format (AWSCDK::ARNFormat, nil) (defaults to: nil)

    The specific ARN format to use for this ARN value.

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

    The partition that the resource is in.

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

    The region the resource resides in.

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

    Resource name or path within the resource (i.e. S3 bucket object key) or a wildcard such as "*". This is service-dependent.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'arn_components.rb', line 13

def initialize(resource:, service:, account: nil, arn_format: nil, partition: nil, region: nil, resource_name: nil)
  @resource = resource
  Jsii::Type.check_type(@resource, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resource")
  @service = service
  Jsii::Type.check_type(@service, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "service")
  @account = 
  Jsii::Type.check_type(@account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "account") unless @account.nil?
  @arn_format = arn_format
  Jsii::Type.check_type(@arn_format, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Gb3JtYXQifQ==")), "arnFormat") unless @arn_format.nil?
  @partition = partition
  Jsii::Type.check_type(@partition, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "partition") unless @partition.nil?
  @region = region
  Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil?
  @resource_name = resource_name
  Jsii::Type.check_type(@resource_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceName") unless @resource_name.nil?
end

Instance Attribute Details

#accountString? (readonly)

Note:

Default: The account the stack is deployed to.

The ID of the AWS account that owns the resource, without the hyphens.

For example, 123456789012. Note that the ARNs for some resources don't require an account number, so this component might be omitted.

Returns:

  • (String, nil)


45
46
47
# File 'arn_components.rb', line 45

def 
  @account
end

#arn_formatAWSCDK::ARNFormat? (readonly)

Note:

Default: - uses value of sep as the separator for formatting, ArnFormat.SLASH_RESOURCE_NAME if that property was also not provided

The specific ARN format to use for this ARN value.

Returns:



50
51
52
# File 'arn_components.rb', line 50

def arn_format
  @arn_format
end

#partitionString? (readonly)

Note:

Default: The AWS partition the stack is deployed to.

The partition that the resource is in.

For standard AWS regions, the partition is aws. If you have resources in other partitions, the partition is aws-partitionname. For example, the partition for resources in the China (Beijing) region is aws-cn.

Returns:

  • (String, nil)


60
61
62
# File 'arn_components.rb', line 60

def partition
  @partition
end

#regionString? (readonly)

Note:

Default: The region the stack is deployed to.

The region the resource resides in.

Note that the ARNs for some resources do not require a region, so this component might be omitted.

Returns:

  • (String, nil)


68
69
70
# File 'arn_components.rb', line 68

def region
  @region
end

#resourceString (readonly)

Resource type (e.g. "table", "autoScalingGroup", "certificate"). For some resource types, e.g. S3 buckets, this field defines the bucket name.

Returns:

  • (String)


33
34
35
# File 'arn_components.rb', line 33

def resource
  @resource
end

#resource_nameString? (readonly)

Resource name or path within the resource (i.e. S3 bucket object key) or a wildcard such as "*". This is service-dependent.

Returns:

  • (String, nil)


72
73
74
# File 'arn_components.rb', line 72

def resource_name
  @resource_name
end

#serviceString (readonly)

The service namespace that identifies the AWS product (for example, 's3', 'iam', 'codepipeline').

Returns:

  • (String)


37
38
39
# File 'arn_components.rb', line 37

def service
  @service
end

Class Method Details

.jsii_propertiesObject



74
75
76
77
78
79
80
81
82
83
84
# File 'arn_components.rb', line 74

def self.jsii_properties
  {
    :resource => "resource",
    :service => "service",
    :account => "account",
    :arn_format => "arnFormat",
    :partition => "partition",
    :region => "region",
    :resource_name => "resourceName",
  }
end

Instance Method Details

#to_jsiiObject



86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'arn_components.rb', line 86

def to_jsii
  result = {}
  result.merge!({
    "resource" => @resource,
    "service" => @service,
    "account" => @account,
    "arnFormat" => @arn_format,
    "partition" => @partition,
    "region" => @region,
    "resourceName" => @resource_name,
  })
  result.compact
end