-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
d/aws_iam_server_certificate: add support for retrieving public key #2749
Conversation
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.
Hi @trung
This looks very good, thanks for the work!
$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSDataSourceIAMServerCertificate_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSDataSourceIAMServerCertificate_ -timeout 120m
=== RUN TestAccAWSDataSourceIAMServerCertificate_basic
--- PASS: TestAccAWSDataSourceIAMServerCertificate_basic (27.59s)
=== RUN TestAccAWSDataSourceIAMServerCertificate_matchNamePrefix
--- PASS: TestAccAWSDataSourceIAMServerCertificate_matchNamePrefix (3.95s)
PASS
ok github.com/terraform-providers/terraform-provider-aws-clone/aws 31.594s
Just left a nitpick to address before merging, ensuring every new attribute is well set. 🚀
@@ -57,6 +57,7 @@ func TestAccAWSDataSourceIAMServerCertificate_basic(t *testing.T) { | |||
resource.TestCheckResourceAttrSet("data.aws_iam_server_certificate.test", "id"), | |||
resource.TestCheckResourceAttrSet("data.aws_iam_server_certificate.test", "name"), | |||
resource.TestCheckResourceAttrSet("data.aws_iam_server_certificate.test", "path"), | |||
resource.TestMatchResourceAttr("data.aws_iam_server_certificate.test", "certificate_body", regexp.MustCompile("^-----BEGIN CERTIFICATE-----")), |
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.
Can you also add the check for upload_date & certificate_chain?
@@ -10,6 +10,7 @@ import ( | |||
"github.com/aws/aws-sdk-go/service/iam" | |||
"github.com/hashicorp/errwrap" | |||
"github.com/hashicorp/terraform/helper/schema" | |||
"time" |
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.
Nitpick: can you also move that line 8 also? 😄
thanks @Ninir, refactored per your comments and reran the tests
|
|
Hey @trung Looks good to me! Thanks for the work! :) 🚀
|
This has been released in terraform-provider-aws version 1.7.0. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Invoke API_GetServerCertificate to obtain additional information for server certificate. Among which,
certificate_body
is useful when configuring back-end instance authentication withaws_load_balancer_policy
andaws_load_balancer_backend_server_policy
Also fix the date format to be RFC-compliant
For #2742