Create S3 Bucket in AWS
Before executing you must configure the environment variables:
Linux:
$ export AWS_ACCESS_KEY_ID="XXXXXXXXXXXX"
$ export AWS_SECRET_ACCESS_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Windows:
set AWS_ACCESS_KEY_ID="XXXXXXXXXXXX"
set AWS_SECRET_ACCESS_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
To run this example you need to execute:
$ terraform init
$ terraform plan
$ terraform apply
If you want to change the variables, you need to execute:
$ terraform init
$ terraform plan
$ terraform apply -var="region=us-east-2" -var="acl=private" -var="bucket=buckettestflugel" -var="tags_name=Flugel" -var="tags_owner=InfraTeam"
Note that this example may create resources which cost money. Run terraform destroy
when you don't need these resources.
- Complete - Complete S3 bucket with most of supported features enabled
- Cross-Region Replication - S3 bucket with Cross-Region Replication (CRR) enabled
- S3 bucket Notifications - S3 bucket notifications to Lambda functions, SQS queues, and SNS topics.
Name | Version |
---|---|
terraform | >= 0.12.6 |
aws | >= 3.0 |
Name | Version |
---|---|
aws | >= 3.0 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
region | (Optional) Region of the AWS provider. | string |
"us-east-2" |
no |
acl | (Optional) The canned ACL to apply. Defaults to 'private'. Conflicts with grant |
string |
"private" |
no |
bucket | (Optional, Forces new resource) The name of the bucket. If omitted, Terraform will assign a random, unique name. | string |
"buckettestflugel" |
no |
tags_name | (Optional) A mapping of tags (Name) to assign to the bucket. | string |
"Flugel" |
no |
tags_owner | (Optional) A mapping of tags (Owner) to assign to the bucket. | string |
"InfraTeam" |
no |
Name | Description |
---|---|
_s3_bucket_arn | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. |
_s3_bucket_id | The name of the bucket. |
_s3_bucket_tags | The tags of the bucket. |
Module managed by Ronald Saenz.
GNU General Public Licensed. See LICENSE for full details.