-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
F/#25314 - Return the public key material for a aws_key_pair
#25371
F/#25314 - Return the public key material for a aws_key_pair
#25371
Conversation
…blic_key` in the response
…lude_public_key` and `public_key` attributes
aws_key_pair
aws_key_pair
aws_key_pair
Interesting, the For example, in the create I can set PublicKey to
To make the test pass I'm now not providing a email address and I append the KeyName to the PublicKey (not very nice). Feel free to suggest an alternative, it bugs me that the data source and resource don't share the same |
@ewbankkit could you please provide me with some feedback on the above |
@bschaatsbergen I added a new function The tests now pass: % make testacc TESTARGS='-run=TestAccEC2KeyPairDataSource_' 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=TestAccEC2KeyPairDataSource_ -timeout 180m
=== RUN TestAccEC2KeyPairDataSource_basic
=== PAUSE TestAccEC2KeyPairDataSource_basic
=== RUN TestAccEC2KeyPairDataSource_includePublicKey
=== PAUSE TestAccEC2KeyPairDataSource_includePublicKey
=== CONT TestAccEC2KeyPairDataSource_basic
=== CONT TestAccEC2KeyPairDataSource_includePublicKey
--- PASS: TestAccEC2KeyPairDataSource_includePublicKey (17.49s)
--- PASS: TestAccEC2KeyPairDataSource_basic (18.72s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 25.314s |
Could you please also add |
Neat fix, I'll take care of what you mentioned in the last comment. |
@ewbankkit, done. Do you suggest that we also fix the existing limitation mentioned through this PR or another one - https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/key_pair#import ? Please note that still the data source its public key and the public key provided to the resource can differ.. |
@bschaatsbergen I suggest a separate PR to deal with that - There will have to be a |
Right on, will note it down to pick up in the near future. Removed draft status from this PR. |
There was a problem hiding this 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=TestAccEC2KeyPairDataSource_' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3 -run=TestAccEC2KeyPairDataSource_ -timeout 180m
=== RUN TestAccEC2KeyPairDataSource_basic
=== PAUSE TestAccEC2KeyPairDataSource_basic
=== RUN TestAccEC2KeyPairDataSource_includePublicKey
=== PAUSE TestAccEC2KeyPairDataSource_includePublicKey
=== CONT TestAccEC2KeyPairDataSource_basic
=== CONT TestAccEC2KeyPairDataSource_includePublicKey
--- PASS: TestAccEC2KeyPairDataSource_includePublicKey (16.34s)
--- PASS: TestAccEC2KeyPairDataSource_basic (16.45s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 20.901s
@bschaatsbergen Thanks for the contribution 🎉 👏. |
% make providerlint
==> Checking source code with providerlint... |
This functionality has been released in v4.21.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! |
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. |
Community Note
Closes #25314
Output from acceptance testing: