-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yml
96 lines (91 loc) · 3.37 KB
/
template.yml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: This serverless application automatically deploys new versions of an serverless app in AWS Serverless Application repository into your account.
Metadata:
AWS::ServerlessRepo::Application:
Name: aws-serverlessrepo-auto-deploy
Description: This serverless application automatically deploys new versions of an serverless app in AWS Serverless Application repository into your account.
Author: Lu Hong
SpdxLicenseId: MIT
LicenseUrl: ../../LICENSE
ReadmeUrl: ../../README.md
Labels: [serverless]
HomePageUrl: https://github.com/honglu/aws-serverlessrepo-auto-deploy
SemanticVersion: 1.0.3
SourceCodeUrl: https://github.com/honglu/aws-serverlessrepo-auto-deploy/tree/1.0.3
Parameters:
LogLevel:
Type: String
Description: Log level for Lambda function logging, e.g., ERROR, INFO, DEBUG, etc
Default: INFO
ApplicationId:
Type: String
Description: The application id of the application in AWS Serverless Application Repository.
StackName:
Type: String
Description: The stack name for the application.
Schedule:
Type: String
Description: CloudWatch event schedule to check and update the application deployment
Default: 'rate(1 day)'
ParameterOverrides:
Type: String
Description: A JSON string representation of the parameter overrides for the application.
Default: ''
Capabilities:
Type: String
Description: A JSON string representation of the capabilities for the application.
Default: ''
Resources:
ApplicationAutoDeployer:
Type: AWS::Serverless::Function
Properties:
CodeUri: src/
Handler: deployer.handler
Runtime: python3.7
Tracing: Active
Timeout: 60
Environment:
Variables:
LOG_LEVEL: !Ref LogLevel
APPLICATION_ID: !Ref ApplicationId
STACK_NAME: !Ref StackName
PARAMETER_OVERRIDES: !Ref ParameterOverrides
CAPABILITIES: !Ref Capabilities
Policies:
- CloudFormationDescribeStacksPolicy: {}
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- cloudformation:DescribeChangeSet
- cloudformation:ExecuteChangeSet
- cloudformation:CreateChangeSet
Resource: '*'
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- serverlessrepo:GetApplication
- serverlessrepo:GetCloudFormationTemplate
- serverlessrepo:CreateCloudFormationTemplate
- serverlessrepo:CreateCloudFormationChangeSet
Resource: !Ref ApplicationId
Events:
DailySchedule:
Type: Schedule
Properties:
Schedule: !Ref Schedule
Outputs:
ApplicationAutoDeployerFunctionName:
Description: "Application Deployer Lambda Function Name"
Value: !Ref ApplicationAutoDeployer
ApplicationAutoDeployerFunctionArn:
Description: "Application Deployer Lambda Function ARN"
Value: !GetAtt ApplicationAutoDeployer.Arn
ApplicationAutoDeployerRoleName:
Description: "Application Deployer Lambda Function Role Name"
Value: !Ref ApplicationAutoDeployerRole
ApplicationAutoDeployerRoleArn:
Description: "Application Deployer Lambda Function Role Arn"
Value: !GetAtt ApplicationAutoDeployerRole.Arn