From 9ccd94258ac9970521e766ca645e44cfc3ec808c Mon Sep 17 00:00:00 2001 From: vinay kumar Date: Fri, 13 Aug 2021 13:56:51 -0400 Subject: [PATCH] add tags --- main.tf | 3 ++- outputs.tf | 3 +-- variables.tf | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 9744e66..ff369cb 100644 --- a/main.tf +++ b/main.tf @@ -24,6 +24,8 @@ resource "aws_s3_bucket" "log" { } } } + + tags = variables.tags } data "aws_elb_service_account" "main" { @@ -83,5 +85,4 @@ resource "aws_s3_bucket_public_access_block" "log" { block_public_policy = true ignore_public_acls = true restrict_public_buckets = true - } \ No newline at end of file diff --git a/outputs.tf b/outputs.tf index 56feb64..5733254 100644 --- a/outputs.tf +++ b/outputs.tf @@ -6,5 +6,4 @@ output "arn" { output "id" { description = "The name of the bucket." value = aws_s3_bucket.log.id -} - +} \ No newline at end of file diff --git a/variables.tf b/variables.tf index 62bfa30..db6a449 100644 --- a/variables.tf +++ b/variables.tf @@ -13,4 +13,10 @@ variable "transition_to_glacier" { default = 30 description = "The number of days to wait before transitioning an object to Glacier" type = number +} + +variable "tags" { + description = "(Optional) A mapping of tags to assign to the resources" + type = map(string) + default = {} } \ No newline at end of file