diff --git a/CHANGELOG.md b/CHANGELOG.md index c0d3567..a7683be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## Release Version: 1.1.0 +ENHANCEMENTS: +* Add variable to tag bucket + ## Release Version: 1.0.1 ENHANCEMENTS: * Fix deprecated terraform resources diff --git a/README.md b/README.md index c7cf543..57ce5fe 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,7 @@ User-Info = [ "bucket_key: my-s3-bucket/Louie" ] ``` + ## Requirements | Name | Version | @@ -250,6 +251,7 @@ No modules. | [s3\_lifecycle\_prevent\_destroy](#input\_s3\_lifecycle\_prevent\_destroy) | Prevent/allow terraform to destroy the bucket | `bool` | `false` | no | | [s3\_versioning\_enabled](#input\_s3\_versioning\_enabled) | To enable file versioning | `bool` | `false` | no | | [suffix](#input\_suffix) | A suffix which is added to each resource name. | `string` | `""` | no | +| [tags](#input\_tags) | Tags to be added to the bucket | `map(string)` | `{}` | no | ## Outputs @@ -261,3 +263,4 @@ No modules. | [s3\_get\_delete\_user\_info](#output\_s3\_get\_delete\_user\_info) | n/a | | [s3\_list\_delete\_user\_info](#output\_s3\_list\_delete\_user\_info) | n/a | | [standard\_user\_info](#output\_standard\_user\_info) | n/a | + \ No newline at end of file diff --git a/s3_bucket.tf b/s3_bucket.tf index 0707ed0..6f9d8d3 100644 --- a/s3_bucket.tf +++ b/s3_bucket.tf @@ -1,6 +1,8 @@ # The S3 bucket resource "aws_s3_bucket" "s3_bucket" { bucket = var.s3_bucket_name + + tags = merge({ Name = var.s3_bucket_name }, var.tags) } resource "aws_s3_bucket_acl" "name" { diff --git a/variables_s3.tf b/variables_s3.tf index 5c53017..59f90b8 100644 --- a/variables_s3.tf +++ b/variables_s3.tf @@ -47,4 +47,10 @@ variable "lifecycle_config_rule_id" { description = "ID of the lifecycle configuration rule" default = "" type = string +} + +variable "tags" { + description = "Tags to be added to the bucket" + type = map(string) + default = {} } \ No newline at end of file