Export existing AWS Lambda and API Gateway to Cloudformation template

10,315

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.

Share:
10,315
Hleb Kastseika
Author by

Hleb Kastseika

Updated on June 06, 2022

Comments

  • Hleb Kastseika
    Hleb Kastseika almost 2 years

    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?

    • MaiKaY
      MaiKaY almost 6 years
      Out of my experience it makes more sense to write everything from scratch without having a tool which is doing reverse engineering. For sure it means you need to spend much more time but on the other hand you are able to re-think (and understand) your whole infrastructure.
    • Hleb Kastseika
      Hleb Kastseika almost 6 years
      Yeah, the main cause why I'm looking for ways to export existing resources is to save time
  • Hleb Kastseika
    Hleb Kastseika almost 6 years
    But CloudFormer don't supports Lambda functions and API Gateways
  • Loaf
    Loaf almost 6 years
    It can get you started at least. CloudFormation is worth it to learn and in the long run will save you more time. What we do is build a POC of what we want, then transfer that to CF and continue building off that template.
  • Martin Lottering
    Martin Lottering over 3 years
    Not sure why but the Export Function option doesn't show on my function. It looks like I'll have to start from scratch too. I was hoping for a starting-template at least to try and save some time.