Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aws-logs): set default log retention of LogGroup to 731 instead of 730 (#1343) #1344

Merged
merged 1 commit into from
Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-logs/lib/log-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export interface LogGroupProps {
*
* To retain all logs, set this value to Infinity.
*
* @default 730 days (2 years)
* @default 731 days (2 years)
*/
retentionDays?: number;

Expand Down Expand Up @@ -184,7 +184,7 @@ export class LogGroup extends LogGroupRef {
super(parent, id);

let retentionInDays = props.retentionDays;
if (retentionInDays === undefined) { retentionInDays = 730; }
if (retentionInDays === undefined) { retentionInDays = 731; }
if (retentionInDays === Infinity) { retentionInDays = undefined; }

if (retentionInDays !== undefined && retentionInDays <= 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"LogGroupF5B46931": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
"RetentionInDays": 730
"RetentionInDays": 731
}
},
"MetricFilter1B93B6E5": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-logs/test/test.loggroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export = {

// THEN
expect(stack).to(haveResource('AWS::Logs::LogGroup', {
RetentionInDays: 730
RetentionInDays: 731
}));

test.done();
Expand Down