Skip to content

Commit

Permalink
fix(aws-logs): set default log retention of LogGroup to 731 instead o…
Browse files Browse the repository at this point in the history
…f 730 (#1344)

Fixes #1343
  • Loading branch information
sam-goodwin authored and Elad Ben-Israel committed Dec 13, 2018
1 parent 48b9bdd commit 71dc09f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit 71dc09f

Please sign in to comment.