AWS CloudFormation
User Guide (Version )

AWS::EFS::MountTarget

The AWS::EFS::MountTarget resource is an Amazon EFS resource that creates a mount target for an EFS file system. You can then mount the file system on Amazon EC2 instances or other resources by using the mount target.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::EFS::MountTarget", "Properties" : { "FileSystemId" : String, "IpAddress" : String, "SecurityGroups" : [ String, ... ], "SubnetId" : String } }

YAML

Type: AWS::EFS::MountTarget Properties: FileSystemId: String IpAddress: String SecurityGroups: - String SubnetId: String

Properties

FileSystemId

The ID of the file system for which to create the mount target.

Required: Yes

Type: String

Update requires: Replacement

IpAddress

Valid IPv4 address within the address range of the specified subnet.

Required: No

Type: String

Update requires: Replacement

SecurityGroups

Up to five VPC security group IDs, of the form sg-xxxxxxxx. These must be for the same VPC as subnet specified.

Required: Yes

Type: List of String

Maximum: 5

Update requires: No interruption

SubnetId

The ID of the subnet to add the mount target in.

Required: Yes

Type: String

Update requires: Replacement

Return Values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the resource ID. For example:

{"Ref":"fsmt-12345678"}.

For the Amazon EFS file system mount target fsmt-12345678, Ref returns the mount target ID.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

IpAddress

The IPv4 address of the mount target.

Examples

Declare a Mount Target for an EFS File System

The following example declares a mount target that is associated with a file system, subnet, and security group, which are all declared in the same template. EC2 instances that are in the same Availability Zone (AZ) as the mount target can use the mount target to connect to the associated file system. For information about mounting file systems on EC2 instances, see Mounting File Systems in the EFS User Guide.

JSON

"MountTarget": { "Type": "AWS::EFS::MountTarget", "Properties": { "FileSystemId": { "Ref": "FileSystem" }, "SubnetId": { "Ref": "Subnet" }, "SecurityGroups": [ { "Ref": "MountTargetSecurityGroup" } ] } }

YAML

MountTarget: Type: AWS::EFS::MountTarget Properties: FileSystemId: Ref: "FileSystem" SubnetId: Ref: "Subnet" SecurityGroups: - Ref: "MountTargetSecurityGroup"

See Also