alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.nas.MountTarget

Provides a NAS Mount Target resource. For information about NAS Mount Target and how to use it, see Manage NAS Mount Targets.

NOTE: Available in v1.34.0+.

NOTE: Currently this resource support create a mount point in a classic network only when current region is China mainland regions.

NOTE: You must grant NAS with specific RAM permissions when creating a classic mount targets, and it only can be achieved by creating a classic mount target mannually. See Add a mount point and Why do I need RAM permissions to create a mount point in a classic network.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var exampleFileSystem = new AliCloud.Nas.FileSystem("exampleFileSystem", new()
    {
        ProtocolType = "NFS",
        StorageType = "Performance",
        Description = "test file system",
    });

    var exampleAccessGroup = new AliCloud.Nas.AccessGroup("exampleAccessGroup", new()
    {
        AccessGroupName = "test_name",
        AccessGroupType = "Classic",
        Description = "test access group",
    });

    var exampleMountTarget = new AliCloud.Nas.MountTarget("exampleMountTarget", new()
    {
        FileSystemId = exampleFileSystem.Id,
        AccessGroupName = exampleAccessGroup.AccessGroupName,
    });

});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/nas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleFileSystem, err := nas.NewFileSystem(ctx, "exampleFileSystem", &nas.FileSystemArgs{
			ProtocolType: pulumi.String("NFS"),
			StorageType:  pulumi.String("Performance"),
			Description:  pulumi.String("test file system"),
		})
		if err != nil {
			return err
		}
		exampleAccessGroup, err := nas.NewAccessGroup(ctx, "exampleAccessGroup", &nas.AccessGroupArgs{
			AccessGroupName: pulumi.String("test_name"),
			AccessGroupType: pulumi.String("Classic"),
			Description:     pulumi.String("test access group"),
		})
		if err != nil {
			return err
		}
		_, err = nas.NewMountTarget(ctx, "exampleMountTarget", &nas.MountTargetArgs{
			FileSystemId:    exampleFileSystem.ID(),
			AccessGroupName: exampleAccessGroup.AccessGroupName,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.nas.FileSystem;
import com.pulumi.alicloud.nas.FileSystemArgs;
import com.pulumi.alicloud.nas.AccessGroup;
import com.pulumi.alicloud.nas.AccessGroupArgs;
import com.pulumi.alicloud.nas.MountTarget;
import com.pulumi.alicloud.nas.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 exampleFileSystem = new FileSystem("exampleFileSystem", FileSystemArgs.builder()        
            .protocolType("NFS")
            .storageType("Performance")
            .description("test file system")
            .build());

        var exampleAccessGroup = new AccessGroup("exampleAccessGroup", AccessGroupArgs.builder()        
            .accessGroupName("test_name")
            .accessGroupType("Classic")
            .description("test access group")
            .build());

        var exampleMountTarget = new MountTarget("exampleMountTarget", MountTargetArgs.builder()        
            .fileSystemId(exampleFileSystem.id())
            .accessGroupName(exampleAccessGroup.accessGroupName())
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

example_file_system = alicloud.nas.FileSystem("exampleFileSystem",
    protocol_type="NFS",
    storage_type="Performance",
    description="test file system")
example_access_group = alicloud.nas.AccessGroup("exampleAccessGroup",
    access_group_name="test_name",
    access_group_type="Classic",
    description="test access group")
example_mount_target = alicloud.nas.MountTarget("exampleMountTarget",
    file_system_id=example_file_system.id,
    access_group_name=example_access_group.access_group_name)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const exampleFileSystem = new alicloud.nas.FileSystem("exampleFileSystem", {
    protocolType: "NFS",
    storageType: "Performance",
    description: "test file system",
});
const exampleAccessGroup = new alicloud.nas.AccessGroup("exampleAccessGroup", {
    accessGroupName: "test_name",
    accessGroupType: "Classic",
    description: "test access group",
});
const exampleMountTarget = new alicloud.nas.MountTarget("exampleMountTarget", {
    fileSystemId: exampleFileSystem.id,
    accessGroupName: exampleAccessGroup.accessGroupName,
});
resources:
  exampleFileSystem:
    type: alicloud:nas:FileSystem
    properties:
      protocolType: NFS
      storageType: Performance
      description: test file system
  exampleAccessGroup:
    type: alicloud:nas:AccessGroup
    properties:
      accessGroupName: test_name
      accessGroupType: Classic
      description: test access group
  exampleMountTarget:
    type: alicloud:nas:MountTarget
    properties:
      fileSystemId: ${exampleFileSystem.id}
      accessGroupName: ${exampleAccessGroup.accessGroupName}

Create MountTarget Resource

new MountTarget(name: string, args: MountTargetArgs, opts?: CustomResourceOptions);
@overload
def MountTarget(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                access_group_name: Optional[str] = None,
                file_system_id: Optional[str] = None,
                security_group_id: Optional[str] = None,
                status: Optional[str] = None,
                vswitch_id: Optional[str] = None)
@overload
def MountTarget(resource_name: str,
                args: MountTargetArgs,
                opts: Optional[ResourceOptions] = 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: alicloud:nas:MountTarget
properties: # The arguments to resource properties.
options: # 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.
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.

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

The MountTarget resource accepts the following input properties:

FileSystemId string

The ID of the file system.

AccessGroupName string

The name of the permission group that applies to the mount target.

SecurityGroupId string

The ID of security group.

Status string

Whether the MountTarget is active. The status of the mount target. Valid values: Active and Inactive, Default value is Active. Before you mount a file system, make sure that the mount target is in the Active state.

VswitchId string

The ID of the VSwitch in the VPC where the mount target resides.

FileSystemId string

The ID of the file system.

AccessGroupName string

The name of the permission group that applies to the mount target.

SecurityGroupId string

The ID of security group.

Status string

Whether the MountTarget is active. The status of the mount target. Valid values: Active and Inactive, Default value is Active. Before you mount a file system, make sure that the mount target is in the Active state.

VswitchId string

The ID of the VSwitch in the VPC where the mount target resides.

fileSystemId String

The ID of the file system.

accessGroupName String

The name of the permission group that applies to the mount target.

securityGroupId String

The ID of security group.

status String

Whether the MountTarget is active. The status of the mount target. Valid values: Active and Inactive, Default value is Active. Before you mount a file system, make sure that the mount target is in the Active state.

vswitchId String

The ID of the VSwitch in the VPC where the mount target resides.

fileSystemId string

The ID of the file system.

accessGroupName string

The name of the permission group that applies to the mount target.

securityGroupId string

The ID of security group.

status string

Whether the MountTarget is active. The status of the mount target. Valid values: Active and Inactive, Default value is Active. Before you mount a file system, make sure that the mount target is in the Active state.

vswitchId string

The ID of the VSwitch in the VPC where the mount target resides.

file_system_id str

The ID of the file system.

access_group_name str

The name of the permission group that applies to the mount target.

security_group_id str

The ID of security group.

status str

Whether the MountTarget is active. The status of the mount target. Valid values: Active and Inactive, Default value is Active. Before you mount a file system, make sure that the mount target is in the Active state.

vswitch_id str

The ID of the VSwitch in the VPC where the mount target resides.

fileSystemId String

The ID of the file system.

accessGroupName String

The name of the permission group that applies to the mount target.

securityGroupId String

The ID of security group.

status String

Whether the MountTarget is active. The status of the mount target. Valid values: Active and Inactive, Default value is Active. Before you mount a file system, make sure that the mount target is in the Active state.

vswitchId String

The ID of the VSwitch in the VPC where the mount target resides.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

MountTargetDomain string

The IPv4 domain name of the mount target. NOTE: Available in v1.161.0+.

Id string

The provider-assigned unique ID for this managed resource.

MountTargetDomain string

The IPv4 domain name of the mount target. NOTE: Available in v1.161.0+.

id String

The provider-assigned unique ID for this managed resource.

mountTargetDomain String

The IPv4 domain name of the mount target. NOTE: Available in v1.161.0+.

id string

The provider-assigned unique ID for this managed resource.

mountTargetDomain string

The IPv4 domain name of the mount target. NOTE: Available in v1.161.0+.

id str

The provider-assigned unique ID for this managed resource.

mount_target_domain str

The IPv4 domain name of the mount target. NOTE: Available in v1.161.0+.

id String

The provider-assigned unique ID for this managed resource.

mountTargetDomain String

The IPv4 domain name of the mount target. NOTE: Available in v1.161.0+.

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,
        access_group_name: Optional[str] = None,
        file_system_id: Optional[str] = None,
        mount_target_domain: Optional[str] = None,
        security_group_id: Optional[str] = None,
        status: Optional[str] = None,
        vswitch_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:
AccessGroupName string

The name of the permission group that applies to the mount target.

FileSystemId string

The ID of the file system.

MountTargetDomain string

The IPv4 domain name of the mount target. NOTE: Available in v1.161.0+.

SecurityGroupId string

The ID of security group.

Status string

Whether the MountTarget is active. The status of the mount target. Valid values: Active and Inactive, Default value is Active. Before you mount a file system, make sure that the mount target is in the Active state.

VswitchId string

The ID of the VSwitch in the VPC where the mount target resides.

AccessGroupName string

The name of the permission group that applies to the mount target.

FileSystemId string

The ID of the file system.

MountTargetDomain string

The IPv4 domain name of the mount target. NOTE: Available in v1.161.0+.

SecurityGroupId string

The ID of security group.

Status string

Whether the MountTarget is active. The status of the mount target. Valid values: Active and Inactive, Default value is Active. Before you mount a file system, make sure that the mount target is in the Active state.

VswitchId string

The ID of the VSwitch in the VPC where the mount target resides.

accessGroupName String

The name of the permission group that applies to the mount target.

fileSystemId String

The ID of the file system.

mountTargetDomain String

The IPv4 domain name of the mount target. NOTE: Available in v1.161.0+.

securityGroupId String

The ID of security group.

status String

Whether the MountTarget is active. The status of the mount target. Valid values: Active and Inactive, Default value is Active. Before you mount a file system, make sure that the mount target is in the Active state.

vswitchId String

The ID of the VSwitch in the VPC where the mount target resides.

accessGroupName string

The name of the permission group that applies to the mount target.

fileSystemId string

The ID of the file system.

mountTargetDomain string

The IPv4 domain name of the mount target. NOTE: Available in v1.161.0+.

securityGroupId string

The ID of security group.

status string

Whether the MountTarget is active. The status of the mount target. Valid values: Active and Inactive, Default value is Active. Before you mount a file system, make sure that the mount target is in the Active state.

vswitchId string

The ID of the VSwitch in the VPC where the mount target resides.

access_group_name str

The name of the permission group that applies to the mount target.

file_system_id str

The ID of the file system.

mount_target_domain str

The IPv4 domain name of the mount target. NOTE: Available in v1.161.0+.

security_group_id str

The ID of security group.

status str

Whether the MountTarget is active. The status of the mount target. Valid values: Active and Inactive, Default value is Active. Before you mount a file system, make sure that the mount target is in the Active state.

vswitch_id str

The ID of the VSwitch in the VPC where the mount target resides.

accessGroupName String

The name of the permission group that applies to the mount target.

fileSystemId String

The ID of the file system.

mountTargetDomain String

The IPv4 domain name of the mount target. NOTE: Available in v1.161.0+.

securityGroupId String

The ID of security group.

status String

Whether the MountTarget is active. The status of the mount target. Valid values: Active and Inactive, Default value is Active. Before you mount a file system, make sure that the mount target is in the Active state.

vswitchId String

The ID of the VSwitch in the VPC where the mount target resides.

Import

NAS MountTarget

can be imported using the id, e.g.

 $ pulumi import alicloud:nas/mountTarget:MountTarget foo 192094b415:192094b415-luw38.cn-beijing.nas.aliyuncs.com

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.