Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure S3 bucket tags #216

Closed
R-Bower opened this issue Oct 1, 2021 · 7 comments
Closed

Configure S3 bucket tags #216

R-Bower opened this issue Oct 1, 2021 · 7 comments
Labels
question Question about usage of the library
Milestone

Comments

@R-Bower
Copy link

R-Bower commented Oct 1, 2021

I've searched the questions in this repository and wasn't able to find an answer.

Is there a way to configure tags or other options for the generated S3 buckets? I'd like to base them off of environment variables.

@ofhouse
Copy link
Member

ofhouse commented Oct 1, 2021

Tags can only be added to all resources managed by the module, but not to specific resources within the module.

There are 2 ways to add tags to the resources:

  1. With the tags variable:
module "tf_next" {
  source = "milliHQ/next-js/aws"

  providers = {
    aws.global_region = aws.global_region
  }

+ tags = {
+   Name = "my-identiefier"
+ }
}
  1. Adding default tags trough the provider:
provider "aws" {
  default_tags {
    tags = {
      Name = "my-identiefier"
    }
  }
}

If that not helps I would like to know more about your use-case, why the buckets need a specific tagging.

@ofhouse ofhouse added the question Question about usage of the library label Oct 2, 2021
@R-Bower
Copy link
Author

R-Bower commented Oct 5, 2021

If that not helps I would like to know more about your use-case, why the buckets need a specific tagging.

It's company policy to attach specific tags to S3 buckets. Helps the security team manage each resource.

@ofhouse
Copy link
Member

ofhouse commented Oct 8, 2021

So adding the tags to all resources of the module (which would be also propagated to the S3 buckets) as described in my comment above is not working for this case?

@R-Bower
Copy link
Author

R-Bower commented Oct 16, 2021

I only want those tags on the S3 resources.

@ofhouse ofhouse added this to the v0.10.1 milestone Oct 20, 2021
@ofhouse
Copy link
Member

ofhouse commented Oct 20, 2021

Okay, I decided to add an option for this case to pass tags specifically to the S3 resources created by the module.
Will be included in the 0.10.1 release that should be published around 23rd of october.

@R-Bower
Copy link
Author

R-Bower commented Oct 20, 2021

Thank you!

@ofhouse
Copy link
Member

ofhouse commented Oct 23, 2021

There is now a new input variable tags_s3_bucket in v0.10.1 which adds tags to S3 buckets created by the module.

@ofhouse ofhouse closed this as completed Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about usage of the library
Projects
None yet
Development

No branches or pull requests

2 participants