6

I need to recreate a new User Pool with exactly the same settings as another one and I am wondering what is the best way to do it, or if it is a standard way that I am not aware of. (maybe a faster way than using the AWS console)

My guess is, using AWS CLI :

Any thoughts?

Vasilis Siourdas
  • 309
  • 1
  • 11

2 Answers2

1

You should first import the resource to CloudFormation, then copy the template and deploy it as a new stack. This will give you better control over the desired configuration of the resources. Ensure you set the retention policy to retain. Losing a user pool is no fun.

It seems there is still no support for importing Cognito user pools into CloudFormation. My recommendation remains that you should be maintaining your infrastructure as code, particularly if you wish to replicate it across environments. How you accomplish it is a little more convoluted but you should just iterate on your CFN template until the configuration matches. Or if you are up for it, terraform has tooling to help you import resources

Andrew Gillis
  • 3,250
  • 2
  • 13
  • 15
  • 1
    nope. "The following resource types are not supported for resource import: AWS::Cognito::UserPool" https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html?icmpid=docs_cfn_console – Davy Durham Jul 26 '21 at 05:33
0

So! To answer my own question after some time gaining related experience.

The best way to go is like @AndrewGillis said:

Hold your Infrastructure As Code.

My preference I use Terraform.

Vasilis Siourdas
  • 309
  • 1
  • 11