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 wrong outputs of aws_dx_connection #30385

Merged
merged 7 commits into from
Apr 12, 2023

Conversation

posquit0
Copy link
Contributor

Description

aws_dx_connection resource and aws_dx_connection data source doesn't return provider_name and vlan_id outputs.

          + provider_name           = ""
          + vlan_id                       = null

Following is output from aws-cli.

        {
            "ownerAccount": "xxxx",
            "connectionId": "dxcon-xxx",
            "connectionName": "xxxxx",
            "connectionState": "available",
            "region": "ap-northeast-2",
            "location": "LGKNX",
            "bandwidth": "50Mbps",
            "vlan": 1506,
            "partnerName": "KINX",
            "awsDevice": "xxxxx",
            "jumboFrameCapable": true,
            "awsDeviceV2": "xxxxxx",
            "awsLogicalDeviceId": "xxxxxx",
            "hasLogicalRedundancy": "no",
            "tags": [
 ...
            ],
            "macSecCapable": false,
            "portEncryptionStatus": "Encryption Down",
            "encryptionMode": "unknown"
        },

Relations

Closes #0000

References

Output from Acceptance Testing

$ make testacc TESTS=TestAccXXX PKG=ec2

...

@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 service/directconnect Issues and PRs that pertain to the directconnect service. size/XS Managed by automation to categorize the size of a PR. labels Mar 31, 2023
@github-actions github-actions bot added size/S 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 Apr 12, 2023
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=TestAccDirectConnectConnection_\|TestAccDirectConnectConnectionDataSource_' PKG=directconnect ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/directconnect/... -v -count 1 -parallel 2  -run=TestAccDirectConnectConnection_\|TestAccDirectConnectConnectionDataSource_ -timeout 180m
=== RUN   TestAccDirectConnectConnectionDataSource_basic
=== PAUSE TestAccDirectConnectConnectionDataSource_basic
=== RUN   TestAccDirectConnectConnection_basic
=== PAUSE TestAccDirectConnectConnection_basic
=== RUN   TestAccDirectConnectConnection_disappears
=== PAUSE TestAccDirectConnectConnection_disappears
=== RUN   TestAccDirectConnectConnection_encryptionMode
    connection_test.go:87: Environment variable DX_CONNECTION_ID is not set
--- SKIP: TestAccDirectConnectConnection_encryptionMode (0.00s)
=== RUN   TestAccDirectConnectConnection_macsecRequested
=== PAUSE TestAccDirectConnectConnection_macsecRequested
=== RUN   TestAccDirectConnectConnection_providerName
=== PAUSE TestAccDirectConnectConnection_providerName
=== RUN   TestAccDirectConnectConnection_skipDestroy
=== PAUSE TestAccDirectConnectConnection_skipDestroy
=== RUN   TestAccDirectConnectConnection_tags
=== PAUSE TestAccDirectConnectConnection_tags
=== CONT  TestAccDirectConnectConnectionDataSource_basic
=== CONT  TestAccDirectConnectConnection_tags
--- PASS: TestAccDirectConnectConnectionDataSource_basic (27.07s)
=== CONT  TestAccDirectConnectConnection_providerName
--- PASS: TestAccDirectConnectConnection_providerName (34.84s)
=== CONT  TestAccDirectConnectConnection_disappears
=== CONT  TestAccDirectConnectConnection_macsecRequested
--- PASS: TestAccDirectConnectConnection_tags (76.63s)
--- PASS: TestAccDirectConnectConnection_disappears (24.31s)
=== CONT  TestAccDirectConnectConnection_basic
--- PASS: TestAccDirectConnectConnection_macsecRequested (32.37s)
=== CONT  TestAccDirectConnectConnection_skipDestroy
--- PASS: TestAccDirectConnectConnection_basic (31.08s)
--- PASS: TestAccDirectConnectConnection_skipDestroy (24.86s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/directconnect	144.243s

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 12, 2023
@ewbankkit ewbankkit added the enhancement Requests to existing resources that expand the functionality or scope. label Apr 12, 2023
@ewbankkit
Copy link
Contributor

@posquit0 Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 653ed72 into hashicorp:main Apr 12, 2023
@github-actions github-actions bot added this to the v4.63.0 milestone Apr 12, 2023
@posquit0 posquit0 deleted the dx-connection-fix branch April 13, 2023 16:35
@posquit0
Copy link
Contributor Author

@ewbankkit Thank you for helping my issue! But, vlan_id output is also broken as mentioned above. Can you figure out this too?

@ewbankkit
Copy link
Contributor

@posquit0 The only API structure field applicable to vlan_id is Vlan, which is the one we are using.
Are you expecting a non-zero value to be returned from the service?

@github-actions
Copy link

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

@posquit0
Copy link
Contributor Author

@ewbankkit As mentioned above, the output from aws-cli command is vlan: 1506. However, the output from Terraform is vlan_id: null. I think this is a problem with the parsing process.

@posquit0
Copy link
Contributor Author

@ewbankkit Leave a comment because I think you missed it.

@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 May 29, 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. service/directconnect Issues and PRs that pertain to the directconnect service. size/S 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