Skip to content

Commit d6f50d2

Browse files
authored
Merge pull request #1 from smoell/master
Created CloudFormation template to deploy Lambda custom runtime
2 parents 77fc4ca + 15ca6bc commit d6f50d2

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

infrastructure/master.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
Description: >
2+
This template deploys a Vert.x-based native runtime image into AWS Lambda. Default values can be used for region
3+
eu-west-1, if you upload your Lambda deployment package into a different bucket, you have to overwrite the
4+
LambdaS3Bucket-parameter.
5+
6+
Parameters:
7+
LambdaS3Bucket:
8+
Description: The S3 bucket which contains the Lambda deployment package
9+
Type: String
10+
Default: smoell-lambda-runtimes
11+
12+
Resources:
13+
14+
LambdaTestExecutionRole:
15+
Type: AWS::IAM::Role
16+
Properties:
17+
RoleName: !Sub LambdaTestExecutionRole
18+
AssumeRolePolicyDocument:
19+
Version: '2012-10-17'
20+
Statement:
21+
- Effect: Allow
22+
Principal:
23+
Service: lambda.amazonaws.com
24+
Action: sts:AssumeRole
25+
Path: "/"
26+
ManagedPolicyArns:
27+
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
28+
29+
VertxLayer:
30+
Type: "AWS::Lambda::LayerVersion"
31+
Properties:
32+
CompatibleRuntimes:
33+
- provided
34+
Content:
35+
S3Bucket: !Ref LambdaS3Bucket
36+
S3Key: function.zip
37+
Description: VertxLayer
38+
LayerName: vertx-layer
39+
LicenseInfo: Apache 2.0
40+
41+
VertxFunction:
42+
Type: "AWS::Lambda::Function"
43+
Properties:
44+
FunctionName: !Sub VertxFunction-${AWS::Region}
45+
Handler: lambda.QOTDLambda
46+
Role: !GetAtt LambdaTestExecutionRole.Arn
47+
Code:
48+
S3Bucket: !Ref LambdaS3Bucket
49+
S3Key: function.zip
50+
Runtime: provided
51+
Layers:
52+
- !Ref VertxLayer
53+
MemorySize: 128
54+
Timeout: 5
55+
56+
Outputs:
57+
58+
VertxLayer:
59+
Description: The ARN of the Vertx-layer
60+
Value: !Ref VertxLayer
61+
62+
VertxFunction:
63+
Description: The ARN of the Vertx-function
64+
Value: !Ref VertxFunction
65+

0 commit comments

Comments
 (0)