Class: AWSCDK::S3::BucketPolicyProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
s3/bucket_policy_props.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bucket:, document: nil, removal_policy: nil) ⇒ BucketPolicyProps

Returns a new instance of BucketPolicyProps.

Parameters:



9
10
11
12
13
14
15
16
# File 's3/bucket_policy_props.rb', line 9

def initialize(bucket:, document: nil, removal_policy: nil)
  @bucket = bucket
  Jsii::Type.check_type(@bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSUJ1Y2tldCJ9")), "bucket")
  @document = document
  Jsii::Type.check_type(@document, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeURvY3VtZW50In0=")), "document") unless @document.nil?
  @removal_policy = removal_policy
  Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil?
end

Instance Attribute Details

#bucketAWSCDK::S3::IBucket (readonly)

The Amazon S3 bucket that the policy applies to.

Returns:



21
22
23
# File 's3/bucket_policy_props.rb', line 21

def bucket
  @bucket
end

#documentAWSCDK::IAM::PolicyDocument? (readonly)

Note:

Default: - A new empty PolicyDocument will be created.

Policy document to apply to the bucket.

Returns:



26
27
28
# File 's3/bucket_policy_props.rb', line 26

def document
  @document
end

#removal_policyAWSCDK::RemovalPolicy? (readonly)

Note:

Default: - RemovalPolicy.DESTROY.

Policy to apply when the policy is removed from this stack.

Returns:



31
32
33
# File 's3/bucket_policy_props.rb', line 31

def removal_policy
  @removal_policy
end

Class Method Details

.jsii_propertiesObject



33
34
35
36
37
38
39
# File 's3/bucket_policy_props.rb', line 33

def self.jsii_properties
  {
    :bucket => "bucket",
    :document => "document",
    :removal_policy => "removalPolicy",
  }
end

Instance Method Details

#to_jsiiObject



41
42
43
44
45
46
47
48
49
# File 's3/bucket_policy_props.rb', line 41

def to_jsii
  result = {}
  result.merge!({
    "bucket" => @bucket,
    "document" => @document,
    "removalPolicy" => @removal_policy,
  })
  result.compact
end