Hello-World/infra/hello-lambda.yml
Vijaya Krishna Manne 11a6fe0130
Some checks failed
Deploy Hello Lambda CFT / deploy (push) Failing after 8s
Add hello lambda CFT and Forgejo workflow
2026-05-29 13:49:50 -04:00

37 lines
1 KiB
YAML

AWSTemplateFormatVersion: '2010-09-09'
Description: Hello World Lambda via CloudFormation
Resources:
HelloLambdaRole:
Type: AWS::IAM::Role
Properties:
RoleName: hello-world-lambda-role-cft
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
HelloLambdaFunction:
Type: AWS::Lambda::Function
Properties:
FunctionName: hello-world-lambda-cft
Runtime: python3.12
Handler: index.lambda_handler
Role: !GetAtt HelloLambdaRole.Arn
Timeout: 10
Code:
ZipFile: |
def lambda_handler(event, context):
return {
"statusCode": 200,
"body": "Hello from Lambda via CloudFormation!"
}
Outputs:
LambdaName:
Value: !Ref HelloLambdaFunction