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

View File

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