Export existing AWS Lambda and API Gateway to Cloudformation template

Gleb picture Gleb · Jun 18, 2018 · Viewed 8.6k times · Source

How to export existing configured and tested infrastructure (including AWS Lambda functions, API Gateways, ElastiCache clusters, Cloudwatch rules) to Cloudformation template?

I know about Cloudformer tool, but it supports limited number of AWS services (Amazon VPC, DynamoDB, etc) and don't supports some of services which we use. Which tools and approaches can I use in my case for generating Cloudformation template?

Answer

Gleb picture Gleb · Jun 20, 2018

Partial solution: there is ability to export Lambda function to AWS SAM file

enter image description here

and then

enter image description here

We will get YAML file which describes your Lambda function as 'AWS::Serverless::Function'. But there are few things - we can't export Lambda aliases with such approach. Also that doesn't help with API Gateway exporting.