IaC
# CloudFormation Example
Resources:
MyFunction:
Type: AWS::Lambda::Function
Properties:
Handler: index.handler
Runtime: nodejs18.x
Code:
ZipFile: |
exports.handler = async (event) => {
return { statusCode: 200, body: 'Hello' };
}
# SAM Example (Simpler)
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event) => {
return { statusCode: 200, body: 'Hello' };
}AWS IaC Offering Overview
Feature
CloudFormation
SAM
CDK
Proton
Service Catalog
Last updated