-
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
resource/cognito_user_pool_client: support USER_PASSWORD_AUTH for explicit_auth_flows #3417
resource/cognito_user_pool_client: support USER_PASSWORD_AUTH for explicit_auth_flows #3417
Conversation
f1c8776
to
e31c39f
Compare
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.
Hey @loivis
Thanks for the work here, looks very good!
Just left a question to address prior to merging.
Tell us if you need any help :) 🚀
@@ -53,6 +53,7 @@ func resourceAwsCognitoUserPoolClient() *schema.Resource { | |||
ValidateFunc: validation.StringInSlice([]string{ | |||
cognitoidentityprovider.ExplicitAuthFlowsTypeAdminNoSrpAuth, | |||
cognitoidentityprovider.ExplicitAuthFlowsTypeCustomAuthFlowOnly, | |||
cognitoidentityprovider.ExplicitAuthFlowsTypeUserPasswordAuth, |
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.
Could you add an acctest for that so that we ensure there won't be regression in the future?
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.
I thought about acctest before committing the change but not sure what to test actually. USER_PASSWORD_AUTH
is a new type of ExplicitAuthFlows
.
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.
My general opinion is if the SDK is providing the constant, that means AWS has added it to their acceptable values in their generated API model, and we don't need to provide any acceptance testing if its just updating a validation check. 😄
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.
I recall, when working on multiple Cognito ressources, that there was a specificity when using USER_PASSWORD_AUTH... hence my request :)
Adding the value in testAccAWSCognitoUserPoolClientConfig_allFields
is fine as it covers the use-case.
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.
Added all values of explicit_auth_flows
in acctest. I'm not clear about the user-case but hope to get your point of change.
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.
Cannot recall of the need for it right now... it was not that important, but will keep you updated if it appears to me again.
|
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.
Hey @loivis
This is all good, thanks for the work and additional cleanup, much appreciated! 🚀 :)
$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSCognitoUserPoolClient_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSCognitoUserPoolClient_ -timeout 120m
=== RUN TestAccAWSCognitoUserPoolClient_basic
--- PASS: TestAccAWSCognitoUserPoolClient_basic (95.03s)
=== RUN TestAccAWSCognitoUserPoolClient_allFields
--- PASS: TestAccAWSCognitoUserPoolClient_allFields (31.97s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 127.040s
This has been released in version 1.10.0 of the AWS provider. 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! |
Fix #3397
Documentation: https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateUserPoolClient.html#CognitoUserPools-CreateUserPoolClient-request-ExplicitAuthFlows