forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(s3): add
noncurrentVersionsToRetain
property to lifecycle rule (…
…aws#20348) Fixes aws#19784 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
1 parent
b22bd2c
commit 0973c34
Showing
10 changed files
with
284 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { App, Duration, Stack } from '@aws-cdk/core'; | ||
import { Bucket } from '../lib'; | ||
|
||
const app = new App(); | ||
|
||
const stack = new Stack(app, 'aws-cdk-s3'); | ||
|
||
new Bucket(stack, 'MyBucket', { | ||
lifecycleRules: [{ | ||
noncurrentVersionExpiration: Duration.days(30), | ||
noncurrentVersionsToRetain: 123, | ||
}], | ||
versioned: true, | ||
}); | ||
|
||
app.synth(); |
25 changes: 25 additions & 0 deletions
25
packages/@aws-cdk/aws-s3/test/lifecycle-expiration.integ.snapshot/aws-cdk-s3.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"Resources": { | ||
"MyBucketF68F3FF0": { | ||
"Type": "AWS::S3::Bucket", | ||
"Properties": { | ||
"LifecycleConfiguration": { | ||
"Rules": [ | ||
{ | ||
"NoncurrentVersionExpiration": { | ||
"NewerNoncurrentVersions": 123, | ||
"NoncurrentDays": 30 | ||
}, | ||
"Status": "Enabled" | ||
} | ||
] | ||
}, | ||
"VersioningConfiguration": { | ||
"Status": "Enabled" | ||
} | ||
}, | ||
"UpdateReplacePolicy": "Retain", | ||
"DeletionPolicy": "Retain" | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/@aws-cdk/aws-s3/test/lifecycle-expiration.integ.snapshot/cdk.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":"19.0.0"} |
14 changes: 14 additions & 0 deletions
14
packages/@aws-cdk/aws-s3/test/lifecycle-expiration.integ.snapshot/integ.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"version": "19.0.0", | ||
"testCases": { | ||
"aws-s3/test/integ.lifecycle-expiration": { | ||
"stacks": [ | ||
"aws-cdk-s3" | ||
], | ||
"diffAssets": false, | ||
"stackUpdateWorkflow": true | ||
} | ||
}, | ||
"synthContext": {}, | ||
"enableLookups": false | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/@aws-cdk/aws-s3/test/lifecycle-expiration.integ.snapshot/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"version": "19.0.0", | ||
"artifacts": { | ||
"Tree": { | ||
"type": "cdk:tree", | ||
"properties": { | ||
"file": "tree.json" | ||
} | ||
}, | ||
"aws-cdk-s3": { | ||
"type": "aws:cloudformation:stack", | ||
"environment": "aws://unknown-account/unknown-region", | ||
"properties": { | ||
"templateFile": "aws-cdk-s3.template.json", | ||
"validateOnSynth": false | ||
}, | ||
"metadata": { | ||
"/aws-cdk-s3/MyBucket/Resource": [ | ||
{ | ||
"type": "aws:cdk:logicalId", | ||
"data": "MyBucketF68F3FF0" | ||
} | ||
] | ||
}, | ||
"displayName": "aws-cdk-s3" | ||
} | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
packages/@aws-cdk/aws-s3/test/lifecycle-expiration.integ.snapshot/tree.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"version": "tree-0.1", | ||
"tree": { | ||
"id": "App", | ||
"path": "", | ||
"children": { | ||
"Tree": { | ||
"id": "Tree", | ||
"path": "Tree", | ||
"constructInfo": { | ||
"fqn": "@aws-cdk/core.Construct", | ||
"version": "0.0.0" | ||
} | ||
}, | ||
"aws-cdk-s3": { | ||
"id": "aws-cdk-s3", | ||
"path": "aws-cdk-s3", | ||
"children": { | ||
"MyBucket": { | ||
"id": "MyBucket", | ||
"path": "aws-cdk-s3/MyBucket", | ||
"children": { | ||
"Resource": { | ||
"id": "Resource", | ||
"path": "aws-cdk-s3/MyBucket/Resource", | ||
"attributes": { | ||
"aws:cdk:cloudformation:type": "AWS::S3::Bucket", | ||
"aws:cdk:cloudformation:props": { | ||
"lifecycleConfiguration": { | ||
"rules": [ | ||
{ | ||
"noncurrentVersionExpiration": { | ||
"noncurrentDays": 30, | ||
"newerNoncurrentVersions": 123 | ||
}, | ||
"status": "Enabled" | ||
} | ||
] | ||
}, | ||
"versioningConfiguration": { | ||
"status": "Enabled" | ||
} | ||
} | ||
}, | ||
"constructInfo": { | ||
"fqn": "@aws-cdk/aws-s3.CfnBucket", | ||
"version": "0.0.0" | ||
} | ||
} | ||
}, | ||
"constructInfo": { | ||
"fqn": "@aws-cdk/aws-s3.Bucket", | ||
"version": "0.0.0" | ||
} | ||
} | ||
}, | ||
"constructInfo": { | ||
"fqn": "@aws-cdk/core.Stack", | ||
"version": "0.0.0" | ||
} | ||
} | ||
}, | ||
"constructInfo": { | ||
"fqn": "@aws-cdk/core.App", | ||
"version": "0.0.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters