AWSTemplateFormatVersion: "2010-09-09" Description: >- (WWPS-GLS-WF-GWFCORE-FSX) Creates FSx for Lustre file system Parameters: VpcId: Type: AWS::EC2::VPC::Id Description: The VPC to create security groups SubnetId: Type: String Description: "Subnet you want your FSx for lustre file system to launch in. Ensure Batch compute environment is also launched in that subnet only." S3BucketName: Type: String AllowedPattern: "((?=^.{3,63}$)(?!^(\\d+\\.)+\\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])$)|(^.{0}$))" ConstraintDescription: "Must respect AWS naming conventions" Description: A S3 bucket name to mount on FSx FSxStorageType: Type: String Description: The type of FS needed i.e. SSD/HDD/SCRATCH, all capitals. Default: "SCRATCH" AllowedValues: - "SSD" - "HDD" - "SCRATCH" FSxStorageVolumeSize: Type: Number Default: 0 Description: The initial size of the FSx volume to be used in GB. 0 will map to the minimum allowed size for this type of file system. FSxPerUnitStorageThroughput: Type: Number Default: 0 Description: The throughput to be used for the storage, should be as provided, SSD - 50/100/200 mbps or HDD - 12/40. 0 will map to the minimum allowed throughput for this type of file system. Mappings: FSxTypeMap: SSD: DeploymentTypeString: "PERSISTENT_1" StorageTypeString: "SSD" MinThroughput: 50 MinStorageCap: 1200 HDD: DeploymentTypeString: "PERSISTENT_1" StorageTypeString: "HDD" MinThroughput: 12 MinStorageCap: 6000 SCRATCH: DeploymentTypeString: "SCRATCH_2" StorageTypeString: "SSD" MinThroughput: "NA" MinStorageCap: 1200 TagMap: default: architecture: "genomics-workflows" solution: "default" tags: - Key: "architecture" Value: "genomics-workflows" - Key: "solution" Value: "default" Conditions: ScratchCheck: !Equals [!Ref FSxStorageType, "SCRATCH"] TypeCheck: !Or [!Equals [!Ref FSxStorageType, "SCRATCH"], !Equals [!Ref FSxStorageType, "SSD"]] IsMinThroughput: !Equals [!Ref FSxPerUnitStorageThroughput, 0] IsMinStorageCapacity: !Equals [!Ref FSxStorageVolumeSize, 0] Resources: FSxSecurityGroup: Type: AWS::EC2::SecurityGroup Properties: GroupDescription: SG for FSx VpcId: Ref: VpcId Tags: - Key: Application Value: AWS-GENOMICS-WKF SGIngressTCP988: Type: AWS::EC2::SecurityGroupIngress Properties: Description: "Allow TCP Connections for this security group" GroupId: !Ref FSxSecurityGroup SourceSecurityGroupId: !Ref FSxSecurityGroup IpProtocol: tcp FromPort: 988 ToPort: 988 SGIngressTCP1021: Type: AWS::EC2::SecurityGroupIngress Properties: Description: "Allow TCP Connections for this security group" GroupId: !Ref FSxSecurityGroup SourceSecurityGroupId: !Ref FSxSecurityGroup IpProtocol: tcp FromPort: 1021 ToPort: 1023 FSxFileSystem: Type: AWS::FSx::FileSystem Properties: FileSystemType: "LUSTRE" LustreConfiguration: AutoImportPolicy: "NEW_CHANGED" DeploymentType: !FindInMap [FSxTypeMap, !Ref FSxStorageType, DeploymentTypeString] DriveCacheType: Fn::If: - TypeCheck - !Ref AWS::NoValue - "NONE" ExportPath: !Sub s3://${S3BucketName} ImportPath: !Sub s3://${S3BucketName} PerUnitStorageThroughput: Fn::If: - ScratchCheck - !Ref AWS::NoValue - Fn::If: - IsMinThroughput - !FindInMap [FSxTypeMap, !Ref FSxStorageType, MinThroughput] - !Ref FSxPerUnitStorageThroughput SecurityGroupIds: - !Ref FSxSecurityGroup StorageCapacity: Fn::If: - IsMinStorageCapacity - !FindInMap [FSxTypeMap, !Ref FSxStorageType, MinStorageCap] - !Ref FSxStorageVolumeSize StorageType: !FindInMap [FSxTypeMap, !Ref FSxStorageType, StorageTypeString] SubnetIds: [!Ref SubnetId] Tags: - Key: architecture Value: !FindInMap ["TagMap", "default", "architecture"] Outputs: FSxId: Value: !Ref FSxFileSystem Description: FSx ID FSxMount: Value: !GetAtt FSxFileSystem.LustreMountName Description: FSx Mount Name FSxSecurityGroupId: Description: The FSx Security Group Value: !Ref FSxSecurityGroup