Class: AWSCDK::S3::BucketAttributes
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::S3::BucketAttributes
- Defined in:
- s3/bucket_attributes.rb
Overview
A reference to a bucket outside this stack.
Instance Attribute Summary collapse
-
#account ⇒ String?
readonly
The account this existing bucket belongs to.
-
#bucket_arn ⇒ String?
readonly
The ARN of the bucket.
-
#bucket_domain_name ⇒ String?
readonly
The domain name of the bucket.
-
#bucket_dual_stack_domain_name ⇒ String?
readonly
The IPv6 DNS name of the specified bucket.
-
#bucket_name ⇒ String?
readonly
The name of the bucket.
-
#bucket_regional_domain_name ⇒ String?
readonly
The regional domain name of the specified bucket.
-
#bucket_website_new_url_format ⇒ Boolean?
readonly
deprecated
Deprecated.
The correct website url format can be inferred automatically from the bucket
region. Always provide the bucket region if thebucketWebsiteUrlwill be used. Alternatively provide the fullbucketWebsiteUrlmanually. -
#bucket_website_url ⇒ String?
readonly
The website URL of the bucket (if static web hosting is enabled).
-
#encryption_key ⇒ AWSCDK::KMS::IKey?
readonly
KMS encryption key associated with this bucket.
-
#is_website ⇒ Boolean?
readonly
If this bucket has been configured for static website hosting.
-
#notifications_handler_role ⇒ AWSCDK::IAM::IRole?
readonly
The role to be used by the notifications handler.
-
#region ⇒ String?
readonly
The region this existing bucket is in.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(account: nil, bucket_arn: nil, bucket_domain_name: nil, bucket_dual_stack_domain_name: nil, bucket_name: nil, bucket_regional_domain_name: nil, bucket_website_new_url_format: nil, bucket_website_url: nil, encryption_key: nil, is_website: nil, notifications_handler_role: nil, region: nil) ⇒ BucketAttributes
constructor
A new instance of BucketAttributes.
- #to_jsii ⇒ Object
Constructor Details
#initialize(account: nil, bucket_arn: nil, bucket_domain_name: nil, bucket_dual_stack_domain_name: nil, bucket_name: nil, bucket_regional_domain_name: nil, bucket_website_new_url_format: nil, bucket_website_url: nil, encryption_key: nil, is_website: nil, notifications_handler_role: nil, region: nil) ⇒ BucketAttributes
Returns a new instance of BucketAttributes.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 's3/bucket_attributes.rb', line 19 def initialize(account: nil, bucket_arn: nil, bucket_domain_name: nil, bucket_dual_stack_domain_name: nil, bucket_name: nil, bucket_regional_domain_name: nil, bucket_website_new_url_format: nil, bucket_website_url: nil, encryption_key: nil, is_website: nil, notifications_handler_role: nil, region: nil) @account = account Jsii::Type.check_type(@account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "account") unless @account.nil? @bucket_arn = bucket_arn Jsii::Type.check_type(@bucket_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketArn") unless @bucket_arn.nil? @bucket_domain_name = bucket_domain_name Jsii::Type.check_type(@bucket_domain_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketDomainName") unless @bucket_domain_name.nil? @bucket_dual_stack_domain_name = bucket_dual_stack_domain_name Jsii::Type.check_type(@bucket_dual_stack_domain_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketDualStackDomainName") unless @bucket_dual_stack_domain_name.nil? @bucket_name = bucket_name Jsii::Type.check_type(@bucket_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketName") unless @bucket_name.nil? @bucket_regional_domain_name = bucket_regional_domain_name Jsii::Type.check_type(@bucket_regional_domain_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketRegionalDomainName") unless @bucket_regional_domain_name.nil? @bucket_website_new_url_format = bucket_website_new_url_format Jsii::Type.check_type(@bucket_website_new_url_format, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "bucketWebsiteNewUrlFormat") unless @bucket_website_new_url_format.nil? @bucket_website_url = bucket_website_url Jsii::Type.check_type(@bucket_website_url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketWebsiteUrl") unless @bucket_website_url.nil? @encryption_key = encryption_key Jsii::Type.check_type(@encryption_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "encryptionKey") unless @encryption_key.nil? @is_website = is_website Jsii::Type.check_type(@is_website, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "isWebsite") unless @is_website.nil? @notifications_handler_role = notifications_handler_role Jsii::Type.check_type(@notifications_handler_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "notificationsHandlerRole") unless @notifications_handler_role.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: - it's assumed the bucket belongs to the same account as the scope it's being imported into
The account this existing bucket belongs to.
50 51 52 |
# File 's3/bucket_attributes.rb', line 50 def account @account end |
#bucket_arn ⇒ String? (readonly)
The ARN of the bucket.
At least one of bucketArn or bucketName must be defined in order to initialize a bucket ref.
57 58 59 |
# File 's3/bucket_attributes.rb', line 57 def bucket_arn @bucket_arn end |
#bucket_domain_name ⇒ String? (readonly)
Default: - Inferred from bucket name
The domain name of the bucket.
62 63 64 |
# File 's3/bucket_attributes.rb', line 62 def bucket_domain_name @bucket_domain_name end |
#bucket_dual_stack_domain_name ⇒ String? (readonly)
The IPv6 DNS name of the specified bucket.
66 67 68 |
# File 's3/bucket_attributes.rb', line 66 def bucket_dual_stack_domain_name @bucket_dual_stack_domain_name end |
#bucket_name ⇒ String? (readonly)
The name of the bucket.
If the underlying value of ARN is a string, the name will be parsed from the ARN. Otherwise, the name is optional, but some features that require the bucket name such as auto-creating a bucket policy, won't work.
75 76 77 |
# File 's3/bucket_attributes.rb', line 75 def bucket_name @bucket_name end |
#bucket_regional_domain_name ⇒ String? (readonly)
The regional domain name of the specified bucket.
79 80 81 |
# File 's3/bucket_attributes.rb', line 79 def bucket_regional_domain_name @bucket_regional_domain_name end |
#bucket_website_new_url_format ⇒ Boolean? (readonly)
The correct website url format can be inferred automatically from the bucket region. Always provide the bucket region if the bucketWebsiteUrl will be used. Alternatively provide the full bucketWebsiteUrl manually.
Default: - inferred from available region information, false otherwise
Force the format of the website URL of the bucket.
This should be true for regions launched since 2014.
88 89 90 |
# File 's3/bucket_attributes.rb', line 88 def bucket_website_new_url_format @bucket_website_new_url_format end |
#bucket_website_url ⇒ String? (readonly)
Default: - Inferred from bucket name and region
The website URL of the bucket (if static web hosting is enabled).
93 94 95 |
# File 's3/bucket_attributes.rb', line 93 def bucket_website_url @bucket_website_url end |
#encryption_key ⇒ AWSCDK::KMS::IKey? (readonly)
Default: - no encryption key
KMS encryption key associated with this bucket.
98 99 100 |
# File 's3/bucket_attributes.rb', line 98 def encryption_key @encryption_key end |
#is_website ⇒ Boolean? (readonly)
Default: false
If this bucket has been configured for static website hosting.
103 104 105 |
# File 's3/bucket_attributes.rb', line 103 def is_website @is_website end |
#notifications_handler_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - a new role will be created.
The role to be used by the notifications handler.
108 109 110 |
# File 's3/bucket_attributes.rb', line 108 def notifications_handler_role @notifications_handler_role end |
#region ⇒ String? (readonly)
Default: - it's assumed the bucket is in the same region as the scope it's being imported into
The region this existing bucket is in.
Features that require the region (e.g. bucket_website_url) won't fully work
if the region cannot be correctly inferred.
116 117 118 |
# File 's3/bucket_attributes.rb', line 116 def region @region end |
Class Method Details
.jsii_properties ⇒ Object
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 's3/bucket_attributes.rb', line 118 def self.jsii_properties { :account => "account", :bucket_arn => "bucketArn", :bucket_domain_name => "bucketDomainName", :bucket_dual_stack_domain_name => "bucketDualStackDomainName", :bucket_name => "bucketName", :bucket_regional_domain_name => "bucketRegionalDomainName", :bucket_website_new_url_format => "bucketWebsiteNewUrlFormat", :bucket_website_url => "bucketWebsiteUrl", :encryption_key => "encryptionKey", :is_website => "isWebsite", :notifications_handler_role => "notificationsHandlerRole", :region => "region", } end |
Instance Method Details
#to_jsii ⇒ Object
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 's3/bucket_attributes.rb', line 135 def to_jsii result = {} result.merge!({ "account" => @account, "bucketArn" => @bucket_arn, "bucketDomainName" => @bucket_domain_name, "bucketDualStackDomainName" => @bucket_dual_stack_domain_name, "bucketName" => @bucket_name, "bucketRegionalDomainName" => @bucket_regional_domain_name, "bucketWebsiteNewUrlFormat" => @bucket_website_new_url_format, "bucketWebsiteUrl" => @bucket_website_url, "encryptionKey" => @encryption_key, "isWebsite" => @is_website, "notificationsHandlerRole" => @notifications_handler_role, "region" => @region, }) result.compact end |