Skip to content
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

[Bug]: Unable to remove email MFA configuration #41064

Open
hanoj-budime opened this issue Jan 24, 2025 · 2 comments
Open

[Bug]: Unable to remove email MFA configuration #41064

hanoj-budime opened this issue Jan 24, 2025 · 2 comments
Labels
bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. service/cognitoidp Issues and PRs that pertain to the cognitoidp service.

Comments

@hanoj-budime
Copy link

Terraform Core Version

1.4

AWS Provider Version

5.84.0

Affected Resource(s)

Unable to remove the email MFA configuration in the aws_cognito_user_pool resource.
Using Terraform code, I am unable to deselect Email MFA from the MFA methods. For more details, check the screenshot below.

From this

Image

To this

Image

Expected Behavior

Image

resource "aws_cognito_user_pool" "user_pool" {
  name = local.pool_name
  account_recovery_setting {
    recovery_mechanism {
      name     = "verified_email"
      priority = 1
    }
    recovery_mechanism {
      name     = "verified_phone_number"
      priority = 2
    }
  }
  email_configuration {
    email_sending_account = "DEVELOPER"
    source_arn            = local.email_configuration_source_arn
  }
 
  # Example check this
  # I'm commenting on this code configuration to remove the email MFA option from the user pool, but it's not removing the email MFA option.
  # email_mfa_configuration {
  #   message = var.authentication_body
  #   subject = local.authentication_subject
  # }

  mfa_configuration          = "ON"
  sms_authentication_message = "Your code is {####}"
  sms_configuration {
    external_id    = local.pool_name
    sns_caller_arn = local.sns_caller_arn
    sns_region     = var.aws_region
  }
  software_token_mfa_configuration {
    enabled = true
  }
}

Actual Behavior

 # aws_cognito_user_pool.user_pool will be updated in-place
  ~ resource "aws_cognito_user_pool" "user_pool" {
        id                         = "us-west-2_XXXXXXXX"
        name                       = "xxxx-scratch-test"
        tags                       = {}
        # (17 unchanged attributes hidden)
      ~ email_mfa_configuration {
          - message = "Your authentication code is {####}" -> null
          - subject = "Test Sign In" -> null
        }
        # (8 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
aws_cognito_user_pool.user_pool: Modifying... [id=us-west-2_XXXXXXXX]
aws_cognito_user_pool.user_pool: Modifications complete after 2s [id=us-west-2_XXXXXXXX]
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Apply shows update in place, but the Cognito user pool is never updated. Please check the screenshot below

Image

Relevant Error/Panic Output Snippet

Terraform Configuration Files

Check out the Expected Behavior section; I have provided the code.

Steps to Reproduce

Remove or disable Email MFA from a user pool

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

#40734

Would you like to implement a fix?

None

@hanoj-budime hanoj-budime added the bug Addresses a defect in current functionality. label Jan 24, 2025
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/cognitoidp Issues and PRs that pertain to the cognitoidp service. needs-triage Waiting for first response or review from a maintainer. labels Jan 24, 2025
@hanoj-budime
Copy link
Author

Can someone please urgently fix this issue? Our latest feature is not supporting a smooth update for existing resources.

@justinretzolk
@ewbankkit

Related PR, Issue
#40734

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. service/cognitoidp Issues and PRs that pertain to the cognitoidp service.
Projects
None yet
Development

No branches or pull requests

1 participant