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

TechDebt: Move lightsail_domain_entry to common separator #30820

Merged

Conversation

brittandeyoung
Copy link
Collaborator

@brittandeyoung brittandeyoung commented Apr 19, 2023

Description

This pull request moves the lightsail_domain_entry resource to use the standard resource id separator while still allowing imports and reading of existing resources using the legacy separator. Any instance of the legacy separator will be updated to the new separator on state refresh.

The ExpandResourceId and FlattenResourceId common functions have been expanded to require a boolean to determine if empty parts should be allowed. Added test cases for verify this new functionality.

Added the ResourceIdPartCount function to get the part count of an Id utilizing the standard resource separator. Added test cases to validate function.

Relations

Relates #27843

References

Output from Acceptance Testing

$ make testacc TESTARGS='-run=TestAccLightsailDomainEntry' PKG=lightsail 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lightsail/... -v -count 1 -parallel 20  -run=TestAccLightsailDomainEntry -timeout 180m
=== RUN   TestAccLightsailDomainEntry_basic
=== PAUSE TestAccLightsailDomainEntry_basic
=== RUN   TestAccLightsailDomainEntry_underscore
=== PAUSE TestAccLightsailDomainEntry_underscore
=== RUN   TestAccLightsailDomainEntry_apex
=== PAUSE TestAccLightsailDomainEntry_apex
=== RUN   TestAccLightsailDomainEntry_disappears
=== PAUSE TestAccLightsailDomainEntry_disappears
=== CONT  TestAccLightsailDomainEntry_apex
=== CONT  TestAccLightsailDomainEntry_basic
=== CONT  TestAccLightsailDomainEntry_underscore
=== CONT  TestAccLightsailDomainEntry_disappears
--- PASS: TestAccLightsailDomainEntry_disappears (31.28s)
--- PASS: TestAccLightsailDomainEntry_underscore (35.72s)
--- PASS: TestAccLightsailDomainEntry_basic (35.95s)
--- PASS: TestAccLightsailDomainEntry_apex (36.11s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lightsail  39.151s

➜ terraform-provider-aws (main) ✗ make testacc TESTARGS='-run=TestAccLightsailBucketAccessKey' PKG=lightsail
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lightsail/... -v -count 1 -parallel 20  -run=TestAccLightsailBucketAccessKey -timeout 180m
=== RUN   TestAccLightsailBucketAccessKey_basic
=== PAUSE TestAccLightsailBucketAccessKey_basic
=== RUN   TestAccLightsailBucketAccessKey_disappears
=== PAUSE TestAccLightsailBucketAccessKey_disappears
=== CONT  TestAccLightsailBucketAccessKey_basic
=== CONT  TestAccLightsailBucketAccessKey_disappears
--- PASS: TestAccLightsailBucketAccessKey_disappears (38.21s)
--- PASS: TestAccLightsailBucketAccessKey_basic (39.96s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lightsail  43.226s
➜ terraform-provider-aws (td-lightsail_domain_entry_common_separator) ✔ make testacc TESTARGS='-run=TestAccLightsailBucketResourceAccess' PKG=lightsail
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lightsail/... -v -count 1 -parallel 20  -run=TestAccLightsailBucketResourceAccess -timeout 180m
=== RUN   TestAccLightsailBucketResourceAccess_basic
=== PAUSE TestAccLightsailBucketResourceAccess_basic
=== RUN   TestAccLightsailBucketResourceAccess_disappears
=== PAUSE TestAccLightsailBucketResourceAccess_disappears
=== CONT  TestAccLightsailBucketResourceAccess_basic
=== CONT  TestAccLightsailBucketResourceAccess_disappears
--- PASS: TestAccLightsailBucketResourceAccess_basic (64.33s)
--- PASS: TestAccLightsailBucketResourceAccess_disappears (71.38s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lightsail  74.437s

...

@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. flex Pertains to FLatteners and EXpanders. service/lightsail Issues and PRs that pertain to the lightsail service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. labels Apr 19, 2023
@brittandeyoung brittandeyoung added the technical-debt Addresses areas of the codebase that need refactoring or redesign. label Apr 19, 2023
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. breaking-change Introduces a breaking change in current functionality; usually deferred to the next major release. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 19, 2023
@brittandeyoung
Copy link
Collaborator Author

@justinretzolk This change will not be a breaking change as the old id and new id are both supported.

@justinretzolk
Copy link
Member

Hey @brittandeyoung 👋 Sorry about that! I pulled the label over based on the linked issue. Will remove it now!

@justinretzolk justinretzolk removed the breaking-change Introduces a breaking change in current functionality; usually deferred to the next major release. label Apr 19, 2023
@jar-b jar-b self-assigned this May 11, 2023
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

$ go test -count=1 ./internal/flex/...
ok      github.com/hashicorp/terraform-provider-aws/internal/flex       0.168s
$ make testacc TESTARGS='-run=TestAccLightsailDomainEntry' PKG=lightsail
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lightsail/... -v -count 1 -parallel 20  -run=TestAccLightsailDomainEntry -timeout 180m

--- PASS: TestAccLightsailDomainEntry_disappears (28.13s)
--- PASS: TestAccLightsailDomainEntry_underscore (30.74s)
--- PASS: TestAccLightsailDomainEntry_apex (31.18s)
--- PASS: TestAccLightsailDomainEntry_basic (31.90s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lightsail  38.535s
$ make testacc TESTARGS='-run=TestAccLightsailBucketAccessKey' PKG=lightsail
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lightsail/... -v -count 1 -parallel 20  -run=TestAccLightsailBucketAccessKey -timeout 180m

--- PASS: TestAccLightsailBucketAccessKey_disappears (43.86s)
--- PASS: TestAccLightsailBucketAccessKey_basic (47.16s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lightsail  51.890
$ make testacc TESTARGS='-run=TestAccLightsailBucketResourceAccess' PKG=lightsail
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lightsail/... -v -count 1 -parallel 20  -run=TestAccLightsailBucketResourceAccess -timeout 180m

--- PASS: TestAccLightsailBucketResourceAccess_basic (79.21s)
--- PASS: TestAccLightsailBucketResourceAccess_disappears (80.16s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lightsail  83.543s

@jar-b
Copy link
Member

jar-b commented May 11, 2023

Proceeding with merge. Failing dead link check will be fixed with #31337.

@jar-b jar-b merged commit f9cfdb4 into hashicorp:main May 11, 2023
@github-actions github-actions bot added this to the v4.67.0 milestone May 11, 2023
@jar-b
Copy link
Member

jar-b commented May 11, 2023

Thanks for your contribution, @brittandeyoung! 👏

@github-actions
Copy link

This functionality has been released in v4.67.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 Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. flex Pertains to FLatteners and EXpanders. service/lightsail Issues and PRs that pertain to the lightsail service. size/XL Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign. 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.

3 participants