Skip to content

Commit

Permalink
fix(core): fix rate limit errors when deploying cloudwatch log groups
Browse files Browse the repository at this point in the history
  • Loading branch information
xuetinp committed Sep 20, 2022
1 parent c27797b commit c5f4fb2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/aws-rfdk/lib/core/lib/exporting-log-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
8 changes: 8 additions & 0 deletions packages/aws-rfdk/lib/core/lib/log-group-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,21 @@ export class LogGroupFactory {
maxRetries: 7,
},
}).logGroupArn);
<<<<<<< HEAD

const logRetentionFunctionLogicalId = 'LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a';
const logRetentionFunction = Stack.of(scope).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(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;
}
Expand Down

0 comments on commit c5f4fb2

Please sign in to comment.