Export a CloudFormation stack from an AWS instance and import into another one

Viewed 929

I'm using serverless.com framework to deploy some Lambda functions to an AWS instance.

Now I need to make the same deployment to another AWS instance that I don't have access to. I have to provide only a CloudFormation stack so another team will make the deployment there.

Can I export the CloudFormation stack from AWS instance A and import that into AWS instance B? Is this supposed to work?

Thanks!

1 Answers

The intent of infrastructure as code tools such as CloudFormation is to make infrastructure setup and updates repeatable, so what you are describing is fine. You can retrieve the template for your stack via the cli using aws cloudformation get-template --stack-name yourstacknamehere. More info here. As long as there aren't hardcoded values that are specific to an environment in the template for things such as shared resources, it should work.

Related