1. Packages
  2. AWS
  3. API Docs
  4. efs
  5. MountTarget
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.efs.MountTarget

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Provides an Elastic File System (EFS) mount target.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const foo = new aws.ec2.Vpc("foo", {cidrBlock: "10.0.0.0/16"});
    const alphaSubnet = new aws.ec2.Subnet("alpha", {
        vpcId: foo.id,
        availabilityZone: "us-west-2a",
        cidrBlock: "10.0.1.0/24",
    });
    const alpha = new aws.efs.MountTarget("alpha", {
        fileSystemId: fooAwsEfsFileSystem.id,
        subnetId: alphaSubnet.id,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    foo = aws.ec2.Vpc("foo", cidr_block="10.0.0.0/16")
    alpha_subnet = aws.ec2.Subnet("alpha",
        vpc_id=foo.id,
        availability_zone="us-west-2a",
        cidr_block="10.0.1.0/24")
    alpha = aws.efs.MountTarget("alpha",
        file_system_id=foo_aws_efs_file_system["id"],
        subnet_id=alpha_subnet.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/efs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foo, err := ec2.NewVpc(ctx, "foo", &ec2.VpcArgs{
    			CidrBlock: pulumi.String("10.0.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		alphaSubnet, err := ec2.NewSubnet(ctx, "alpha", &ec2.SubnetArgs{
    			VpcId:            foo.ID(),
    			AvailabilityZone: pulumi.String("us-west-2a"),
    			CidrBlock:        pulumi.String("10.0.1.0/24"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = efs.NewMountTarget(ctx, "alpha", &efs.MountTargetArgs{
    			FileSystemId: pulumi.Any(fooAwsEfsFileSystem.Id),
    			SubnetId:     alphaSubnet.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Aws.Ec2.Vpc("foo", new()
        {
            CidrBlock = "10.0.0.0/16",
        });
    
        var alphaSubnet = new Aws.Ec2.Subnet("alpha", new()
        {
            VpcId = foo.Id,
            AvailabilityZone = "us-west-2a",
            CidrBlock = "10.0.1.0/24",
        });
    
        var alpha = new Aws.Efs.MountTarget("alpha", new()
        {
            FileSystemId = fooAwsEfsFileSystem.Id,
            SubnetId = alphaSubnet.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.Vpc;
    import com.pulumi.aws.ec2.VpcArgs;
    import com.pulumi.aws.ec2.Subnet;
    import com.pulumi.aws.ec2.SubnetArgs;
    import com.pulumi.aws.efs.MountTarget;
    import com.pulumi.aws.efs.MountTargetArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var foo = new Vpc("foo", VpcArgs.builder()
                .cidrBlock("10.0.0.0/16")
                .build());
    
            var alphaSubnet = new Subnet("alphaSubnet", SubnetArgs.builder()
                .vpcId(foo.id())
                .availabilityZone("us-west-2a")
                .cidrBlock("10.0.1.0/24")
                .build());
    
            var alpha = new MountTarget("alpha", MountTargetArgs.builder()
                .fileSystemId(fooAwsEfsFileSystem.id())
                .subnetId(alphaSubnet.id())
                .build());
    
        }
    }
    
    resources:
      alpha:
        type: aws:efs:MountTarget
        properties:
          fileSystemId: ${fooAwsEfsFileSystem.id}
          subnetId: ${alphaSubnet.id}
      foo:
        type: aws:ec2:Vpc
        properties:
          cidrBlock: 10.0.0.0/16
      alphaSubnet:
        type: aws:ec2:Subnet
        name: alpha
        properties:
          vpcId: ${foo.id}
          availabilityZone: us-west-2a
          cidrBlock: 10.0.1.0/24
    

    Create MountTarget Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new MountTarget(name: string, args: MountTargetArgs, opts?: CustomResourceOptions);
    @overload
    def MountTarget(resource_name: str,
                    args: MountTargetArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def MountTarget(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    file_system_id: Optional[str] = None,
                    subnet_id: Optional[str] = None,
                    ip_address: Optional[str] = None,
                    security_groups: Optional[Sequence[str]] = None)
    func NewMountTarget(ctx *Context, name string, args MountTargetArgs, opts ...ResourceOption) (*MountTarget, error)
    public MountTarget(string name, MountTargetArgs args, CustomResourceOptions? opts = null)
    public MountTarget(String name, MountTargetArgs args)
    public MountTarget(String name, MountTargetArgs args, CustomResourceOptions options)
    
    type: aws:efs:MountTarget
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args MountTargetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args MountTargetArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args MountTargetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MountTargetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MountTargetArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var mountTargetResource = new Aws.Efs.MountTarget("mountTargetResource", new()
    {
        FileSystemId = "string",
        SubnetId = "string",
        IpAddress = "string",
        SecurityGroups = new[]
        {
            "string",
        },
    });
    
    example, err := efs.NewMountTarget(ctx, "mountTargetResource", &efs.MountTargetArgs{
    	FileSystemId: pulumi.String("string"),
    	SubnetId:     pulumi.String("string"),
    	IpAddress:    pulumi.String("string"),
    	SecurityGroups: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var mountTargetResource = new MountTarget("mountTargetResource", MountTargetArgs.builder()
        .fileSystemId("string")
        .subnetId("string")
        .ipAddress("string")
        .securityGroups("string")
        .build());
    
    mount_target_resource = aws.efs.MountTarget("mountTargetResource",
        file_system_id="string",
        subnet_id="string",
        ip_address="string",
        security_groups=["string"])
    
    const mountTargetResource = new aws.efs.MountTarget("mountTargetResource", {
        fileSystemId: "string",
        subnetId: "string",
        ipAddress: "string",
        securityGroups: ["string"],
    });
    
    type: aws:efs:MountTarget
    properties:
        fileSystemId: string
        ipAddress: string
        securityGroups:
            - string
        subnetId: string
    

    MountTarget Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The MountTarget resource accepts the following input properties:

    FileSystemId string
    The ID of the file system for which the mount target is intended.
    SubnetId string
    The ID of the subnet to add the mount target in.
    IpAddress string
    The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
    SecurityGroups List<string>
    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.
    FileSystemId string
    The ID of the file system for which the mount target is intended.
    SubnetId string
    The ID of the subnet to add the mount target in.
    IpAddress string
    The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
    SecurityGroups []string
    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.
    fileSystemId String
    The ID of the file system for which the mount target is intended.
    subnetId String
    The ID of the subnet to add the mount target in.
    ipAddress String
    The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
    securityGroups List<String>
    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.
    fileSystemId string
    The ID of the file system for which the mount target is intended.
    subnetId string
    The ID of the subnet to add the mount target in.
    ipAddress string
    The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
    securityGroups string[]
    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.
    file_system_id str
    The ID of the file system for which the mount target is intended.
    subnet_id str
    The ID of the subnet to add the mount target in.
    ip_address str
    The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
    security_groups Sequence[str]
    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.
    fileSystemId String
    The ID of the file system for which the mount target is intended.
    subnetId String
    The ID of the subnet to add the mount target in.
    ipAddress String
    The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
    securityGroups List<String>
    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.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MountTarget resource produces the following output properties:

    AvailabilityZoneId string
    The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    AvailabilityZoneName string
    The name of the Availability Zone (AZ) that the mount target resides in.
    DnsName string
    The DNS name for the EFS file system.
    FileSystemArn string
    Amazon Resource Name of the file system.
    Id string
    The provider-assigned unique ID for this managed resource.
    MountTargetDnsName string
    The DNS name for the given subnet/AZ per documented convention.
    NetworkInterfaceId string
    The ID of the network interface that Amazon EFS created when it created the mount target.
    OwnerId string
    AWS account ID that owns the resource.
    AvailabilityZoneId string
    The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    AvailabilityZoneName string
    The name of the Availability Zone (AZ) that the mount target resides in.
    DnsName string
    The DNS name for the EFS file system.
    FileSystemArn string
    Amazon Resource Name of the file system.
    Id string
    The provider-assigned unique ID for this managed resource.
    MountTargetDnsName string
    The DNS name for the given subnet/AZ per documented convention.
    NetworkInterfaceId string
    The ID of the network interface that Amazon EFS created when it created the mount target.
    OwnerId string
    AWS account ID that owns the resource.
    availabilityZoneId String
    The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    availabilityZoneName String
    The name of the Availability Zone (AZ) that the mount target resides in.
    dnsName String
    The DNS name for the EFS file system.
    fileSystemArn String
    Amazon Resource Name of the file system.
    id String
    The provider-assigned unique ID for this managed resource.
    mountTargetDnsName String
    The DNS name for the given subnet/AZ per documented convention.
    networkInterfaceId String
    The ID of the network interface that Amazon EFS created when it created the mount target.
    ownerId String
    AWS account ID that owns the resource.
    availabilityZoneId string
    The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    availabilityZoneName string
    The name of the Availability Zone (AZ) that the mount target resides in.
    dnsName string
    The DNS name for the EFS file system.
    fileSystemArn string
    Amazon Resource Name of the file system.
    id string
    The provider-assigned unique ID for this managed resource.
    mountTargetDnsName string
    The DNS name for the given subnet/AZ per documented convention.
    networkInterfaceId string
    The ID of the network interface that Amazon EFS created when it created the mount target.
    ownerId string
    AWS account ID that owns the resource.
    availability_zone_id str
    The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    availability_zone_name str
    The name of the Availability Zone (AZ) that the mount target resides in.
    dns_name str
    The DNS name for the EFS file system.
    file_system_arn str
    Amazon Resource Name of the file system.
    id str
    The provider-assigned unique ID for this managed resource.
    mount_target_dns_name str
    The DNS name for the given subnet/AZ per documented convention.
    network_interface_id str
    The ID of the network interface that Amazon EFS created when it created the mount target.
    owner_id str
    AWS account ID that owns the resource.
    availabilityZoneId String
    The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    availabilityZoneName String
    The name of the Availability Zone (AZ) that the mount target resides in.
    dnsName String
    The DNS name for the EFS file system.
    fileSystemArn String
    Amazon Resource Name of the file system.
    id String
    The provider-assigned unique ID for this managed resource.
    mountTargetDnsName String
    The DNS name for the given subnet/AZ per documented convention.
    networkInterfaceId String
    The ID of the network interface that Amazon EFS created when it created the mount target.
    ownerId String
    AWS account ID that owns the resource.

    Look up Existing MountTarget Resource

    Get an existing MountTarget resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: MountTargetState, opts?: CustomResourceOptions): MountTarget
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            availability_zone_id: Optional[str] = None,
            availability_zone_name: Optional[str] = None,
            dns_name: Optional[str] = None,
            file_system_arn: Optional[str] = None,
            file_system_id: Optional[str] = None,
            ip_address: Optional[str] = None,
            mount_target_dns_name: Optional[str] = None,
            network_interface_id: Optional[str] = None,
            owner_id: Optional[str] = None,
            security_groups: Optional[Sequence[str]] = None,
            subnet_id: Optional[str] = None) -> MountTarget
    func GetMountTarget(ctx *Context, name string, id IDInput, state *MountTargetState, opts ...ResourceOption) (*MountTarget, error)
    public static MountTarget Get(string name, Input<string> id, MountTargetState? state, CustomResourceOptions? opts = null)
    public static MountTarget get(String name, Output<String> id, MountTargetState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AvailabilityZoneId string
    The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    AvailabilityZoneName string
    The name of the Availability Zone (AZ) that the mount target resides in.
    DnsName string
    The DNS name for the EFS file system.
    FileSystemArn string
    Amazon Resource Name of the file system.
    FileSystemId string
    The ID of the file system for which the mount target is intended.
    IpAddress string
    The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
    MountTargetDnsName string
    The DNS name for the given subnet/AZ per documented convention.
    NetworkInterfaceId string
    The ID of the network interface that Amazon EFS created when it created the mount target.
    OwnerId string
    AWS account ID that owns the resource.
    SecurityGroups List<string>
    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.
    SubnetId string
    The ID of the subnet to add the mount target in.
    AvailabilityZoneId string
    The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    AvailabilityZoneName string
    The name of the Availability Zone (AZ) that the mount target resides in.
    DnsName string
    The DNS name for the EFS file system.
    FileSystemArn string
    Amazon Resource Name of the file system.
    FileSystemId string
    The ID of the file system for which the mount target is intended.
    IpAddress string
    The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
    MountTargetDnsName string
    The DNS name for the given subnet/AZ per documented convention.
    NetworkInterfaceId string
    The ID of the network interface that Amazon EFS created when it created the mount target.
    OwnerId string
    AWS account ID that owns the resource.
    SecurityGroups []string
    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.
    SubnetId string
    The ID of the subnet to add the mount target in.
    availabilityZoneId String
    The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    availabilityZoneName String
    The name of the Availability Zone (AZ) that the mount target resides in.
    dnsName String
    The DNS name for the EFS file system.
    fileSystemArn String
    Amazon Resource Name of the file system.
    fileSystemId String
    The ID of the file system for which the mount target is intended.
    ipAddress String
    The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
    mountTargetDnsName String
    The DNS name for the given subnet/AZ per documented convention.
    networkInterfaceId String
    The ID of the network interface that Amazon EFS created when it created the mount target.
    ownerId String
    AWS account ID that owns the resource.
    securityGroups List<String>
    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.
    subnetId String
    The ID of the subnet to add the mount target in.
    availabilityZoneId string
    The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    availabilityZoneName string
    The name of the Availability Zone (AZ) that the mount target resides in.
    dnsName string
    The DNS name for the EFS file system.
    fileSystemArn string
    Amazon Resource Name of the file system.
    fileSystemId string
    The ID of the file system for which the mount target is intended.
    ipAddress string
    The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
    mountTargetDnsName string
    The DNS name for the given subnet/AZ per documented convention.
    networkInterfaceId string
    The ID of the network interface that Amazon EFS created when it created the mount target.
    ownerId string
    AWS account ID that owns the resource.
    securityGroups string[]
    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.
    subnetId string
    The ID of the subnet to add the mount target in.
    availability_zone_id str
    The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    availability_zone_name str
    The name of the Availability Zone (AZ) that the mount target resides in.
    dns_name str
    The DNS name for the EFS file system.
    file_system_arn str
    Amazon Resource Name of the file system.
    file_system_id str
    The ID of the file system for which the mount target is intended.
    ip_address str
    The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
    mount_target_dns_name str
    The DNS name for the given subnet/AZ per documented convention.
    network_interface_id str
    The ID of the network interface that Amazon EFS created when it created the mount target.
    owner_id str
    AWS account ID that owns the resource.
    security_groups Sequence[str]
    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.
    subnet_id str
    The ID of the subnet to add the mount target in.
    availabilityZoneId String
    The unique and consistent identifier of the Availability Zone (AZ) that the mount target resides in.
    availabilityZoneName String
    The name of the Availability Zone (AZ) that the mount target resides in.
    dnsName String
    The DNS name for the EFS file system.
    fileSystemArn String
    Amazon Resource Name of the file system.
    fileSystemId String
    The ID of the file system for which the mount target is intended.
    ipAddress String
    The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target.
    mountTargetDnsName String
    The DNS name for the given subnet/AZ per documented convention.
    networkInterfaceId String
    The ID of the network interface that Amazon EFS created when it created the mount target.
    ownerId String
    AWS account ID that owns the resource.
    securityGroups List<String>
    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.
    subnetId String
    The ID of the subnet to add the mount target in.

    Import

    Using pulumi import, import the EFS mount targets using the id. For example:

    $ pulumi import aws:efs/mountTarget:MountTarget alpha fsmt-52a643fb
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi