LustreFileSystem

class aws_cdk.aws_fsx.LustreFileSystem(scope, id, *, lustre_configuration, vpc_subnet, storage_capacity_gib, vpc, backup_id=None, kms_key=None, removal_policy=None, security_group=None)

Bases: FileSystemBase

The FSx for Lustre File System implementation of IFileSystem.

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-fsx-filesystem.html

Resource:

AWS::FSx::FileSystem

ExampleMetadata:

infused

Example:

sg = ec2.SecurityGroup.from_security_group_id(self, "FsxSecurityGroup", "{SECURITY-GROUP-ID}")
fs = fsx.LustreFileSystem.from_lustre_file_system_attributes(self, "FsxLustreFileSystem",
    dns_name="{FILE-SYSTEM-DNS-NAME}",
    file_system_id="{FILE-SYSTEM-ID}",
    security_group=sg
)

vpc = ec2.Vpc.from_vpc_attributes(self, "Vpc",
    availability_zones=["us-west-2a", "us-west-2b"],
    public_subnet_ids=["{US-WEST-2A-SUBNET-ID}", "{US-WEST-2B-SUBNET-ID}"],
    vpc_id="{VPC-ID}"
)

inst = ec2.Instance(self, "inst",
    instance_type=ec2.InstanceType.of(ec2.InstanceClass.T2, ec2.InstanceSize.LARGE),
    machine_image=ec2.AmazonLinuxImage(
        generation=ec2.AmazonLinuxGeneration.AMAZON_LINUX_2
    ),
    vpc=vpc,
    vpc_subnets=ec2.SubnetSelection(
        subnet_type=ec2.SubnetType.PUBLIC
    )
)

fs.connections.allow_default_port_from(inst)
Parameters:
  • scope (Construct) –

  • id (str) –

  • lustre_configuration (Union[LustreConfiguration, Dict[str, Any]]) – Additional configuration for FSx specific to Lustre.

  • vpc_subnet (ISubnet) – The subnet that the file system will be accessible from.

  • storage_capacity_gib (Union[int, float]) – The storage capacity of the file system being created. For Windows file systems, valid values are 32 GiB to 65,536 GiB. For SCRATCH_1 deployment types, valid values are 1,200, 2,400, 3,600, then continuing in increments of 3,600 GiB. For SCRATCH_2 and PERSISTENT_1 types, valid values are 1,200, 2,400, then continuing in increments of 2,400 GiB.

  • vpc (IVpc) – The VPC to launch the file system in.

  • backup_id (Optional[str]) – The ID of the backup. Specifies the backup to use if you’re creating a file system from an existing backup. Default: - no backup will be used.

  • kms_key (Optional[IKey]) – The KMS key used for encryption to protect your data at rest. Default: - the aws/fsx default KMS key for the AWS account being deployed into.

  • removal_policy (Optional[RemovalPolicy]) – Policy to apply when the file system is removed from the stack. Default: RemovalPolicy.RETAIN

  • security_group (Optional[ISecurityGroup]) – Security Group to assign to this file system. Default: - creates new security group which allows all outbound traffic.

Methods

apply_removal_policy(policy)

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:

policy (RemovalPolicy) –

Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

connections

The security groups/rules used to allow network connections to the file system.

dns_name

The DNS name assigned to this file system.

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

file_system_id

The ID that AWS assigns to the file system.

mount_name

The mount name of the file system, generated by FSx.

Attribute:

LustreMountName

node

The construct tree node associated with this construct.

stack

The stack in which this resource is defined.

Static Methods

classmethod from_lustre_file_system_attributes(scope, id, *, dns_name, file_system_id, security_group)

Import an existing FSx for Lustre file system from the given properties.

Parameters:
  • scope (Construct) –

  • id (str) –

  • dns_name (str) – The DNS name assigned to this file system.

  • file_system_id (str) – The ID of the file system, assigned by Amazon FSx.

  • security_group (ISecurityGroup) – The security group of the file system.

Return type:

IFileSystem

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool

classmethod is_resource(construct)

Check whether the given construct is a Resource.

Parameters:

construct (IConstruct) –

Return type:

bool