-
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
Cognito User Pool standard attribute handling changed in 1.13 #4228
Comments
@jyrkiput So if I understood you right, you want to set the At least from the aws console there is no way of switching an attribute's required attribute once the pool is created. So I am guessing this is the actual behavior. However, I am afraid that setting the @bflad What do you think? |
@Puneeth-n the phone_number has been required from the beginning. With 1.12 you can create this setup and apply it again, with 1.13+ What I did was:
Actually minimal configuration is following
This will cause the user pool to be recreated on every I guess that this might really be as expected, as the schema does not really represent what that phone_number -attribute really is. The reason for creating this issue was that this used to work with 1.12. |
I could reproduce this bug with the following minimal configuration: variable "region" {
default = "us-east-1"
}
provider "aws" {
version = "1.14.1"
region = "${var.region}"
}
resource "aws_cognito_user_pool" "pool" {
name = "cognito-terraform-bug"
schema {
attribute_data_type = "String"
name = "phone_number"
}
} My best guess is, it is coming from https://github.com/terraform-providers/terraform-provider-aws/blob/74a51650b29c53a389a9d034c2ece43d3fb279d5/aws/structure.go#L2750-L2756 |
In 1.13.0 (#3789 specifically), the The logic is here: The workaround is to fully specify all the standard schema attribute information. |
Hit the same issue a few days ago. Just workaround it but didn't get time to look into it. |
Hitting the same issue Terraform v0.11.7 AWS provider v1.16.0 |
Same issue with resource "aws_cognito_user_pool" "my_user_pool" {
name = "${var.prefix}-tuto-cognito"
username_attributes = ["email"]
schema {
attribute_data_type = "String"
name = "name"
}
} |
I got the same issue with |
Same issue with |
I am also running into same issue with Terraform v0.11.8 and provider.aws v2.x . Is there a proper workaround or fix available in later versions? |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
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. |
I want to set standard attribute as required, and 1.13 forward handling of this changed.
Terraform Version
Terraform v0.11.7
Affected Resource(s)
aws_cognito_user_pool
Terraform Configuration Files
Debug Output
https://gist.github.com/jyrkiput/4b92d037fcbbb327abb8ddbfeaa5f49c
Expected Behavior
With AWS provider 1.12, you can apply this configuration multiple times without destroying user pool.
Actual Behavior
Terraform things that schema has changed as the
string_attribute_constraints
is not presentSteps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
terraform apply
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
Workaround
Define
string_attribute_constraints
exactly like it seems to be (values found from plan output).The text was updated successfully, but these errors were encountered: