FileSystemAttributes

class aws_cdk.aws_fsx.FileSystemAttributes(*, dns_name, file_system_id, security_group)

Bases: object

Properties that describe an existing FSx file system.

Parameters:
  • 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.

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)

Attributes

dns_name

The DNS name assigned to this file system.

file_system_id

The ID of the file system, assigned by Amazon FSx.

security_group

The security group of the file system.