diff --git a/packages/@aws-cdk/aws-fsx/README.md b/packages/@aws-cdk/aws-fsx/README.md index 472d367835313..50fbad1d10a42 100644 --- a/packages/@aws-cdk/aws-fsx/README.md +++ b/packages/@aws-cdk/aws-fsx/README.md @@ -128,7 +128,7 @@ inst.userData.addCommands( ); ``` -### Importing +### Importing an existing Lustre filesystem An FSx for Lustre file system can be imported with `fromLustreFileSystemAttributes(stack, id, attributes)`. The following example lays out how you could import the SecurityGroup a file system belongs to, use that to import the file @@ -163,6 +163,33 @@ const inst = new ec2.Instance(this, 'inst', { fs.connections.allowDefaultPortFrom(inst); ``` +### Lustre Data Repository Association support + +The LustreFilesystem Construct supports one [Data Repository Association](https://docs.aws.amazon.com/fsx/latest/LustreGuide/fsx-data-repositories.html) (DRA) to an S3 bucket. This allows Lustre hierarchical storage management to S3 buckets, which in turn makes it possible to use S3 as a permanent backing store, and use FSx for Lustre as a temporary high performance cache. + +Note: CloudFormation does not currently support for `PERSISTENT_2` filesystems, and so neither does CDK. + +The following example illustrates setting up a DRA to an S3 bucket, including automated metadata import whenever a file is changed, created or deleted in the S3 bucket: + +```ts +declare const vpc: ec2.Vpc; +declare const bucket: s3.Bucket; + +const lustreConfiguration = { + deploymentType: fsx.LustreDeploymentType.SCRATCH_2, + exportPath: bucket.s3UrlForObject(), + importPath: bucket.s3UrlForObject(), + autoImportPolicy: fsx.LustreAutoImportPolicy.NEW_CHANGED_DELETED, +}; + +const fs = new fsx.LustreFileSystem(this, "FsxLustreFileSystem", { + vpc: vpc, + vpcSubnet: vpc.privateSubnets[0], + storageCapacityGiB: 1200, + lustreConfiguration, +}); +``` + ## FSx for Windows File Server The L2 construct for the FSx for Windows File Server has not yet been implemented. To instantiate an FSx for Windows diff --git a/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts b/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts index 57e62a5be3143..b8dd31abd1f7b 100644 --- a/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts +++ b/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts @@ -28,6 +28,27 @@ export enum LustreDeploymentType { */ PERSISTENT_2 = 'PERSISTENT_2', } +/** + * The different auto import policies which are allowed + */ +export enum LustreAutoImportPolicy { + /** + * AutoImport is off. Amazon FSx only updates file and directory listings from the linked S3 bucket when the file system is created. FSx does not update file and directory listings for any new or changed objects after choosing this option. + */ + NONE = 'NONE', + /** + * AutoImport is on. Amazon FSx automatically imports directory listings of any new objects added to the linked S3 bucket that do not currently exist in the FSx file system. + */ + NEW = 'NEW', + /** + * AutoImport is on. Amazon FSx automatically imports file and directory listings of any new objects added to the S3 bucket and any existing objects that are changed in the S3 bucket after you choose this option. + */ + NEW_CHANGED = 'NEW_CHANGED', + /** + * AutoImport is on. Amazon FSx automatically imports file and directory listings of any new objects added to the S3 bucket, any existing objects that are changed in the S3 bucket, and any objects that were deleted in the S3 bucket. + * */ + NEW_CHANGED_DELETED = 'NEW_CHANGED_DELETED', +} /** * The configuration for the Amazon FSx for Lustre file system. @@ -69,6 +90,18 @@ export interface LustreConfiguration { */ readonly importPath?: string; + /** + * Available with `Scratch` and `Persistent_1` deployment types. When you create your file system, your existing S3 objects appear as file and directory listings. Use this property to choose how Amazon FSx keeps your file and directory listings up to date as you add or modify objects in your linked S3 bucket. `AutoImportPolicy` can have the following values: + * + * For more information, see [Automatically import updates from your S3 bucket](https://docs.aws.amazon.com/fsx/latest/LustreGuide/autoimport-data-repo.html) . + * + * > This parameter is not supported for Lustre file systems using the `Persistent_2` deployment type. + * + * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html#cfn-fsx-filesystem-lustreconfiguration-autoimportpolicy + * @default - no import policy + */ + readonly autoImportPolicy?: LustreAutoImportPolicy; + /** * Required for the PERSISTENT_1 deployment type, describes the amount of read and write throughput for each 1 * tebibyte of storage, in MB/s/TiB. Valid values are 50, 100, 200. @@ -222,10 +255,25 @@ export class LustreFileSystem extends FileSystemBase { this.validateExportPath(lustreConfiguration.exportPath, lustreConfiguration.importPath); this.validateImportedFileChunkSize(lustreConfiguration.importedFileChunkSizeMiB); + this.validateAutoImportPolicy(deploymentType, lustreConfiguration.importPath, lustreConfiguration.autoImportPolicy); this.validatePerUnitStorageThroughput(deploymentType, lustreConfiguration.perUnitStorageThroughput); this.validateStorageCapacity(deploymentType, props.storageCapacityGiB); } + /** + * Validates the auto import policy + */ + + private validateAutoImportPolicy(deploymentType: LustreDeploymentType, importPath?: string, autoImportPolicy?: LustreAutoImportPolicy): void { + if (autoImportPolicy === undefined) { return; } + if (importPath === undefined) { + throw new Error('autoImportPolicy requires importPath to be defined'); + } + if (deploymentType === LustreDeploymentType.PERSISTENT_2) { + throw new Error('autoImportPolicy is not supported with PERSISTENT_2 deployments'); + } + } + /** * Validates the export path is in the correct format and matches the import path. */ diff --git a/packages/@aws-cdk/aws-fsx/package.json b/packages/@aws-cdk/aws-fsx/package.json index 8bf8690d9d1e5..6b3dddca0814d 100644 --- a/packages/@aws-cdk/aws-fsx/package.json +++ b/packages/@aws-cdk/aws-fsx/package.json @@ -84,12 +84,14 @@ "devDependencies": { "@aws-cdk/assertions": "0.0.0", "@aws-cdk/cdk-build-tools": "0.0.0", - "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", + "@aws-cdk/integ-runner": "0.0.0", + "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2" }, "dependencies": { + "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", @@ -97,6 +99,7 @@ "constructs": "^10.0.0" }, "peerDependencies": { + "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", diff --git a/packages/@aws-cdk/aws-fsx/test/integ.lustre-file-system-with-s3.ts b/packages/@aws-cdk/aws-fsx/test/integ.lustre-file-system-with-s3.ts new file mode 100644 index 0000000000000..295616cf91024 --- /dev/null +++ b/packages/@aws-cdk/aws-fsx/test/integ.lustre-file-system-with-s3.ts @@ -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(); diff --git a/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/AwsCdkFsxLustre.assets.json b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/AwsCdkFsxLustre.assets.json new file mode 100644 index 0000000000000..b50ecb65ff489 --- /dev/null +++ b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/AwsCdkFsxLustre.assets.json @@ -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": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/AwsCdkFsxLustre.template.json b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/AwsCdkFsxLustre.template.json new file mode 100644 index 0000000000000..cffd8fd3686c7 --- /dev/null +++ b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/AwsCdkFsxLustre.template.json @@ -0,0 +1,466 @@ +{ + "Resources": { + "VPCB9E5F0B4": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC" + } + ] + } + }, + "VPCPublicSubnet1SubnetB4246D30": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1RouteTableFEE4B781": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1RouteTableAssociation0B0896DC": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "VPCPublicSubnet1DefaultRoute91CEF279": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet1EIP6AD938E8": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1NATGatewayE0556630": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "Tags": [ + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet2Subnet74179F39": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.64.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2RouteTable6F1A15F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2RouteTableAssociation5A808732": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "VPCPublicSubnet2DefaultRouteB7481BBA": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet2EIP4947BC00": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2NATGateway3C070193": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "Tags": [ + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPrivateSubnet1Subnet8BCA10E0": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC/PrivateSubnet1" + } + ] + } + }, + "VPCPrivateSubnet1RouteTableBE8A6027": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC/PrivateSubnet1" + } + ] + } + }, + "VPCPrivateSubnet1RouteTableAssociation347902D1": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "VPCPrivateSubnet1DefaultRouteAE1D6490": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + } + } + }, + "VPCPrivateSubnet2SubnetCFCDAA7A": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.192.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC/PrivateSubnet2" + } + ] + } + }, + "VPCPrivateSubnet2RouteTable0A19E10E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC/PrivateSubnet2" + } + ] + } + }, + "VPCPrivateSubnet2RouteTableAssociation0C73D413": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "VPCPrivateSubnet2DefaultRouteF4F5CFD2": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + } + } + }, + "VPCIGWB7E252D3": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "AwsCdkFsxLustre/VPC" + } + ] + } + }, + "VPCVPCGW99B986DC": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "InternetGatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "ImportBucketBAF3A8E9": { + "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FsxLustreFileSystemFsxLustreSecurityGroup1C661EA7": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "AwsCdkFsxLustre/FsxLustreFileSystem/FsxLustreSecurityGroup", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "FsxLustreFileSystemFsxLustreSecurityGroupfromAwsCdkFsxLustreFsxLustreFileSystemFsxLustreSecurityGroup95767E0C98810230FA2D695": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "IpProtocol": "tcp", + "Description": "from AwsCdkFsxLustreFsxLustreFileSystemFsxLustreSecurityGroup95767E0C:988-1023", + "FromPort": 988, + "GroupId": { + "Fn::GetAtt": [ + "FsxLustreFileSystemFsxLustreSecurityGroup1C661EA7", + "GroupId" + ] + }, + "SourceSecurityGroupId": { + "Fn::GetAtt": [ + "FsxLustreFileSystemFsxLustreSecurityGroup1C661EA7", + "GroupId" + ] + }, + "ToPort": 1023 + } + }, + "FsxLustreFileSystem1F786378": { + "Type": "AWS::FSx::FileSystem", + "Properties": { + "FileSystemType": "LUSTRE", + "SubnetIds": [ + { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + ], + "LustreConfiguration": { + "AutoImportPolicy": "NEW_CHANGED_DELETED", + "DeploymentType": "SCRATCH_2", + "ImportPath": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "ImportBucketBAF3A8E9" + } + ] + ] + } + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "FsxLustreFileSystemFsxLustreSecurityGroup1C661EA7", + "GroupId" + ] + } + ], + "StorageCapacity": 1200 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/FsxLustreWithS3TestDefaultTestDeployAssert0752DB81.template.json b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/FsxLustreWithS3TestDefaultTestDeployAssert0752DB81.template.json new file mode 100644 index 0000000000000..9e26dfeeb6e64 --- /dev/null +++ b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/FsxLustreWithS3TestDefaultTestDeployAssert0752DB81.template.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/cdk.out new file mode 100644 index 0000000000000..588d7b269d34f --- /dev/null +++ b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/integ.json b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/integ.json new file mode 100644 index 0000000000000..843280424de3d --- /dev/null +++ b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/integ.json @@ -0,0 +1,11 @@ +{ + "version": "20.0.0", + "testCases": { + "FsxLustreWithS3Test/DefaultTest": { + "stacks": [ + "AwsCdkFsxLustre" + ], + "assertionStack": "FsxLustreWithS3TestDefaultTestDeployAssert0752DB81" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/manifest.json new file mode 100644 index 0000000000000..dbc757601729e --- /dev/null +++ b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/manifest.json @@ -0,0 +1,193 @@ +{ + "version": "20.0.0", + "artifacts": { + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + }, + "AwsCdkFsxLustre": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "AwsCdkFsxLustre.template.json", + "validateOnSynth": false + }, + "metadata": { + "/AwsCdkFsxLustre/VPC/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCB9E5F0B4" + } + ], + "/AwsCdkFsxLustre/VPC/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1SubnetB4246D30" + } + ], + "/AwsCdkFsxLustre/VPC/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableFEE4B781" + } + ], + "/AwsCdkFsxLustre/VPC/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" + } + ], + "/AwsCdkFsxLustre/VPC/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1DefaultRoute91CEF279" + } + ], + "/AwsCdkFsxLustre/VPC/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1EIP6AD938E8" + } + ], + "/AwsCdkFsxLustre/VPC/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1NATGatewayE0556630" + } + ], + "/AwsCdkFsxLustre/VPC/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2Subnet74179F39" + } + ], + "/AwsCdkFsxLustre/VPC/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTable6F1A15F1" + } + ], + "/AwsCdkFsxLustre/VPC/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTableAssociation5A808732" + } + ], + "/AwsCdkFsxLustre/VPC/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2DefaultRouteB7481BBA" + } + ], + "/AwsCdkFsxLustre/VPC/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2EIP4947BC00" + } + ], + "/AwsCdkFsxLustre/VPC/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2NATGateway3C070193" + } + ], + "/AwsCdkFsxLustre/VPC/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1Subnet8BCA10E0" + } + ], + "/AwsCdkFsxLustre/VPC/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableBE8A6027" + } + ], + "/AwsCdkFsxLustre/VPC/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" + } + ], + "/AwsCdkFsxLustre/VPC/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" + } + ], + "/AwsCdkFsxLustre/VPC/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ], + "/AwsCdkFsxLustre/VPC/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTable0A19E10E" + } + ], + "/AwsCdkFsxLustre/VPC/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" + } + ], + "/AwsCdkFsxLustre/VPC/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" + } + ], + "/AwsCdkFsxLustre/VPC/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCIGWB7E252D3" + } + ], + "/AwsCdkFsxLustre/VPC/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCVPCGW99B986DC" + } + ], + "/AwsCdkFsxLustre/ImportBucket/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ImportBucketBAF3A8E9" + } + ], + "/AwsCdkFsxLustre/FsxLustreFileSystem/FsxLustreSecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FsxLustreFileSystemFsxLustreSecurityGroup1C661EA7" + } + ], + "/AwsCdkFsxLustre/FsxLustreFileSystem/FsxLustreSecurityGroup/from AwsCdkFsxLustreFsxLustreFileSystemFsxLustreSecurityGroup95767E0C:988-1023": [ + { + "type": "aws:cdk:logicalId", + "data": "FsxLustreFileSystemFsxLustreSecurityGroupfromAwsCdkFsxLustreFsxLustreFileSystemFsxLustreSecurityGroup95767E0C98810230FA2D695" + } + ], + "/AwsCdkFsxLustre/FsxLustreFileSystem/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FsxLustreFileSystem1F786378" + } + ] + }, + "displayName": "AwsCdkFsxLustre" + }, + "FsxLustreWithS3TestDefaultTestDeployAssert0752DB81": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "FsxLustreWithS3TestDefaultTestDeployAssert0752DB81.template.json", + "validateOnSynth": false + }, + "displayName": "FsxLustreWithS3Test/DefaultTest/DeployAssert" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/tree.json b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/tree.json new file mode 100644 index 0000000000000..270f3540ee7bb --- /dev/null +++ b/packages/@aws-cdk/aws-fsx/test/lustre-file-system-with-s3.integ.snapshot/tree.json @@ -0,0 +1,848 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.51" + } + }, + "AwsCdkFsxLustre": { + "id": "AwsCdkFsxLustre", + "path": "AwsCdkFsxLustre", + "children": { + "VPC": { + "id": "VPC", + "path": "AwsCdkFsxLustre/VPC", + "children": { + "Resource": { + "id": "Resource", + "path": "AwsCdkFsxLustre/VPC/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "tags": [ + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "tags": [ + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "tags": [ + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet2/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "AwsCdkFsxLustre/VPC/PublicSubnet2/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "tags": [ + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "AwsCdkFsxLustre/VPC/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "AwsCdkFsxLustre/VPC/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC/PrivateSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "AwsCdkFsxLustre/VPC/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "AwsCdkFsxLustre/VPC/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "tags": [ + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC/PrivateSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "AwsCdkFsxLustre/VPC/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "AwsCdkFsxLustre/VPC/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "AwsCdkFsxLustre/VPC/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "AwsCdkFsxLustre/VPC/PrivateSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC/PrivateSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "AwsCdkFsxLustre/VPC/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "AwsCdkFsxLustre/VPC/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "tags": [ + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC/PrivateSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "AwsCdkFsxLustre/VPC/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "AwsCdkFsxLustre/VPC/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "AwsCdkFsxLustre/VPC/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "AwsCdkFsxLustre/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "AwsCdkFsxLustre/VPC/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "VPCB9E5F0B4" + }, + "internetGatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.Vpc", + "version": "0.0.0" + } + }, + "ImportBucket": { + "id": "ImportBucket", + "path": "AwsCdkFsxLustre/ImportBucket", + "children": { + "Resource": { + "id": "Resource", + "path": "AwsCdkFsxLustre/ImportBucket/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::Bucket", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.CfnBucket", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.Bucket", + "version": "0.0.0" + } + }, + "FsxLustreFileSystem": { + "id": "FsxLustreFileSystem", + "path": "AwsCdkFsxLustre/FsxLustreFileSystem", + "children": { + "FsxLustreSecurityGroup": { + "id": "FsxLustreSecurityGroup", + "path": "AwsCdkFsxLustre/FsxLustreFileSystem/FsxLustreSecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "AwsCdkFsxLustre/FsxLustreFileSystem/FsxLustreSecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "AwsCdkFsxLustre/FsxLustreFileSystem/FsxLustreSecurityGroup", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", + "version": "0.0.0" + } + }, + "from AwsCdkFsxLustreFsxLustreFileSystemFsxLustreSecurityGroup95767E0C:988-1023": { + "id": "from AwsCdkFsxLustreFsxLustreFileSystemFsxLustreSecurityGroup95767E0C:988-1023", + "path": "AwsCdkFsxLustre/FsxLustreFileSystem/FsxLustreSecurityGroup/from AwsCdkFsxLustreFsxLustreFileSystemFsxLustreSecurityGroup95767E0C:988-1023", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", + "aws:cdk:cloudformation:props": { + "ipProtocol": "tcp", + "description": "from AwsCdkFsxLustreFsxLustreFileSystemFsxLustreSecurityGroup95767E0C:988-1023", + "fromPort": 988, + "groupId": { + "Fn::GetAtt": [ + "FsxLustreFileSystemFsxLustreSecurityGroup1C661EA7", + "GroupId" + ] + }, + "sourceSecurityGroupId": { + "Fn::GetAtt": [ + "FsxLustreFileSystemFsxLustreSecurityGroup1C661EA7", + "GroupId" + ] + }, + "toPort": 1023 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroupIngress", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "AwsCdkFsxLustre/FsxLustreFileSystem/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::FSx::FileSystem", + "aws:cdk:cloudformation:props": { + "fileSystemType": "LUSTRE", + "subnetIds": [ + { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + ], + "lustreConfiguration": { + "deploymentType": "SCRATCH_2", + "importPath": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "ImportBucketBAF3A8E9" + } + ] + ] + }, + "autoImportPolicy": "NEW_CHANGED_DELETED" + }, + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "FsxLustreFileSystemFsxLustreSecurityGroup1C661EA7", + "GroupId" + ] + } + ], + "storageCapacity": 1200 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-fsx.CfnFileSystem", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-fsx.LustreFileSystem", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "FsxLustreWithS3Test": { + "id": "FsxLustreWithS3Test", + "path": "FsxLustreWithS3Test", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "FsxLustreWithS3Test/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "FsxLustreWithS3Test/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.51" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "FsxLustreWithS3Test/DefaultTest/DeployAssert", + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-fsx/test/lustre-file-system.test.ts b/packages/@aws-cdk/aws-fsx/test/lustre-file-system.test.ts index cff4f97f1149f..c48720cbd1afd 100644 --- a/packages/@aws-cdk/aws-fsx/test/lustre-file-system.test.ts +++ b/packages/@aws-cdk/aws-fsx/test/lustre-file-system.test.ts @@ -3,7 +3,7 @@ import { Template } from '@aws-cdk/assertions'; import { ISubnet, Port, SecurityGroup, Subnet, Vpc } from '@aws-cdk/aws-ec2'; import { Key } from '@aws-cdk/aws-kms'; import { Aws, Stack, Token } from '@aws-cdk/core'; -import { LustreConfiguration, LustreDeploymentType, LustreFileSystem, LustreMaintenanceTime, Weekday } from '../lib'; +import { LustreConfiguration, LustreDeploymentType, LustreAutoImportPolicy, LustreFileSystem, LustreMaintenanceTime, Weekday } from '../lib'; describe('FSx for Lustre File System', () => { let lustreConfiguration: LustreConfiguration; @@ -281,6 +281,75 @@ describe('FSx for Lustre File System', () => { }); }); + describe('autoImportPolicy', () => { + test('autoImportPath unsupported with PERSISTENT_2', () => { + const importPath = 's3://import-bucket/import-prefix'; + + lustreConfiguration = { + deploymentType: LustreDeploymentType.PERSISTENT_2, + autoImportPolicy: LustreAutoImportPolicy.NEW_CHANGED_DELETED, + importPath, + }; + + expect(() => { + new LustreFileSystem(stack, 'FsxFilesystem', { + lustreConfiguration, + storageCapacityGiB: storageCapacity, + vpc, + vpcSubnet, + }); + }).toThrowError('autoImportPolicy is not supported with PERSISTENT_2 deployments'); + }); + + test('autoImportPath requires importPath', () => { + + lustreConfiguration = { + deploymentType: LustreDeploymentType.PERSISTENT_1, + autoImportPolicy: LustreAutoImportPolicy.NEW_CHANGED_DELETED, + }; + + expect(() => { + new LustreFileSystem(stack, 'FsxFilesystem', { + lustreConfiguration, + storageCapacityGiB: storageCapacity, + vpc, + vpcSubnet, + }); + }).toThrowError('autoImportPolicy requires importPath to be defined'); + }); + }); + + describe('autoImportPolicy', () => { + test.each([ + LustreAutoImportPolicy.NONE, + LustreAutoImportPolicy.NEW, + LustreAutoImportPolicy.NEW_CHANGED, + LustreAutoImportPolicy.NEW_CHANGED_DELETED, + ])('valid autoImportPolicy', (autoImportPolicy: LustreAutoImportPolicy) => { + const importPath = 's3://import-bucket/import-path'; + + lustreConfiguration = { + deploymentType: LustreDeploymentType.PERSISTENT_1, + importPath, + autoImportPolicy, + }; + + new LustreFileSystem(stack, 'FsxFileSystem', { + lustreConfiguration, + storageCapacityGiB: storageCapacity, + vpc, + vpcSubnet, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::FSx::FileSystem', { + LustreConfiguration: { + AutoImportPolicy: autoImportPolicy, + DeploymentType: LustreDeploymentType.PERSISTENT_1, + }, + }); + }); + }); + describe('importedFileChunkSize', () => { test.each([ 1,