Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export existing AWS Lambda and API Gateway to Cloudformation template

Tags:

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?

like image 297
Gleb Avatar asked Jun 18 '18 09:06

Gleb


People also ask

How do I create a CloudFormation template from an existing resource in AWS?

Create a stack from existing resources using the AWS Management Console. Sign in to the AWS Management Console and open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation . On the Stacks page, choose Create stack, and then choose With existing resources (import resources).

How do I export API API gateway?

Export REST API using the API Gateway console From the stage configuration page in the API Gateway console, choose the Export tab and then one of the available options (Export as OpenAPI, Export as OpenAPI + API Gateway Integrations and Export as Postman) to download your API's OpenAPI definition.


1 Answers

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.

like image 65
Gleb Avatar answered Sep 24 '22 03:09

Gleb