Class: AWSCDK::ARNComponents
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ARNComponents
- Defined in:
- arn_components.rb
Instance Attribute Summary collapse
-
#account ⇒ String?
readonly
The ID of the AWS account that owns the resource, without the hyphens.
-
#arn_format ⇒ AWSCDK::ARNFormat?
readonly
The specific ARN format to use for this ARN value.
-
#partition ⇒ String?
readonly
The partition that the resource is in.
-
#region ⇒ String?
readonly
The region the resource resides in.
-
#resource ⇒ String
readonly
Resource type (e.g. "table", "autoScalingGroup", "certificate").
-
#resource_name ⇒ String?
readonly
Resource name or path within the resource (i.e. S3 bucket object key) or a wildcard such as
"*". -
#service ⇒ String
readonly
The service namespace that identifies the AWS product (for example, 's3', 'iam', 'codepipeline').
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(resource:, service:, account: nil, arn_format: nil, partition: nil, region: nil, resource_name: nil) ⇒ ARNComponents
constructor
A new instance of ARNComponents.
- #to_jsii ⇒ Object
Constructor Details
#initialize(resource:, service:, account: nil, arn_format: nil, partition: nil, region: nil, resource_name: nil) ⇒ ARNComponents
Returns a new instance of ARNComponents.
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 = 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
#account ⇒ String? (readonly)
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.
45 46 47 |
# File 'arn_components.rb', line 45 def account @account end |
#arn_format ⇒ AWSCDK::ARNFormat? (readonly)
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.
50 51 52 |
# File 'arn_components.rb', line 50 def arn_format @arn_format end |
#partition ⇒ String? (readonly)
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.
60 61 62 |
# File 'arn_components.rb', line 60 def partition @partition end |
#region ⇒ String? (readonly)
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.
68 69 70 |
# File 'arn_components.rb', line 68 def region @region end |
#resource ⇒ String (readonly)
Resource type (e.g. "table", "autoScalingGroup", "certificate"). For some resource types, e.g. S3 buckets, this field defines the bucket name.
33 34 35 |
# File 'arn_components.rb', line 33 def resource @resource end |
#resource_name ⇒ String? (readonly)
Resource name or path within the resource (i.e. S3 bucket object key) or a wildcard such as "*". This is service-dependent.
72 73 74 |
# File 'arn_components.rb', line 72 def resource_name @resource_name end |
#service ⇒ String (readonly)
The service namespace that identifies the AWS product (for example, 's3', 'iam', 'codepipeline').
37 38 39 |
# File 'arn_components.rb', line 37 def service @service end |
Class Method Details
.jsii_properties ⇒ Object
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_jsii ⇒ Object
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 |