pull/310/head
Frostebite 2021-12-30 03:29:25 +00:00
parent 26c15cbb76
commit 08afc9dc26
2 changed files with 20 additions and 20 deletions

View File

@ -18,7 +18,7 @@ Parameters:
Type: String
Default: development
Description: 'Your deployment environment: DEV, QA , PROD'
BUILDID:
buildGuid:
Type: String
Default: ''
StackName:
@ -34,7 +34,7 @@ Resources:
DeleteCFNLambda:
Type: "AWS::Lambda::Function"
Properties:
FunctionName: !Join [ "", [ 'DeleteCFNLambda', !Ref BUILDID ] ]
FunctionName: !Join [ "", [ 'DeleteCFNLambda', !Ref buildGuid ] ]
Code:
ZipFile: |
import boto3
@ -74,7 +74,7 @@ Resources:
- GenerateCronExpression
Type: "AWS::Events::Rule"
Properties:
Name: !Join [ "", [ 'DeleteStackEventRule', !Ref BUILDID ] ]
Name: !Join [ "", [ 'DeleteStackEventRule', !Ref buildGuid ] ]
Description: Delete stack event
ScheduleExpression: !GetAtt GenerateCronExpression.cron_exp
State: "ENABLED"
@ -87,14 +87,14 @@ Resources:
DependsOn:
- DeleteStackEventRule
Properties:
FunctionName: !Join [ "", [ 'DeleteCFNLambda', !Ref BUILDID ] ]
FunctionName: !Join [ "", [ 'DeleteCFNLambda', !Ref buildGuid ] ]
Action: "lambda:InvokeFunction"
Principal: "events.amazonaws.com"
SourceArn: !GetAtt DeleteStackEventRule.Arn
GenerateCronExpLambda:
Type: "AWS::Lambda::Function"
Properties:
FunctionName: !Join [ "", [ 'GenerateCronExpressionLambda', !Ref BUILDID ] ]
FunctionName: !Join [ "", [ 'GenerateCronExpressionLambda', !Ref buildGuid ] ]
Code:
ZipFile: |
from datetime import datetime, timedelta
@ -138,6 +138,6 @@ Resources:
Type: "Custom::GenerateCronExpression"
Version: "1.0"
Properties:
Name: !Join [ "", [ 'GenerateCronExpression', !Ref BUILDID ] ]
Name: !Join [ "", [ 'GenerateCronExpression', !Ref buildGuid ] ]
ServiceToken: !GetAtt GenerateCronExpLambda.Arn
ttl: !Ref 'TTL'

View File

@ -30,7 +30,7 @@ Parameters:
Type: Number
Default: 2048
Description: How much memory in megabytes to give the container
BUILDID:
buildGuid:
Type: String
Default: ''
Command: