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(fsx): support AutoImportPolicy in LustreFilesystem (aws#21301)
---- closes aws#21288 The LustreFilesystem construct already supports a backing S3 bucket, through the importPath/exportPath parameters. CloudFormation supports an AutoImportPolicy parameter, to perform this import automatically and continuously if required. Currently, the L2 construct does not allow this parameter to be set. This PR adds that capability. ### All Submissions: * [yes] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [no] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [yes] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [yes] 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
14f1bc3
commit 9066147
Showing
12 changed files
with
1,725 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
36 changes: 36 additions & 0 deletions
36
packages/@aws-cdk/aws-fsx/test/integ.lustre-file-system-with-s3.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,36 @@ | ||
import * as ec2 from '@aws-cdk/aws-ec2'; | ||
import * as s3 from '@aws-cdk/aws-s3'; | ||
import { App, RemovalPolicy, Stack } from '@aws-cdk/core'; | ||
import * as integ from '@aws-cdk/integ-tests'; | ||
import * as fsx from '../lib'; | ||
|
||
const app = new App(); | ||
|
||
const stack = new Stack(app, 'AwsCdkFsxLustre'); | ||
|
||
const vpc = new ec2.Vpc(stack, 'VPC'); | ||
|
||
const bucket = new s3.Bucket(stack, 'ImportBucket', { | ||
removalPolicy: RemovalPolicy.DESTROY, | ||
}); | ||
|
||
const storageCapacity = 1200; | ||
const lustreConfiguration = { | ||
deploymentType: fsx.LustreDeploymentType.SCRATCH_2, | ||
importPath: bucket.s3UrlForObject(), | ||
autoImportPolicy: fsx.LustreAutoImportPolicy.NEW_CHANGED_DELETED, | ||
}; | ||
|
||
new fsx.LustreFileSystem(stack, 'FsxLustreFileSystem', { | ||
lustreConfiguration, | ||
storageCapacityGiB: storageCapacity, | ||
vpc, | ||
vpcSubnet: vpc.privateSubnets[0], | ||
removalPolicy: RemovalPolicy.DESTROY, | ||
}); | ||
|
||
new integ.IntegTest(app, 'FsxLustreWithS3Test', { | ||
testCases: [stack], | ||
}); | ||
|
||
app.synth(); |
19 changes: 19 additions & 0 deletions
19
...ws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/AwsCdkFsxLustre.assets.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,19 @@ | ||
{ | ||
"version": "20.0.0", | ||
"files": { | ||
"e5c2880bdb5feb3722b4fec17f3f9cfbe63b27acf4cf4ef5534d672ad6765484": { | ||
"source": { | ||
"path": "AwsCdkFsxLustre.template.json", | ||
"packaging": "file" | ||
}, | ||
"destinations": { | ||
"current_account-current_region": { | ||
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", | ||
"objectKey": "e5c2880bdb5feb3722b4fec17f3f9cfbe63b27acf4cf4ef5534d672ad6765484.json", | ||
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" | ||
} | ||
} | ||
} | ||
}, | ||
"dockerImages": {} | ||
} |
Oops, something went wrong.