Skip to content

Commit

Permalink
fix: rename 'transitionToArchive' prop to 'transitionToArchivePolicy'…
Browse files Browse the repository at this point in the history
… to be more consistent with other policies
  • Loading branch information
longtv2222 committed Jan 16, 2024
1 parent 6c7f368 commit 2e1513c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 3, natGateways: 1, restrictDefau
new FileSystem(stack, 'FileSystem', {
vpc,
lifecyclePolicy: LifecyclePolicy.AFTER_14_DAYS,
transitionToArchive: LifecyclePolicy.AFTER_90_DAYS,
transitionToArchivePolicy: LifecyclePolicy.AFTER_90_DAYS,
outOfInfrequentAccessPolicy: OutOfInfrequentAccessPolicy.AFTER_1_ACCESS,
});

Expand Down
6 changes: 3 additions & 3 deletions packages/aws-cdk-lib/aws-efs/lib/efs-file-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export interface FileSystemProps {
*
* @default - None. EFS will not transition files to Archive storage class.
*/
readonly transitionToArchive?: LifecyclePolicy;
readonly transitionToArchivePolicy?: LifecyclePolicy;
/**
* The performance mode that the file system will operate under.
* An Amazon EFS file system's performance mode can't be changed after the file system has been created.
Expand Down Expand Up @@ -542,8 +542,8 @@ export class FileSystem extends FileSystemBase {
lifecyclePolicies.push({ transitionToPrimaryStorageClass: props.outOfInfrequentAccessPolicy });
}

if (props.transitionToArchive) {
lifecyclePolicies.push({ transitionToArchive: props.transitionToArchive });
if (props.transitionToArchivePolicy) {
lifecyclePolicies.push({ transitionToArchive: props.transitionToArchivePolicy });
}

const oneZoneAzName = props.vpc.availabilityZones[0];
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-efs/test/efs-file-system.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ test('file system LifecyclePolicies is created correctly', () => {
vpc,
lifecyclePolicy: LifecyclePolicy.AFTER_7_DAYS,
outOfInfrequentAccessPolicy: OutOfInfrequentAccessPolicy.AFTER_1_ACCESS,
transitionToArchive: LifecyclePolicy.AFTER_14_DAYS,
transitionToArchivePolicy: LifecyclePolicy.AFTER_14_DAYS,
});
// THEN
Template.fromStack(stack).hasResourceProperties('AWS::EFS::FileSystem', {
Expand All @@ -136,7 +136,7 @@ test('file system with transition to archive is created correctly', () => {
// WHEN
new FileSystem(stack, 'EfsFileSystem', {
vpc,
transitionToArchive: LifecyclePolicy.AFTER_1_DAY,
transitionToArchivePolicy: LifecyclePolicy.AFTER_1_DAY,
});

Template.fromStack(stack).hasResourceProperties('AWS::EFS::FileSystem', {
Expand Down

0 comments on commit 2e1513c

Please sign in to comment.