-
Notifications
You must be signed in to change notification settings - Fork 1
/
DeployLambdaContainerImage-Cfn.yaml
45 lines (42 loc) · 1.28 KB
/
DeployLambdaContainerImage-Cfn.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
AWSTemplateFormatVersion: "2010-09-09"
Description: AWS resources for deploying a container image on Lambda
Parameters:
LambdaMemorySize:
Type: Number
Description: Amount of memory needed by Lambda function
Default: 2048
MinValue: 128
MaxValue: 10240
Resources:
LambdaRole:
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
LambdaContainerImage:
Type: AWS::Lambda::Function
Metadata:
cfn_nag:
rules_to_suppress:
- id: W89
reason: VPC configuration not required
- id: W92
reason: Reserved concurrent executions not required
Properties:
Architectures:
- arm64
Code:
ImageUri: !Join [ "", [ !Ref AWS::AccountId, ".dkr.ecr.", !Ref AWS::Region, ".amazonaws.com/", !ImportValue ECRRepositoryName , ":", !ImportValue ContainerImageName ] ]
PackageType: Image
Role: !GetAtt LambdaRole.Arn
Timeout: 900
MemorySize: !Ref LambdaMemorySize