Provides an Amazon S3 Express directory bucket resource.
resource "aws_s3_directory_bucket" "example" {
bucket = "example--usw2-az1--x-s3"
location {
name = "usw2-az1"
}
}
This resource supports the following arguments:
bucket
- (Required) Name of the bucket. The name must be in the format [bucket_name]--[azid]--x-s3
. Use the aws_s3_bucket
resource to manage general purpose buckets.data_redundancy
- (Optional, Default:SingleAvailabilityZone
) Data redundancy. Valid values: SingleAvailabilityZone
.force_destroy
- (Optional, Default:false
) Boolean that indicates all objects should be deleted from the bucket when the bucket is destroyed so that the bucket can be destroyed without error. These objects are not recoverable. This only deletes objects when the bucket is destroyed, not when setting this parameter to true
. Once this parameter is set to true
, there must be a successful terraform apply
run before a destroy is required to update this value in the resource state. Without a successful terraform apply
after this parameter is set, this flag will have no effect. If setting this field in the same operation that would require replacing the bucket or destroying the bucket, this flag will not work. Additionally when importing a bucket, a successful terraform apply
is required to set this value in state before it will take effect on a destroy operation.location
- (Required) Bucket location. See Location below for more details.type
- (Optional, Default:Directory
) Bucket type. Valid values: Directory
.The location
block supports the following:
name
- (Required) Availability Zone ID.type
- (Optional, Default:AvailabilityZone
) Location type. Valid values: AvailabilityZone
.This resource exports the following attributes in addition to the arguments above:
id
- Name of the bucket.arn
- ARN of the bucket.In Terraform v1.5.0 and later, use an import
block to import an Amazon S3 Express directory bucket using bucket
. For example:
import {
to = aws_s3_directory_bucket.example
id = "example--usw2-az1--x-s3"
}
Using terraform import
, import S3 bucket using bucket
. For example:
% terraform import aws_s3_directory_bucket.example example--usw2-az1--x-s3