hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.63k stars 9.01k forks source link

[Bug]: Channging allow_classic_flow on aws_cognito_identity_pool removes cognito_identity_providers #26969

Open pafcu opened 1 year ago

pafcu commented 1 year ago

Terraform Core Version

v1.3.0

AWS Provider Version

v4.32.0

Affected Resource(s)

aws_cognito_identity_pool

Expected Behavior

Changing the value of allow_classic_flow only changes that value.

Actual Behavior

Changing the value of allow_classic_flow after the resource has initially been created removes any configured cognito_identity_providers on the resource. Running terraform apply again results in the recreation of the cognito_identity_providers.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

provider "aws" {
  region = "eu-west-1"
}

resource "aws_cognito_user_pool" "user-pool" {
  name = "test-user-pool"
}

resource "aws_cognito_user_pool_client" "client" {
  name = "test-user-pool-client"

  user_pool_id = aws_cognito_user_pool.user-pool.id
}

resource "aws_cognito_identity_pool" "identity-pool" {
  identity_pool_name = "test-identity-pool"
  allow_classic_flow = true

  cognito_identity_providers {
    client_id     = aws_cognito_user_pool_client.client.id
    provider_name = aws_cognito_user_pool.user-pool.endpoint
  }
}

Steps to Reproduce

  1. Apply the code above by running terraform apply. You can use the AWS console or cli to verify that the cognito_identity_providers configuration is present in the deployed resource.
  2. Change the value of allow_classic_flow to false
  3. Run terraform apply again. Note that the plan states only that value will be changed
  4. Run terraform apply again. Note that the plan shows that the cognito_identity_providers block will be added. You can use the AWS console or cli to verify that the cognito_identity_providers configuration is not present in the deployed resource.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue