1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cloudstoragegateway
  5. GatewaySmbUser
Alibaba Cloud v3.38.0 published on Friday, Jun 2, 2023 by Pulumi

alicloud.cloudstoragegateway.GatewaySmbUser

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.38.0 published on Friday, Jun 2, 2023 by Pulumi

    Provides a Cloud Storage Gateway Gateway SMB User resource.

    For information about Cloud Storage Gateway Gateway SMB User and how to use it, see What is Gateway SMB User.

    NOTE: Available in v1.142.0+.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var defaultNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
        {
            NameRegex = "default-NODELETING",
        });
    
        var defaultSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
        {
            VpcId = defaultNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
        });
    
        var example = new AliCloud.CloudStorageGateway.StorageBundle("example", new()
        {
            StorageBundleName = "example_value",
        });
    
        var defaultGateway = new AliCloud.CloudStorageGateway.Gateway("defaultGateway", new()
        {
            Description = "tf-acctestDesalone",
            GatewayClass = "Standard",
            Type = "File",
            PaymentType = "PayAsYouGo",
            VswitchId = defaultSwitches.Apply(getSwitchesResult => getSwitchesResult.Ids[0]),
            ReleaseAfterExpiration = false,
            PublicNetworkBandwidth = 40,
            StorageBundleId = example.Id,
            Location = "Cloud",
            GatewayName = "example_value",
        });
    
        var defaultGatewaySmbUser = new AliCloud.CloudStorageGateway.GatewaySmbUser("defaultGatewaySmbUser", new()
        {
            Username = "your_username",
            Password = "password",
            GatewayId = defaultGateway.Id,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudstoragegateway"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		defaultNetworks, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
    			NameRegex: pulumi.StringRef("default-NODELETING"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultSwitches, err := vpc.GetSwitches(ctx, &vpc.GetSwitchesArgs{
    			VpcId: pulumi.StringRef(defaultNetworks.Ids[0]),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		example, err := cloudstoragegateway.NewStorageBundle(ctx, "example", &cloudstoragegateway.StorageBundleArgs{
    			StorageBundleName: pulumi.String("example_value"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultGateway, err := cloudstoragegateway.NewGateway(ctx, "defaultGateway", &cloudstoragegateway.GatewayArgs{
    			Description:            pulumi.String("tf-acctestDesalone"),
    			GatewayClass:           pulumi.String("Standard"),
    			Type:                   pulumi.String("File"),
    			PaymentType:            pulumi.String("PayAsYouGo"),
    			VswitchId:              *pulumi.String(defaultSwitches.Ids[0]),
    			ReleaseAfterExpiration: pulumi.Bool(false),
    			PublicNetworkBandwidth: pulumi.Int(40),
    			StorageBundleId:        example.ID(),
    			Location:               pulumi.String("Cloud"),
    			GatewayName:            pulumi.String("example_value"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudstoragegateway.NewGatewaySmbUser(ctx, "defaultGatewaySmbUser", &cloudstoragegateway.GatewaySmbUserArgs{
    			Username:  pulumi.String("your_username"),
    			Password:  pulumi.String("password"),
    			GatewayId: defaultGateway.ID(),
    		})
    		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.vpc.VpcFunctions;
    import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
    import com.pulumi.alicloud.vpc.inputs.GetSwitchesArgs;
    import com.pulumi.alicloud.cloudstoragegateway.StorageBundle;
    import com.pulumi.alicloud.cloudstoragegateway.StorageBundleArgs;
    import com.pulumi.alicloud.cloudstoragegateway.Gateway;
    import com.pulumi.alicloud.cloudstoragegateway.GatewayArgs;
    import com.pulumi.alicloud.cloudstoragegateway.GatewaySmbUser;
    import com.pulumi.alicloud.cloudstoragegateway.GatewaySmbUserArgs;
    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) {
            final var defaultNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
                .nameRegex("default-NODELETING")
                .build());
    
            final var defaultSwitches = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
                .vpcId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
                .build());
    
            var example = new StorageBundle("example", StorageBundleArgs.builder()        
                .storageBundleName("example_value")
                .build());
    
            var defaultGateway = new Gateway("defaultGateway", GatewayArgs.builder()        
                .description("tf-acctestDesalone")
                .gatewayClass("Standard")
                .type("File")
                .paymentType("PayAsYouGo")
                .vswitchId(defaultSwitches.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]))
                .releaseAfterExpiration(false)
                .publicNetworkBandwidth(40)
                .storageBundleId(example.id())
                .location("Cloud")
                .gatewayName("example_value")
                .build());
    
            var defaultGatewaySmbUser = new GatewaySmbUser("defaultGatewaySmbUser", GatewaySmbUserArgs.builder()        
                .username("your_username")
                .password("password")
                .gatewayId(defaultGateway.id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default_networks = alicloud.vpc.get_networks(name_regex="default-NODELETING")
    default_switches = alicloud.vpc.get_switches(vpc_id=default_networks.ids[0])
    example = alicloud.cloudstoragegateway.StorageBundle("example", storage_bundle_name="example_value")
    default_gateway = alicloud.cloudstoragegateway.Gateway("defaultGateway",
        description="tf-acctestDesalone",
        gateway_class="Standard",
        type="File",
        payment_type="PayAsYouGo",
        vswitch_id=default_switches.ids[0],
        release_after_expiration=False,
        public_network_bandwidth=40,
        storage_bundle_id=example.id,
        location="Cloud",
        gateway_name="example_value")
    default_gateway_smb_user = alicloud.cloudstoragegateway.GatewaySmbUser("defaultGatewaySmbUser",
        username="your_username",
        password="password",
        gateway_id=default_gateway.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const defaultNetworks = alicloud.vpc.getNetworks({
        nameRegex: "default-NODELETING",
    });
    const defaultSwitches = defaultNetworks.then(defaultNetworks => alicloud.vpc.getSwitches({
        vpcId: defaultNetworks.ids?.[0],
    }));
    const example = new alicloud.cloudstoragegateway.StorageBundle("example", {storageBundleName: "example_value"});
    const defaultGateway = new alicloud.cloudstoragegateway.Gateway("defaultGateway", {
        description: "tf-acctestDesalone",
        gatewayClass: "Standard",
        type: "File",
        paymentType: "PayAsYouGo",
        vswitchId: defaultSwitches.then(defaultSwitches => defaultSwitches.ids?.[0]),
        releaseAfterExpiration: false,
        publicNetworkBandwidth: 40,
        storageBundleId: example.id,
        location: "Cloud",
        gatewayName: "example_value",
    });
    const defaultGatewaySmbUser = new alicloud.cloudstoragegateway.GatewaySmbUser("defaultGatewaySmbUser", {
        username: "your_username",
        password: "password",
        gatewayId: defaultGateway.id,
    });
    
    resources:
      example:
        type: alicloud:cloudstoragegateway:StorageBundle
        properties:
          storageBundleName: example_value
      defaultGateway:
        type: alicloud:cloudstoragegateway:Gateway
        properties:
          description: tf-acctestDesalone
          gatewayClass: Standard
          type: File
          paymentType: PayAsYouGo
          vswitchId: ${defaultSwitches.ids[0]}
          releaseAfterExpiration: false
          publicNetworkBandwidth: 40
          storageBundleId: ${example.id}
          location: Cloud
          gatewayName: example_value
      defaultGatewaySmbUser:
        type: alicloud:cloudstoragegateway:GatewaySmbUser
        properties:
          username: your_username
          password: password
          gatewayId: ${defaultGateway.id}
    variables:
      defaultNetworks:
        fn::invoke:
          Function: alicloud:vpc:getNetworks
          Arguments:
            nameRegex: default-NODELETING
      defaultSwitches:
        fn::invoke:
          Function: alicloud:vpc:getSwitches
          Arguments:
            vpcId: ${defaultNetworks.ids[0]}
    

    Create GatewaySmbUser Resource

    new GatewaySmbUser(name: string, args: GatewaySmbUserArgs, opts?: CustomResourceOptions);
    @overload
    def GatewaySmbUser(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       gateway_id: Optional[str] = None,
                       password: Optional[str] = None,
                       username: Optional[str] = None)
    @overload
    def GatewaySmbUser(resource_name: str,
                       args: GatewaySmbUserArgs,
                       opts: Optional[ResourceOptions] = None)
    func NewGatewaySmbUser(ctx *Context, name string, args GatewaySmbUserArgs, opts ...ResourceOption) (*GatewaySmbUser, error)
    public GatewaySmbUser(string name, GatewaySmbUserArgs args, CustomResourceOptions? opts = null)
    public GatewaySmbUser(String name, GatewaySmbUserArgs args)
    public GatewaySmbUser(String name, GatewaySmbUserArgs args, CustomResourceOptions options)
    
    type: alicloud:cloudstoragegateway:GatewaySmbUser
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args GatewaySmbUserArgs
    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 GatewaySmbUserArgs
    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 GatewaySmbUserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GatewaySmbUserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GatewaySmbUserArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    GatewaySmbUser 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 GatewaySmbUser resource accepts the following input properties:

    GatewayId string

    The Gateway ID of the Gateway SMB User.

    Password string

    The password of the Gateway SMB User.

    Username string

    The username of the Gateway SMB User.

    GatewayId string

    The Gateway ID of the Gateway SMB User.

    Password string

    The password of the Gateway SMB User.

    Username string

    The username of the Gateway SMB User.

    gatewayId String

    The Gateway ID of the Gateway SMB User.

    password String

    The password of the Gateway SMB User.

    username String

    The username of the Gateway SMB User.

    gatewayId string

    The Gateway ID of the Gateway SMB User.

    password string

    The password of the Gateway SMB User.

    username string

    The username of the Gateway SMB User.

    gateway_id str

    The Gateway ID of the Gateway SMB User.

    password str

    The password of the Gateway SMB User.

    username str

    The username of the Gateway SMB User.

    gatewayId String

    The Gateway ID of the Gateway SMB User.

    password String

    The password of the Gateway SMB User.

    username String

    The username of the Gateway SMB User.

    Outputs

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

    Id string

    The provider-assigned unique ID for this managed resource.

    Id string

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    id string

    The provider-assigned unique ID for this managed resource.

    id str

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    Look up Existing GatewaySmbUser Resource

    Get an existing GatewaySmbUser 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?: GatewaySmbUserState, opts?: CustomResourceOptions): GatewaySmbUser
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            gateway_id: Optional[str] = None,
            password: Optional[str] = None,
            username: Optional[str] = None) -> GatewaySmbUser
    func GetGatewaySmbUser(ctx *Context, name string, id IDInput, state *GatewaySmbUserState, opts ...ResourceOption) (*GatewaySmbUser, error)
    public static GatewaySmbUser Get(string name, Input<string> id, GatewaySmbUserState? state, CustomResourceOptions? opts = null)
    public static GatewaySmbUser get(String name, Output<String> id, GatewaySmbUserState 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:
    GatewayId string

    The Gateway ID of the Gateway SMB User.

    Password string

    The password of the Gateway SMB User.

    Username string

    The username of the Gateway SMB User.

    GatewayId string

    The Gateway ID of the Gateway SMB User.

    Password string

    The password of the Gateway SMB User.

    Username string

    The username of the Gateway SMB User.

    gatewayId String

    The Gateway ID of the Gateway SMB User.

    password String

    The password of the Gateway SMB User.

    username String

    The username of the Gateway SMB User.

    gatewayId string

    The Gateway ID of the Gateway SMB User.

    password string

    The password of the Gateway SMB User.

    username string

    The username of the Gateway SMB User.

    gateway_id str

    The Gateway ID of the Gateway SMB User.

    password str

    The password of the Gateway SMB User.

    username str

    The username of the Gateway SMB User.

    gatewayId String

    The Gateway ID of the Gateway SMB User.

    password String

    The password of the Gateway SMB User.

    username String

    The username of the Gateway SMB User.

    Import

    Cloud Storage Gateway Gateway SMB User can be imported using the id, e.g.

     $ pulumi import alicloud:cloudstoragegateway/gatewaySmbUser:GatewaySmbUser example <gateway_id>:<username>
    

    Package Details

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

    This Pulumi package is based on the alicloud Terraform Provider.

    alicloud logo
    Alibaba Cloud v3.38.0 published on Friday, Jun 2, 2023 by Pulumi