-
Notifications
You must be signed in to change notification settings - Fork 13
/
master.yaml
128 lines (114 loc) · 3.51 KB
/
master.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
AWSTemplateFormatVersion: "2010-09-09"
Description: Master stack to create nested stack with resources to deploy serverless application.
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
-
Label:
default: Lambda function parameters
Parameters:
- LambdaFunctionName
- LambdaHandler
- LambdaRuntime
- LambdaCodeS3Bucket
- LambdaCodeS3Key
-
Label:
default: Nested Stack
Parameters:
- TemplateURLDynamoDB
- TemplateURLambda
- TemplateURLApiGateway
-
Label:
default: DynamoDB table name.
Parameters:
- DynamoDBTableName
Parameters:
TemplateURLDynamoDB:
Default: https://s3.amazonaws.com/mybucket/path/to/dynamodb.yml
Description: The DynamoDB stack template. Location of an object in Amazon S3.
Type: String
TemplateURLambda:
Default: https://s3.amazonaws.com/mybucket/path/to/lambda.yml
Description: The lambda function stack template. Location of an object in Amazon S3.
Type: String
TemplateURLApiGateway:
Default: https://s3.amazonaws.com/mybucket/path/to/apigateway.yml
Description: The API Gateway stack template. Location of an object in Amazon S3.
Type: String
DynamoDBTableName:
Default: Customer
Description: Name of the DynamoDB table.
MinLength: 3
MaxLength: 255
Type: String
LambdaFunctionName:
ConstraintDescription: must contain only alphanumeric characters.
Default: CustomerServerless
Description: The name of the Lambda function.
MaxLength: 64
MinLength: 1
Type: String
LambdaHandler:
Default: com.aws.lambda.customer.StreamLambdaHandler::handleRequest
Description: Package, class and the name of the method within your code that Lambda calls to execute your function.
MaxLength: 128
MinLength: 1
Type: String
LambdaRuntime:
Default: java8
AllowedValues:
- java8
- java11
- dotnetcore2.1
- dotnetcore3.1
- go1.x
- java11
- java8
- nodejs10.x
- nodejs12.x
- provided
- python2.7
- python3.6
- python3.7
- python3.8
- ruby2.5
- ruby2.7
Description: Lambda runtime to deploy application.
Type: String
LambdaCodeS3Bucket:
Default: mybucket
Description: The deployment package for a Lambda function. Location of an object in Amazon S3.
Type: String
LambdaCodeS3Key:
Default: Customer-0.0.1.zip
Description: The deployment package for a Lambda function. Name of the object in Amazon S3.
Type: String
Resources:
dynamodb:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Ref TemplateURLDynamoDB
Parameters:
DynamoDBTableName: !Ref DynamoDBTableName
lambda:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Ref TemplateURLambda
Parameters:
LambdaFunctionName: !Ref LambdaFunctionName
LambdaHandler: !Ref LambdaHandler
LambdaRuntime: !Ref LambdaRuntime
LambdaCodeS3Bucket: !Ref LambdaCodeS3Bucket
LambdaCodeS3Key: !Ref LambdaCodeS3Key
LambdaDynamoDBTableARN: !GetAtt dynamodb.Outputs.DynamoDBTableArn
DependsOn: dynamodb
apigateway:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Ref TemplateURLApiGateway
Parameters:
LambdaFunctionName: !Ref LambdaFunctionName
LambdaFunctionArn: !GetAtt lambda.Outputs.LambdaFunctionArn
DependsOn: lambda