aws::s3-bucket¶
Creates an S3 bucket with enabled/disabled object lock.
Example¶
aws::s3-bucket bucket
name: bucket-example
enable-object-lock: true
tags: {
Name: "bucket-example"
}
enable-accelerate-config: true
enable-versioning: true
policy: "policy.json"
end
Example with cors rule¶
aws::s3-bucket bucket
name: bucket-example-with-cors
enable-object-lock: true
tags: {
Name: "bucket-example"
}
enable-accelerate-config: true
enable-versioning: true
cors-rule
allowed-origins: [
"*"
]
allowed-methods: [
"PUT"
]
max-age-seconds: 300
end
end
Example with life cycle rule¶
aws::s3-bucket bucket
name: bucket-example-with-lifecycle
enable-object-lock: true
tags: {
Name: "bucket-example"
}
enable-accelerate-config: true
enable-versioning: true
lifecycle-rule
id: "rule no prefix and no tag"
status: "Disabled"
transition
days: 40
storage-class: "STANDARD_IA"
end
noncurrent-version-transition
days: 40
storage-class: "STANDARD_IA"
end
expiration
expired-object-delete-marker: false
end
noncurrent-version-expiration
days: 403
end
abort-incomplete-multipart-upload
days-after-initiation: 5
end
end
end
Example with replication configuration¶
aws::s3-bucket bucket-example
name: "beam-sandbox-bucket-us-east-2"
tags: {
Name: "bucket-example",
Name2: "something"
}
enable-accelerate-config: true
enable-versioning: true
replication-configuration
role: $(external-query aws::iam-role { name: 's3crr_role_for_sandbox-bucket-example-logging_to_beam-sandbox-br'})
rule
id: "example_with_encryption"
destination
bucket: "beam-sandbox-ops-us-east-1a"
encryption-configuration
kms-key: $(external-query aws::kms-key { key-id: '<key-id>'})
end
end
source-selection-criteria
sse-kms-encrypted-objects-status: ENABLED
end
filter
prefix: "logs/"
end
priority: 1
status: enabled
delete-marker-replication-status: disabled
end
rule
id: "example_with_complex_filter"
destination
bucket: "beam-sandbox-ops-us-east-1a"
end
filter
and-operator
prefix: "thousand-year-door"
tag
key: "paper"
value: "mario"
end
end
end
priority: 2
status: enabled
delete-marker-replication-status: disabled
end
rule
id: "example_with_access_control"
destination
bucket: "beam-sandbox-ops-us-east-1a"
account: "242040583208"
access-control-translation
owner-override: destination
end
end
priority: 3
status: enabled
delete-marker-replication-status: disabled
end
end
end
Example with logging enabled¶
aws::s3-bucket bucket-example
name: "beam-sandbox-logging-enabled"
enable-object-lock: false
tags: {
Name: "bucket-example",
Name2: "something"
}
logging
bucket: "beam-sandbox-s3-logs"
end
enable-accelerate-config: true
enable-versioning: true
end
Example with encryption configuration¶
aws::s3-bucket bucket-example-with-encryption
name: "example-bucket-with-encryption-config"
enable-object-lock: true
tags: {
Name: "bucket-example"
}
encryption-configuration
encryption-rule
default-encryption
key: $(external-query aws::kms-key { key-id: '<key-id>'})
encryption-type: "aws:kms"
end
end
end
end
Example with control access policy¶
aws::s3-bucket example-bucket-with-full-control-log-delivery-group
name: "example-bucket-with-full-control-log-delivery-group"
enable-object-lock: true
access-control-policy
grant
permission: "FULL_CONTROL"
grantee
uri: "http://acs.amazonaws.com/groups/s3/LogDelivery"
type: "Group"
end
end
end
end
Example with intelligent tiering¶
aws::s3-bucket bucket-example-with-intelligent-tiering
name: "example-bucket-with-intelligent-tiering"
enable-object-lock: true
intelligent-tiering-configuration
id: test-config
tiering
days: 90
access-tier: "ARCHIVE_ACCESS"
end
tiering
days: 182
access-tier: "DEEP_ARCHIVE_ACCESS"
end
filter
prefix: "something"
tag
key: "name1"
value: "value1"
end
tag
key: "name2"
value: "value2"
end
end
status: "Disabled"
end
tags: {
Name: "bucket-example--with-intelligent-tiering"
}
end
Example with Public Access Blocks¶
aws::s3-bucket bucket-example
name: "bucket-example"
enable-object-lock: true
tags: {
Name: "bucket-example",
Name2: "something"
}
public-access-block-configuration
block-public-acls: true
ignore-public-acls: true
block-public-policy: false
restrict-public-buckets: true
end
enable-accelerate-config: true
enable-versioning: true
policy: "policy.json"
end
Attributes¶
Attribute | Description |
---|---|
name | The name of the bucket. (Required) |
enable-object-lock | Enable object lock property for the bucket which prevents objects from being deleted. Can only be set during creation. See S3 Object Lock. |
tags map | Tags for the bucket. |
enable-accelerate-config | Enable fast easy and secure transfers of files to and from the bucket. See S3 Transfer Acceleration. |
enable-versioning | Enable keeping multiple versions of an object in the same bucket. Updatable only when object lock is disabled. See S3 Versioning. |
request-payer | Does the requester pay for requests to the bucket or the owner. Defaults to BUCKET_OWNER . Valid values are BUCKET_OWNER or REQUESTER . See S3 Requester Pays Bucket. |
cors-rule list subresource | Configure the cross origin request policy for the bucket.
|
lifecycle-rule list subresource | Configure the cross origin request policy for the bucket.
|
logging subresource | Configure where access logs are sent.
|
replication-configuration subresource | Configure the replication rules for the bucket.
|
encryption-configuration subresource | Configure the server side encryption for the bucket.
|
policy | The bucket policy as a JSON document. |
access-control-policy subresource | Configure the access control policy of the bucket.
|
intelligent-tiering-configuration list subresource | Configure intelligent tiering on the bucket.
|
public-access-block-configuration subresource | The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket.
|
object-ownership | The bucket’s ownership controls. Valid values are BucketOwnerPreferred , ObjectWriter or BucketOwnerEnforced . |