diff --git a/packages/aws-rfdk/lib/core/lib/exporting-log-group.ts b/packages/aws-rfdk/lib/core/lib/exporting-log-group.ts index a8bef8c70..66a0e9085 100644 --- a/packages/aws-rfdk/lib/core/lib/exporting-log-group.ts +++ b/packages/aws-rfdk/lib/core/lib/exporting-log-group.ts @@ -126,12 +126,11 @@ export class ExportingLogGroup extends Construct { maxRetries: 7, }, }); - const logRetentionFunctionLogicalId = 'LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a'; - const logRetentionFunction = Stack.of(this).node.tryFindChild(logRetentionFunctionLogicalId); - if (logRetentionFunction) { - const cfnFunction = logRetentionFunction.node.defaultChild as CfnFunction; - cfnFunction.addPropertyOverride('Timeout', 30); - } + // referenced from cdk code: https://github.com/aws/aws-cdk/blob/main/packages/@aws-cdk/aws-logs/lib/log-retention.ts#L123 + const logRetentionFunctionConstructId = 'LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a'; + const logRetentionFunction = Stack.of(this).node.tryFindChild(logRetentionFunctionConstructId)!; + const cfnFunction = logRetentionFunction.node.defaultChild as CfnFunction; + cfnFunction.addPropertyOverride('Timeout', 30); this.logGroup = LogGroup.fromLogGroupArn(scope, `${props.logGroupName}LogGroup`, logRetention.logGroupArn); this.logGroup.grant(exportLogsFunction, 'logs:CreateExportTask'); diff --git a/packages/aws-rfdk/lib/core/lib/log-group-factory.ts b/packages/aws-rfdk/lib/core/lib/log-group-factory.ts index 42fb2ea04..787a51125 100644 --- a/packages/aws-rfdk/lib/core/lib/log-group-factory.ts +++ b/packages/aws-rfdk/lib/core/lib/log-group-factory.ts @@ -76,6 +76,7 @@ export class LogGroupFactory { maxRetries: 7, }, }).logGroupArn); +<<<<<<< HEAD const logRetentionFunctionLogicalId = 'LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a'; const logRetentionFunction = Stack.of(scope).node.tryFindChild(logRetentionFunctionLogicalId); @@ -83,6 +84,13 @@ export class LogGroupFactory { const cfnFunction = logRetentionFunction.node.defaultChild as CfnFunction; cfnFunction.addPropertyOverride('Timeout', 30); } +======= + // referenced from cdk code: https://github.com/aws/aws-cdk/blob/main/packages/@aws-cdk/aws-logs/lib/log-retention.ts#L123 + const logRetentionFunctionConstructId = 'LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a'; + const logRetentionFunction = Stack.of(scope).node.tryFindChild(logRetentionFunctionConstructId)!; + const cfnFunction = logRetentionFunction.node.defaultChild as CfnFunction; + cfnFunction.addPropertyOverride('Timeout', 30); +>>>>>>> 5e33236 (fix(core): fix rate limit errors when deploying cloudwatch log groups) return logGroup; }