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

aws_ec2_transit_gateway_peering_attachment: add attachment status #36304

Merged
merged 7 commits into from Mar 12, 2024

Conversation

partcyborg
Copy link

Description

Add the Transit Gateway Peering Attachment status to the resource and data source.

Relations

Closes #36261

References

The same issue was reported in #26754, however this is an alternative solution

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccTransitGateway_serial/PeeringAttachment' PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20  -run=TestAccTransitGateway_serial/PeeringAttachment -timeout 360m
=== RUN   TestAccTransitGateway_serial
=== PAUSE TestAccTransitGateway_serial
=== CONT  TestAccTransitGateway_serial
=== RUN   TestAccTransitGateway_serial/PeeringAttachment
=== RUN   TestAccTransitGateway_serial/PeeringAttachment/disappears
=== RUN   TestAccTransitGateway_serial/PeeringAttachment/tags
=== RUN   TestAccTransitGateway_serial/PeeringAttachment/DifferentAccount
    transitgateway_peering_attachment_test.go:154: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
=== RUN   TestAccTransitGateway_serial/PeeringAttachment/basic
=== RUN   TestAccTransitGateway_serial/PeeringAttachmentAccepter
=== RUN   TestAccTransitGateway_serial/PeeringAttachmentAccepter/tags
=== RUN   TestAccTransitGateway_serial/PeeringAttachmentAccepter/DifferentAccount
    transitgateway_peering_attachment_accepter_test.go:121: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
=== RUN   TestAccTransitGateway_serial/PeeringAttachmentAccepter/basic
--- PASS: TestAccTransitGateway_serial (1895.67s)
    --- PASS: TestAccTransitGateway_serial/PeeringAttachment (791.78s)
        --- PASS: TestAccTransitGateway_serial/PeeringAttachment/disappears (230.56s)
        --- PASS: TestAccTransitGateway_serial/PeeringAttachment/tags (319.34s)
        --- SKIP: TestAccTransitGateway_serial/PeeringAttachment/DifferentAccount (0.07s)
        --- PASS: TestAccTransitGateway_serial/PeeringAttachment/basic (241.81s)
    --- PASS: TestAccTransitGateway_serial/PeeringAttachmentAccepter (1103.88s)
        --- PASS: TestAccTransitGateway_serial/PeeringAttachmentAccepter/tags (587.42s)
        --- SKIP: TestAccTransitGateway_serial/PeeringAttachmentAccepter/DifferentAccount (0.00s)
        --- PASS: TestAccTransitGateway_serial/PeeringAttachmentAccepter/basic (516.47s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	1895.760

% make testacc TESTARGS='-run=TestAccTransitGatewayDataSource_serial/PeeringAttachment' PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20  -run=TestAccTransitGatewayDataSource_serial/PeeringAttachment -timeout 360m
=== RUN   TestAccTransitGatewayDataSource_serial
=== PAUSE TestAccTransitGatewayDataSource_serial
=== CONT  TestAccTransitGatewayDataSource_serial
=== RUN   TestAccTransitGatewayDataSource_serial/PeeringAttachment
=== RUN   TestAccTransitGatewayDataSource_serial/PeeringAttachment/FilterSameAccount
=== RUN   TestAccTransitGatewayDataSource_serial/PeeringAttachment/FilterDifferentAccount
    transitgateway_peering_attachment_data_source_test.go:59: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
=== RUN   TestAccTransitGatewayDataSource_serial/PeeringAttachment/IDSameAccount
=== RUN   TestAccTransitGatewayDataSource_serial/PeeringAttachment/IDDifferentAccount
    transitgateway_peering_attachment_data_source_test.go:123: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
=== RUN   TestAccTransitGatewayDataSource_serial/PeeringAttachment/Tags
--- PASS: TestAccTransitGatewayDataSource_serial (1016.83s)
    --- PASS: TestAccTransitGatewayDataSource_serial/PeeringAttachment (1016.83s)
        --- PASS: TestAccTransitGatewayDataSource_serial/PeeringAttachment/FilterSameAccount (321.82s)
        --- SKIP: TestAccTransitGatewayDataSource_serial/PeeringAttachment/FilterDifferentAccount (0.07s)
        --- PASS: TestAccTransitGatewayDataSource_serial/PeeringAttachment/IDSameAccount (360.79s)
        --- SKIP: TestAccTransitGatewayDataSource_serial/PeeringAttachment/IDDifferentAccount (0.07s)
        --- PASS: TestAccTransitGatewayDataSource_serial/PeeringAttachment/Tags (334.08s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	1016.942s

...

Add the TGW Perring attachment status to the resource and data source.
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/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/transitgateway Issues and PRs that pertain to the transitgateway service. labels Mar 11, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 11, 2024
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 @partcyborg 👋

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 CONTRIBUTOR 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 enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 12, 2024
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=TestAccTransitGatewayDataSource_serial/^PeeringAttachment$$/FilterSameAccount\|TestAccTransitGateway_serial/^PeeringAttachment$$/basic' PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20  -run=TestAccTransitGatewayDataSource_serial/^PeeringAttachment$/FilterSameAccount\|TestAccTransitGateway_serial/^PeeringAttachment$/basic -timeout 360m
=== RUN   TestAccTransitGatewayDataSource_serial
=== PAUSE TestAccTransitGatewayDataSource_serial
=== RUN   TestAccTransitGateway_serial
=== PAUSE TestAccTransitGateway_serial
=== CONT  TestAccTransitGatewayDataSource_serial
=== CONT  TestAccTransitGateway_serial
=== RUN   TestAccTransitGatewayDataSource_serial/PeeringAttachment
=== RUN   TestAccTransitGateway_serial/PeeringAttachment
=== RUN   TestAccTransitGatewayDataSource_serial/PeeringAttachment/FilterSameAccount
=== RUN   TestAccTransitGateway_serial/PeeringAttachment/basic
--- PASS: TestAccTransitGateway_serial (319.04s)
    --- PASS: TestAccTransitGateway_serial/PeeringAttachment (319.04s)
        --- PASS: TestAccTransitGateway_serial/PeeringAttachment/basic (319.04s)
--- PASS: TestAccTransitGatewayDataSource_serial (324.54s)
    --- PASS: TestAccTransitGatewayDataSource_serial/PeeringAttachment (324.54s)
        --- PASS: TestAccTransitGatewayDataSource_serial/PeeringAttachment/FilterSameAccount (324.54s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	332.100s

@ewbankkit
Copy link
Contributor

@partcyborg Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit self-assigned this Mar 12, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Mar 12, 2024
@ewbankkit ewbankkit merged commit c4fbee9 into hashicorp:main Mar 12, 2024
55 checks passed
@github-actions github-actions bot added this to the v5.41.0 milestone Mar 12, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Mar 14, 2024
Copy link

This functionality has been released in v5.41.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!

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 Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/transitgateway Issues and PRs that pertain to the transitgateway service. size/XS 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.

[Enhancement]: include attachment state in the aws_ec2_transit_gateway_peering_attachment data source
4 participants