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

Allow users to set Elastic Beanstalk tags that include Name #10515

Closed

Conversation

ctreatma
Copy link
Contributor

@ctreatma ctreatma commented Oct 15, 2019

Elastic Beanstalk automatically creates the Name tag for an Elastic
Beanstalk environment, and that tag is not editable. However, tags
that include Name in the tag name are supported by Elastic Beanstalk.

The aws_elastic_beanstalk_environment resource incorrectly ignored
any tag that includes Name in the tag name. This updates the regex
used for identifying ignored tags so that only a tag with the exact
name Name will be ignored, so that terraform users are not blocked
from creating valid Elastic Beanstalk environment tags.

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.tagging.html

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Relates #3963

Release note for CHANGELOG:

resource/aws_elastic_beanstalk_environment: Add support for tags that contain `Name` in the tag name

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSBeanstalkEnv_tagsWithName'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -count 1 -parallel 20 -run=TestAccAWSBeanstalkEnv_tagsWithName -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSBeanstalkEnv_tagsWithName
=== PAUSE TestAccAWSBeanstalkEnv_tagsWithName
=== CONT  TestAccAWSBeanstalkEnv_tagsWithName
--- PASS: TestAccAWSBeanstalkEnv_tagsWithName (561.30s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	564.573s
testing: warning: no tests to run
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/flatmap	0.727s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags	0.352s [no tests to run]

@ctreatma ctreatma requested a review from a team October 15, 2019 20:23
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Oct 15, 2019
@ghost ghost added service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service. size/M Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Nov 15, 2019
@ctreatma
Copy link
Contributor Author

I've added an acceptance test for this change, but I'm unable to run it because the Elastic Beanstalk test config references a solution stack from 2013 that is not available in my AWS accounts: 64bit Amazon Linux running Python. Updating this to a current solution stack caused an 'invalid load balancer config' error from AWS.

@ctreatma
Copy link
Contributor Author

I was able to track down an account that still has access to the old Python solution stack and use it to run the acceptance tests. The PR description has been updated with the test output. I'll file an issue to update the tests so that they do not require access to an account that has used that stack within the past 30 days.

@ctreatma ctreatma force-pushed the feature/beanstalk_update_tags branch from deb784c to 448896b Compare January 3, 2020 14:55
Elastic Beanstalk automatically creates the `Name` tag for an Elastic
Beanstalk environment, and that tag is not editable.  However, tags
that include `Name` in the tag name are supported by Elastic Beanstalk.

The `aws_elastic_beanstalk_environment` resource incorrectly ignored
any tag that includes `Name` in the tag name.  This updates the regex
used for identifying ignored tags so that only a tag with the exact
name `Name` will be ignored, so that terraform users are not blocked
from creating valid Elastic Beanstalk environment tags.

    https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.tagging.html
@ctreatma ctreatma force-pushed the feature/beanstalk_update_tags branch from 448896b to eb230b8 Compare January 10, 2020 21:05
@ewbankkit
Copy link
Contributor

@ctreatma This should be fixed now with #11599 as the IgnoreElasticbeanstalk method now looks for the exact tag key Name and does not use a regex.
Once it's merged you could rebase and run your new test case to verify.

@ctreatma ctreatma closed this Jan 17, 2020
@ghost
Copy link

ghost commented Mar 27, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants