Show / Hide Table of Contents

Class GetSwitches

Inheritance
System.Object
GetSwitches
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.AliCloud.Vpc
Assembly: Pulumi.AliCloud.dll
Syntax
public static class GetSwitches

Methods

View Source

InvokeAsync(GetSwitchesArgs, InvokeOptions)

This data source provides a list of VSwitches owned by an Alibaba Cloud account.

{{% examples %}}

Example Usage

{{% example %}}

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
public MyStack()
{
    var config = new Config();
    var name = config.Get("name") ?? "vswitchDatasourceName";
    var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync());
    var vpc = new AliCloud.Vpc.Network("vpc", new AliCloud.Vpc.NetworkArgs
    {
        CidrBlock = "172.16.0.0/16",
    });
    var vswitch = new AliCloud.Vpc.Switch("vswitch", new AliCloud.Vpc.SwitchArgs
    {
        AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
        CidrBlock = "172.16.0.0/24",
        VpcId = vpc.Id,
    });
    var defaultSwitches = vswitch.Name.Apply(name => AliCloud.Vpc.GetSwitches.InvokeAsync(new AliCloud.Vpc.GetSwitchesArgs
    {
        NameRegex = name,
    }));
}

}

{{% /example %}} {{% /examples %}}

Declaration
public static Task<GetSwitchesResult> InvokeAsync(GetSwitchesArgs args = null, InvokeOptions options = null)
Parameters
Type Name Description
GetSwitchesArgs args
InvokeOptions options
Returns
Type Description
System.Threading.Tasks.Task<GetSwitchesResult>
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.