terraform-provider-aws: Cognito domain doesn't delete during destroy
Terraform Version
Terraform v0.10.8 AWS provider 1.21.0
Affected Resource(s)
aws_cognito_user_pool_domain
Terraform Configuration Files
Below is an excerpt from terraform file to create aws_cognito_user_pool_domain .
# Pool domain
resource "aws_cognito_user_pool_domain" "domain" {
domain = "${var.userpooldomain}"
user_pool_id = "${aws_cognito_user_pool.pool.id}"
}
Debug Output
Panic Output
Expected Behavior
domain should be deleted by terraform apply, when the resource is marked for destroy.
Actual Behavior
Domain isn’t deleted and throws error message
aws_cognito_user_pool_domain.domain: InvalidParameter: 1 validation error(s) found.
- minimum field size of 1, DeleteUserPoolDomainInput.UserPoolId.
Steps to Reproduce
- Change the module name
- Run terraform plan and apply(Module name is changed and existing pool is deleted and a new user pool(with new name) is created.
- Modify any change for the new user pool
- terraform plan
- terraform apply
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 57
- Comments: 18 (3 by maintainers)
Similar workaround here as @haruharuharuby , but I’d recommend using the
terraform state rmcommand, rather than manually messing with your state file directly.eg.
For the record, I’m using TF v0.12.8, and aws provider v2.43.0
+1 for now i solved this using a custom script, leveraging the aws cli, to delete the domain, on destroy and update.
opened #14732 to address this.
I saw same issue. I fix this my work around.
this is my environment -> % terraform version Terraform v0.11.13
+1