From 92f7460ad033c9fed5ea6195a575952eba87fa2f Mon Sep 17 00:00:00 2001 From: Sonu Kumar Meena Date: Wed, 2 Oct 2019 13:38:49 -0400 Subject: [PATCH] fixed loggroup deletion policy --- cftemplates/snapshots_tool_rds_dest.json | 11 +++-------- cftemplates/snapshots_tool_rds_source.json | 8 ++------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/cftemplates/snapshots_tool_rds_dest.json b/cftemplates/snapshots_tool_rds_dest.json index 9d0fd96..a725a17 100644 --- a/cftemplates/snapshots_tool_rds_dest.json +++ b/cftemplates/snapshots_tool_rds_dest.json @@ -56,11 +56,6 @@ "AllowedValues": ["TRUE", "FALSE"], "Default": "TRUE", "Description": "Enable copying snapshots across accounts. Set to FALSE if your source snapshosts are not on a different account" - }, - "LogGroupName": { - "Type": "String", - "Default": "lambdaDeleteOldSnapshotsRDS-dest", - "Description": "Name for RDS snapshot log group." } }, "Conditions": { @@ -598,15 +593,15 @@ }] } }, - "cwloggroupDeleteOldSnapshotsDestRDS":{ + "cwloggrouplambdaDeleteOldDestRDS":{ "Type": "AWS::Logs::LogGroup", - "Description": "Log group for the lambdaCopySnapshotsRDS function's logs", + "Description": "Log group for the lambdaDeleteOldDestRDS function's logs", "Condition": "DeleteOld", "DependsOn": "lambdaDeleteOldDestRDS", "Properties": { "RetentionInDays": { "Ref": "LambdaCWLogRetention" }, "LogGroupName": { - "Fn::Sub": [ "/aws/lambda/${func}", { "func": { "Ref" : "LogGroupName" } } ] + "Fn::Sub": [ "/aws/lambda/${func}", { "func": { "Ref" : "lambdaDeleteOldDestRDS" } } ] } } }, diff --git a/cftemplates/snapshots_tool_rds_source.json b/cftemplates/snapshots_tool_rds_source.json index 4900ce5..f27034c 100644 --- a/cftemplates/snapshots_tool_rds_source.json +++ b/cftemplates/snapshots_tool_rds_source.json @@ -68,11 +68,6 @@ "Default": "FALSE", "Description": "Set to TRUE to filter instances that have tag CopyDBSnapshot set to True. Set to FALSE to disable", "AllowedValues": ["TRUE", "FALSE"] - }, - "LogGroupName": { - "Type": "String", - "Default": "lambdaDeleteOldSnapshotsRDS-source", - "Description": "Name for RDS snapshot log group." } }, "Conditions": { @@ -742,10 +737,11 @@ "cwloggrouplambdaDeleteOldSnapshotsRDS":{ "Type": "AWS::Logs::LogGroup", "Description": "Log group for the lambdaDeleteOldSnapshotsRDS function's logs", + "DependsOn": "lambdaDeleteOldSnapshotsRDS", "Properties": { "RetentionInDays": { "Ref": "LambdaCWLogRetention" }, "LogGroupName": { - "Fn::Sub": [ "/aws/lambda/${func}", { "func": { "Ref" : "LogGroupName" } } ] + "Fn::Sub": [ "/aws/lambda/${func}", { "func": { "Ref" : "lambdaDeleteOldSnapshotsRDS" } } ] } } }