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

fix(ec2_eip): Fix default tags not set, #25567 #26308

Merged
merged 2 commits into from
Aug 22, 2022

Conversation

sbocinec
Copy link
Contributor

@sbocinec sbocinec commented Aug 15, 2022

Signed-off-by: Stano Bocinec stano@redpanda.com

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" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #25567

Output from acceptance testing:

$ make testacc TESTS=TestAccEC2EIP_Tags PKG=ec2 AWS_REGION=eu-north-1                                                                  ==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2EIP_Tags'  -timeout 180m
=== RUN   TestAccEC2EIP_TagsEC2VPC_withVPCTrue
=== PAUSE TestAccEC2EIP_TagsEC2VPC_withVPCTrue
=== RUN   TestAccEC2EIP_TagsEC2VPC_withoutVPCTrue
=== PAUSE TestAccEC2EIP_TagsEC2VPC_withoutVPCTrue
=== RUN   TestAccEC2EIP_TagsEC2Classic_withVPCTrue
=== PAUSE TestAccEC2EIP_TagsEC2Classic_withVPCTrue
=== RUN   TestAccEC2EIP_TagsEC2Classic_withoutVPCTrue
=== PAUSE TestAccEC2EIP_TagsEC2Classic_withoutVPCTrue
=== CONT  TestAccEC2EIP_TagsEC2VPC_withVPCTrue
=== CONT  TestAccEC2EIP_TagsEC2Classic_withVPCTrue
=== CONT  TestAccEC2EIP_TagsEC2VPC_withoutVPCTrue
=== CONT  TestAccEC2EIP_TagsEC2Classic_withoutVPCTrue
=== CONT  TestAccEC2EIP_TagsEC2Classic_withVPCTrue
    ec2_classic.go:62: this test can only run in EC2-Classic, platforms available in us-east-1: ["VPC"]
--- SKIP: TestAccEC2EIP_TagsEC2Classic_withVPCTrue (4.19s)
=== CONT  TestAccEC2EIP_TagsEC2Classic_withoutVPCTrue
    ec2_classic.go:62: this test can only run in EC2-Classic, platforms available in us-east-1: ["VPC"]
--- SKIP: TestAccEC2EIP_TagsEC2Classic_withoutVPCTrue (4.19s)
--- PASS: TestAccEC2EIP_TagsEC2VPC_withVPCTrue (39.31s)
--- PASS: TestAccEC2EIP_TagsEC2VPC_withoutVPCTrue (39.31s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	39.370s
...

Rationale

The default_tags set on the provider level are not applied on the aws_eip resource created. This bug fires when there are only default_tags set as the resource implementation is actually not properly checking length of merged tags (default + resource level). This PR fixes this

Signed-off-by: Stano Bocinec <stano@redpanda.com>
@github-actions github-actions bot added service/ec2 Issues and PRs that pertain to the ec2 service. size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. and removed service/ec2 Issues and PRs that pertain to the ec2 service. labels Aug 15, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @sbocinec 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 17, 2022
@ewbankkit ewbankkit added service/ec2 Issues and PRs that pertain to the ec2 service. tags Pertains to resource tagging. labels Aug 22, 2022
@github-actions github-actions bot removed the tags Pertains to resource tagging. label Aug 22, 2022
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccEC2EIP_Tags' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccEC2EIP_Tags -timeout 180m
=== RUN   TestAccEC2EIP_TagsEC2VPC_withVPCTrue
=== PAUSE TestAccEC2EIP_TagsEC2VPC_withVPCTrue
=== RUN   TestAccEC2EIP_TagsEC2VPC_withoutVPCTrue
=== PAUSE TestAccEC2EIP_TagsEC2VPC_withoutVPCTrue
=== RUN   TestAccEC2EIP_TagsEC2Classic_withVPCTrue
=== PAUSE TestAccEC2EIP_TagsEC2Classic_withVPCTrue
=== RUN   TestAccEC2EIP_TagsEC2Classic_withoutVPCTrue
=== PAUSE TestAccEC2EIP_TagsEC2Classic_withoutVPCTrue
=== CONT  TestAccEC2EIP_TagsEC2VPC_withVPCTrue
=== CONT  TestAccEC2EIP_TagsEC2Classic_withVPCTrue
--- PASS: TestAccEC2EIP_TagsEC2Classic_withVPCTrue (18.93s)
=== CONT  TestAccEC2EIP_TagsEC2Classic_withoutVPCTrue
--- PASS: TestAccEC2EIP_TagsEC2Classic_withoutVPCTrue (3.23s)
=== CONT  TestAccEC2EIP_TagsEC2VPC_withoutVPCTrue
--- PASS: TestAccEC2EIP_TagsEC2VPC_withVPCTrue (27.20s)
--- PASS: TestAccEC2EIP_TagsEC2VPC_withoutVPCTrue (26.15s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	52.178s

@ewbankkit ewbankkit merged commit 6000e54 into hashicorp:main Aug 22, 2022
@github-actions github-actions bot added this to the v4.28.0 milestone Aug 22, 2022
@github-actions
Copy link

This functionality has been released in v4.28.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resource/eip: Does not set default tags on Create
3 participants