Skip to content

Resource: awsEfsMountTarget

Provides an Elastic File System (EFS) mount target.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsVpcFoo = new aws.vpc.Vpc(this, "foo", {
  cidrBlock: "10.0.0.0/16",
});
const awsSubnetAlpha = new aws.subnet.Subnet(this, "alpha", {
  availabilityZone: "us-west-2a",
  cidrBlock: "10.0.1.0/24",
  vpcId: awsVpcFoo.id,
});
const awsEfsMountTargetAlpha = new aws.efsMountTarget.EfsMountTarget(
  this,
  "alpha_2",
  {
    fileSystemId: "${aws_efs_file_system.foo.id}",
    subnetId: awsSubnetAlpha.id,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsEfsMountTargetAlpha.overrideLogicalId("alpha");

Argument Reference

The following arguments are supported:

  • fileSystemId - (Required) The ID of the file system for which the mount target is intended.
  • subnetId - (Required) The ID of the subnet to add the mount target in.
  • ipAddress - (Optional) The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
  • securityGroups - (Optional) A list of up to 5 VPC security group IDs (that must be for the same VPC as subnet specified) in effect for the mount target.

Attributes Reference

\~> Note: The dnsName and mountTargetDnsName attributes are only useful if the mount target is in a VPC that has support for DNS hostnames enabled. See Using DNS with Your VPC and VPC resource in Terraform for more information.

In addition to all arguments above, the following attributes are exported:

  • id - The ID of the mount target.
  • dnsName - The DNS name for the EFS file system.
  • mountTargetDnsName - The DNS name for the given subnet/AZ per documented convention.
  • fileSystemArn - Amazon Resource Name of the file system.
  • networkInterfaceId - The ID of the network interface that Amazon EFS created when it created the mount target.
  • availabilityZoneName - The name of the Availability Zone (AZ) that the mount target resides in.
  • availabilityZoneId - The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
  • ownerId - AWS account ID that owns the resource.

Timeouts

Configuration options:

  • create - (Default 30M)
  • delete - (Default 10M)

Import

The EFS mount targets can be imported using the id, e.g.,

$ terraform import aws_efs_mount_target.alpha fsmt-52a643fb