Provides a lightsail bucket.
resource "aws_lightsail_bucket" "test" {
name = "mytestbucket"
bundle_id = "small_1_0"
}
This resource supports the following arguments:
name
- (Required) The name for the bucket.bundle_id
- (Required) - The ID of the bundle to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.force_delete
- (Optional) - Force Delete non-empty buckets using terraform destroy
. AWS by default will not delete an s3 bucket which is not empty, to prevent losing bucket data and affecting other resources in lightsail. If force_delete
is set to true
the bucket will be deleted even when not empty.tags
- (Optional) A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.This resource exports the following attributes in addition to the arguments above:
id
- The name used for this bucket (matches name
).arn
- The ARN of the lightsail bucket.availability_zone
- The resource Availability Zone. Follows the format us-east-2a (case-sensitive).created_at
- The timestamp when the bucket was created.region
- The Amazon Web Services Region name.support_code
- The support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.tags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.In Terraform v1.5.0 and later, use an import
block to import aws_lightsail_bucket
using the name
attribute. For example:
import {
to = aws_lightsail_bucket.test
id = "example-bucket"
}
Using terraform import
, import aws_lightsail_bucket
using the name
attribute. For example:
% terraform import aws_lightsail_bucket.test example-bucket