Skip to content

Commit

Permalink
Merge pull request #9 from zoitech/feature/add-tags
Browse files Browse the repository at this point in the history
Add variable to tag bucket
  • Loading branch information
gcp87zoi authored Sep 20, 2024
2 parents 7538c67 + 0dfa245 commit 7140aca
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ User-Info = [
"bucket_key: my-s3-bucket/Louie"
]
```
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand Down Expand Up @@ -250,6 +251,7 @@ No modules.
| <a name="input_s3_lifecycle_prevent_destroy"></a> [s3\_lifecycle\_prevent\_destroy](#input\_s3\_lifecycle\_prevent\_destroy) | Prevent/allow terraform to destroy the bucket | `bool` | `false` | no |
| <a name="input_s3_versioning_enabled"></a> [s3\_versioning\_enabled](#input\_s3\_versioning\_enabled) | To enable file versioning | `bool` | `false` | no |
| <a name="input_suffix"></a> [suffix](#input\_suffix) | A suffix which is added to each resource name. | `string` | `""` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to be added to the bucket | `map(string)` | `{}` | no |

## Outputs

Expand All @@ -261,3 +263,4 @@ No modules.
| <a name="output_s3_get_delete_user_info"></a> [s3\_get\_delete\_user\_info](#output\_s3\_get\_delete\_user\_info) | n/a |
| <a name="output_s3_list_delete_user_info"></a> [s3\_list\_delete\_user\_info](#output\_s3\_list\_delete\_user\_info) | n/a |
| <a name="output_standard_user_info"></a> [standard\_user\_info](#output\_standard\_user\_info) | n/a |
<!-- END_TF_DOCS -->
2 changes: 2 additions & 0 deletions s3_bucket.tf
Original file line number Diff line number Diff line change
@@ -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" {
Expand Down
6 changes: 6 additions & 0 deletions variables_s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
}

0 comments on commit 7140aca

Please sign in to comment.