-
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
resource/cognito_user_pool_client: fix import with user pool id #3762
resource/cognito_user_pool_client: fix import with user pool id #3762
Conversation
18c0ad6
to
fcef36f
Compare
fcef36f
to
4449f32
Compare
4449f32
to
6c3191b
Compare
3b5dec2
to
5b2def1
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.
Sorry for the delay in getting this reviewed 😅 could you take a look at removing the extra lookup in the import test?
|
||
resourceName := "aws_cognito_user_pool_client.client" | ||
|
||
getStateId := func(*terraform.State) (string, error) { |
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.
We could shorten this lookup function if we set *client = ...
in testAccCheckAWSCognitoUserPoolClientExists()
from the return value of DescribeUserPoolClient()
Then we can simply grab the right IDs from an object we've already fetched in there 👍
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.
Thanks for input. Not sure if I get your point exactly.
I've mostly copied the function and changed return values. Instead of parsing return value from DescribeUserPoolClient()
, I directly return userPoolId
and clientId
set in DescribeUserPoolClientInput
since there is error checking on DescribeUserPoolClient()
. I assume that if there is no error then both IDs should be considered as valid.
5b2def1
to
b5247ec
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.
Sorry I wasn't clear about what I meant earlier 😅 I can shorten it later. Let's get the more important fix in 🚀
3 tests passed (all tests)
=== RUN TestAccAWSCognitoUserPoolClient_basic
--- PASS: TestAccAWSCognitoUserPoolClient_basic (8.12s)
=== RUN TestAccAWSCognitoUserPoolClient_importBasic
--- PASS: TestAccAWSCognitoUserPoolClient_importBasic (8.48s)
=== RUN TestAccAWSCognitoUserPoolClient_allFields
--- PASS: TestAccAWSCognitoUserPoolClient_allFields (8.62s)
This has been released in version 1.16.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 #3753
When describing user pool client,
user_pool_id
is required.Currently
id
is set asclient_id
, which makes it unable to import by default. Changingid
touser_pool_id/client_id
should be the best as I think. But that would be a breaking change?Instead, I updated import function to parse
user_pool_id
andclient_id
during import.