-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtemplate.yaml
66 lines (61 loc) · 2.18 KB
/
template.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
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: Failed Change Sets Destroyer deletes failed change sets from CloudFormation stacks.
Metadata:
AWS::ServerlessRepo::Application:
Name: failed-change-sets-destroyer
Description: Failed Change Sets Destroyer deletes failed change sets from CloudFormation stacks.
Author: Michal Gorski
SpdxLicenseId: Apache-2.0
LicenseUrl: LICENSE
ReadmeUrl: README.md
Labels: [ 'lambda','cloudwatch','cron','cloudformation','change-set' ]
HomePageUrl: https://github.com/mgorski-mg/aws-failed-change-sets-destroyer
SemanticVersion: 1.1.3
SourceCodeUrl: https://github.com/mgorski-mg/aws-failed-change-sets-destroyer
Parameters:
SchedulerCronParameter:
Type: String
Description: Enter scheduler cron expression. Default is cron(0 0 1 * ? *).
Default: cron(0 0 1 * ? *)
SchedulerEnabledParameter:
Type: String
Description: Enable scheduler. Default is ENABLED.
Default: ENABLED
AllowedValues: [ ENABLED, DISABLED ]
Resources:
FailedChangeSetsDestroyer:
Type: AWS::Serverless::Function
Properties:
Description: Deletes failed change sets from CloudFormation stacks.
CodeUri: code/
Handler: handler.lambda_handler
Runtime: python3.12
Timeout: 900
MemorySize: 128
Tracing: Active
Architectures:
- arm64
Events:
Schedule:
Type: Schedule
Properties:
State: !Ref SchedulerEnabledParameter
Schedule: !Ref SchedulerCronParameter
Input: '{"dry_run": false}'
Policies:
- AWSLambdaBasicExecutionRole
- Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- ec2:DescribeRegions
- cloudformation:ListStacks
- cloudformation:ListChangeSets
- cloudformation:DeleteChangeSet
Resource: '*'
FailedChangeSetsDestroyerLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${FailedChangeSetsDestroyer}
RetentionInDays: 180