Architecture
CloudFormation Template Generator
Writing CloudFormation YAML from scratch is tedious. Select the AWS resources you need and get a valid, commented starter template you can copy, download, and deploy immediately.
Select Resources to Include
CloudFormation YAML (2 resources)
AWSTemplateFormatVersion: "2010-09-09"
Description: MyStack - generated by Cloud Edventures
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Parameters
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ
Parameters:
ProjectName:
Type: String
Default: MyStack
Description: Name tag applied to all resources
Environment:
Type: String
Default: dev
AllowedValues: [dev, staging, prod]
Description: Deployment environment
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Resources
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ
Resources:
# βββ Lambda Function ββββββββββββββββββββββββββββββ
MyLambdaFunction:
Type: AWS::Lambda::Function
Properties:
FunctionName: !Sub "${AWS::StackName}-function"
Runtime: python3.12
Handler: index.handler
Role: !GetAtt LambdaExecutionRole.Arn
Timeout: 30
MemorySize: 256
Environment:
Variables:
ENVIRONMENT: !Ref Environment
Code:
ZipFile: |
import json
def handler(event, context):
return {
'statusCode': 200,
'body': json.dumps({'message': 'Hello from Lambda!'})
}
Tags:
- Key: Project
Value: !Ref ProjectName
# βββ IAM Role for Lambda ββββββββββββββββββββββββββ
LambdaExecutionRole:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub "${AWS::StackName}-lambda-role"
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Tags:
- Key: Project
Value: !Ref ProjectName
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Outputs
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ
Outputs:
LambdaFunctionArn:
Value: !GetAtt MyLambdaFunction.Arn
Description: Lambda function ARN
Export:
Name: !Sub "${AWS::StackName}-LambdaArn"Deploy real CloudFormation stacksβguided
Cloud Edventures Automation Captain path teaches you to write and deploy CloudFormation templates in a real AWS sandbox. Automated validation confirms your stacks actually work.
Start the IaC mission β