Class: AWSCDK::Lightsail::CfnBucketProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
lightsail/cfn_bucket_props.rb

Overview

Properties for defining a CfnBucket.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bucket_name:, bundle_id:, access_rules: nil, object_versioning: nil, read_only_access_accounts: nil, resources_receiving_access: nil, tags: nil) ⇒ CfnBucketProps

Returns a new instance of CfnBucketProps.

Parameters:

  • bucket_name (String)

    The name of the bucket.

  • bundle_id (String)

    The bundle ID for the bucket (for example, small_1_0 ).

  • access_rules (AWSCDK::IResolvable, AWSCDK::Lightsail::CfnBucket::AccessRulesProperty, nil) (defaults to: nil)

    An object that describes the access rules for the bucket.

  • object_versioning (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Indicates whether object versioning is enabled for the bucket.

  • read_only_access_accounts (Array<String>, nil) (defaults to: nil)

    An array of AWS account IDs that have read-only access to the bucket.

  • resources_receiving_access (Array<String>, nil) (defaults to: nil)

    An array of Lightsail instances that have access to the bucket.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    An array of key-value pairs to apply to this resource.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lightsail/cfn_bucket_props.rb', line 16

def initialize(bucket_name:, bundle_id:, access_rules: nil, object_versioning: nil, read_only_access_accounts: nil, resources_receiving_access: nil, tags: nil)
  @bucket_name = bucket_name
  Jsii::Type.check_type(@bucket_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketName")
  @bundle_id = bundle_id
  Jsii::Type.check_type(@bundle_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bundleId")
  @access_rules = access_rules.is_a?(Hash) ? ::AWSCDK::Lightsail::CfnBucket::AccessRulesProperty.new(**access_rules.transform_keys(&:to_sym)) : access_rules
  Jsii::Type.check_type(@access_rules, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19saWdodHNhaWwuQ2ZuQnVja2V0LkFjY2Vzc1J1bGVzUHJvcGVydHkifV19fQ==")), "accessRules") unless @access_rules.nil?
  @object_versioning = object_versioning
  Jsii::Type.check_type(@object_versioning, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "objectVersioning") unless @object_versioning.nil?
  @read_only_access_accounts = read_only_access_accounts
  Jsii::Type.check_type(@read_only_access_accounts, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "readOnlyAccessAccounts") unless @read_only_access_accounts.nil?
  @resources_receiving_access = resources_receiving_access
  Jsii::Type.check_type(@resources_receiving_access, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "resourcesReceivingAccess") unless @resources_receiving_access.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#access_rulesAWSCDK::IResolvable, ... (readonly)

An object that describes the access rules for the bucket.



49
50
51
# File 'lightsail/cfn_bucket_props.rb', line 49

def access_rules
  @access_rules
end

#bucket_nameString (readonly)

The name of the bucket.



37
38
39
# File 'lightsail/cfn_bucket_props.rb', line 37

def bucket_name
  @bucket_name
end

#bundle_idString (readonly)

The bundle ID for the bucket (for example, small_1_0 ).

A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket.



44
45
46
# File 'lightsail/cfn_bucket_props.rb', line 44

def bundle_id
  @bundle_id
end

#object_versioningBoolean, ... (readonly)

Indicates whether object versioning is enabled for the bucket.

The following options can be configured:

  • Enabled - Object versioning is enabled.
  • Suspended - Object versioning was previously enabled but is currently suspended. Existing object versions are retained.
  • NeverEnabled - Object versioning has never been enabled.


60
61
62
# File 'lightsail/cfn_bucket_props.rb', line 60

def object_versioning
  @object_versioning
end

#read_only_access_accountsArray<String>? (readonly)

An array of AWS account IDs that have read-only access to the bucket.



65
66
67
# File 'lightsail/cfn_bucket_props.rb', line 65

def read_only_access_accounts
  @read_only_access_accounts
end

#resources_receiving_accessArray<String>? (readonly)

An array of Lightsail instances that have access to the bucket.



70
71
72
# File 'lightsail/cfn_bucket_props.rb', line 70

def resources_receiving_access
  @resources_receiving_access
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

An array of key-value pairs to apply to this resource.

For more information, see Tag in the AWS CloudFormation User Guide .

The Value of Tags is optional for Lightsail resources.



79
80
81
# File 'lightsail/cfn_bucket_props.rb', line 79

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



81
82
83
84
85
86
87
88
89
90
91
# File 'lightsail/cfn_bucket_props.rb', line 81

def self.jsii_properties
  {
    :bucket_name => "bucketName",
    :bundle_id => "bundleId",
    :access_rules => "accessRules",
    :object_versioning => "objectVersioning",
    :read_only_access_accounts => "readOnlyAccessAccounts",
    :resources_receiving_access => "resourcesReceivingAccess",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lightsail/cfn_bucket_props.rb', line 93

def to_jsii
  result = {}
  result.merge!({
    "bucketName" => @bucket_name,
    "bundleId" => @bundle_id,
    "accessRules" => @access_rules,
    "objectVersioning" => @object_versioning,
    "readOnlyAccessAccounts" => @read_only_access_accounts,
    "resourcesReceivingAccess" => @resources_receiving_access,
    "tags" => @tags,
  })
  result.compact
end