template.yaml1.4 KB
View on GitHubAWSTemplateFormatVersion: '2010-09-09'
Description: Lambda deployed from an archive published by an Atmos hook.
Parameters:
ArtifactBucket:
Type: String
ArtifactKey:
Type: String
Resources:
ExecutionRole:
Type: AWS::IAM::Role
Properties:
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
Function:
Type: AWS::Lambda::Function
Properties:
Runtime: python3.12
Handler: handler.handler
Role: !GetAtt ExecutionRole.Arn
Timeout: 10
Code:
S3Bucket: !Ref ArtifactBucket
S3Key: !Ref ArtifactKey
FunctionUrl:
Type: AWS::Lambda::Url
Properties:
AuthType: NONE
TargetFunctionArn: !Ref Function
FunctionUrlPermission:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunctionUrl
FunctionName: !Ref Function
Principal: '*'
FunctionUrlAuthType: NONE
InvokePermission:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunction
FunctionName: !Ref Function
Principal: '*'
InvokedViaFunctionUrl: true
Outputs:
FunctionName:
Value: !Ref Function
FunctionUrl:
Value: !GetAtt FunctionUrl.FunctionUrl