X Tutup
Skip to content

feat: enable Cognito User Pool deletion protection in gen2-migration …#14653

Open
sanjanaravikumar-az wants to merge 1 commit intogen2-migrationfrom
sanjrkmr/user-pool-deletion-protection
Open

feat: enable Cognito User Pool deletion protection in gen2-migration …#14653
sanjanaravikumar-az wants to merge 1 commit intogen2-migrationfrom
sanjrkmr/user-pool-deletion-protection

Conversation

@sanjanaravikumar-az
Copy link

The amplify gen2-migration lock command already enables deletion protection on DynamoDB tables to safeguard stateful resources during migration. This PR extends that same protection to Cognito User Pools.

What changed:

  • Added userPoolIds() method that reads User Pool IDs from amplify-meta.json via stateManager.getMeta(), filtering auth resources where service === 'Cognito'
  • Added cognitoClient() lazy accessor for CognitoIdentityProviderClient
  • In execute(): for each discovered User Pool, pushes an operation that calls UpdateUserPoolCommand with DeletionProtection: 'ACTIVE'
  • In rollback(): follows the existing DynamoDB pattern — pushes a no-op "preserve" operation since the original protection state is unknown

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sanjanaravikumar-az sanjanaravikumar-az requested a review from a team as a code owner March 9, 2026 04:46
@sai-ray sai-ray self-assigned this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup