Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getGateways

This data source provides the Mse Gateways of the current Alibaba Cloud user.

NOTE: Available in v1.157.0+.

Example Usage

Basic Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ids = Output.Create(AliCloud.Mse.GetGateways.InvokeAsync(new AliCloud.Mse.GetGatewaysArgs
        {
            Ids = 
            {
                "example_id",
            },
        }));
        this.MseGatewayId1 = ids.Apply(ids => ids.Gateways?[0]?.Id);
        var nameRegex = Output.Create(AliCloud.Mse.GetGateways.InvokeAsync(new AliCloud.Mse.GetGatewaysArgs
        {
            NameRegex = "^my-Gateway",
        }));
        this.MseGatewayId2 = nameRegex.Apply(nameRegex => nameRegex.Gateways?[0]?.Id);
        var status = Output.Create(AliCloud.Mse.GetGateways.InvokeAsync(new AliCloud.Mse.GetGatewaysArgs
        {
            Status = "2",
        }));
        this.MseGatewayId3 = status.Apply(status => status.Gateways?[0]?.Id);
    }

    [Output("mseGatewayId1")]
    public Output<string> MseGatewayId1 { get; set; }
    [Output("mseGatewayId2")]
    public Output<string> MseGatewayId2 { get; set; }
    [Output("mseGatewayId3")]
    public Output<string> MseGatewayId3 { get; set; }
}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := mse.GetGateways(ctx, &mse.GetGatewaysArgs{
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("mseGatewayId1", ids.Gateways[0].Id)
		nameRegex, err := mse.GetGateways(ctx, &mse.GetGatewaysArgs{
			NameRegex: pulumi.StringRef("^my-Gateway"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("mseGatewayId2", nameRegex.Gateways[0].Id)
		status, err := mse.GetGateways(ctx, &mse.GetGatewaysArgs{
			Status: pulumi.StringRef("2"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("mseGatewayId3", status.Gateways[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.mse.MseFunctions;
import com.pulumi.alicloud.cloudstoragegateway.inputs.GetGatewaysArgs;
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 ids = MseFunctions.getGateways(GetGatewaysArgs.builder()
            .ids("example_id")
            .build());

        ctx.export("mseGatewayId1", ids.applyValue(getGatewaysResult -> getGatewaysResult.gateways()[0].id()));
        final var nameRegex = MseFunctions.getGateways(GetGatewaysArgs.builder()
            .nameRegex("^my-Gateway")
            .build());

        ctx.export("mseGatewayId2", nameRegex.applyValue(getGatewaysResult -> getGatewaysResult.gateways()[0].id()));
        final var status = MseFunctions.getGateways(GetGatewaysArgs.builder()
            .status("2")
            .build());

        ctx.export("mseGatewayId3", status.applyValue(getGatewaysResult -> getGatewaysResult.gateways()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.mse.get_gateways(ids=["example_id"])
pulumi.export("mseGatewayId1", ids.gateways[0].id)
name_regex = alicloud.mse.get_gateways(name_regex="^my-Gateway")
pulumi.export("mseGatewayId2", name_regex.gateways[0].id)
status = alicloud.mse.get_gateways(status="2")
pulumi.export("mseGatewayId3", status.gateways[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.mse.getGateways({
    ids: ["example_id"],
});
export const mseGatewayId1 = ids.then(ids => ids.gateways?[0]?.id);
const nameRegex = alicloud.mse.getGateways({
    nameRegex: "^my-Gateway",
});
export const mseGatewayId2 = nameRegex.then(nameRegex => nameRegex.gateways?[0]?.id);
const status = alicloud.mse.getGateways({
    status: "2",
});
export const mseGatewayId3 = status.then(status => status.gateways?[0]?.id);
variables:
  ids:
    Fn::Invoke:
      Function: alicloud:mse:getGateways
      Arguments:
        ids:
          - example_id
  nameRegex:
    Fn::Invoke:
      Function: alicloud:mse:getGateways
      Arguments:
        nameRegex: ^my-Gateway
  status:
    Fn::Invoke:
      Function: alicloud:mse:getGateways
      Arguments:
        status: 2
outputs:
  mseGatewayId1: ${ids.gateways[0].id}
  mseGatewayId2: ${nameRegex.gateways[0].id}
  mseGatewayId3: ${status.gateways[0].id}

Using getGateways

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getGateways(args: GetGatewaysArgs, opts?: InvokeOptions): Promise<GetGatewaysResult>
function getGatewaysOutput(args: GetGatewaysOutputArgs, opts?: InvokeOptions): Output<GetGatewaysResult>
def get_gateways(enable_details: Optional[bool] = None,
                 gateway_name: Optional[str] = None,
                 ids: Optional[Sequence[str]] = None,
                 name_regex: Optional[str] = None,
                 output_file: Optional[str] = None,
                 status: Optional[str] = None,
                 vpc_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetGatewaysResult
def get_gateways_output(enable_details: Optional[pulumi.Input[bool]] = None,
                 gateway_name: Optional[pulumi.Input[str]] = None,
                 ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 name_regex: Optional[pulumi.Input[str]] = None,
                 output_file: Optional[pulumi.Input[str]] = None,
                 status: Optional[pulumi.Input[str]] = None,
                 vpc_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetGatewaysResult]
func GetGateways(ctx *Context, args *GetGatewaysArgs, opts ...InvokeOption) (*GetGatewaysResult, error)
func GetGatewaysOutput(ctx *Context, args *GetGatewaysOutputArgs, opts ...InvokeOption) GetGatewaysResultOutput

> Note: This function is named GetGateways in the Go SDK.

public static class GetGateways 
{
    public static Task<GetGatewaysResult> InvokeAsync(GetGatewaysArgs args, InvokeOptions? opts = null)
    public static Output<GetGatewaysResult> Invoke(GetGatewaysInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetGatewaysResult> getGateways(GetGatewaysArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:mse/getGateways:getGateways
  arguments:
    # arguments dictionary

The following arguments are supported:

EnableDetails bool

Default to false. Set it to true can output more details about resource attributes.

GatewayName string

The name of the Gateway.

Ids List<string>

A list of Gateway IDs.

NameRegex string

A regex string to filter results by Gateway name.

OutputFile string
Status string

The status of the gateway.

VpcId string

The ID of the vpc.

EnableDetails bool

Default to false. Set it to true can output more details about resource attributes.

GatewayName string

The name of the Gateway.

Ids []string

A list of Gateway IDs.

NameRegex string

A regex string to filter results by Gateway name.

OutputFile string
Status string

The status of the gateway.

VpcId string

The ID of the vpc.

enableDetails Boolean

Default to false. Set it to true can output more details about resource attributes.

gatewayName String

The name of the Gateway.

ids List<String>

A list of Gateway IDs.

nameRegex String

A regex string to filter results by Gateway name.

outputFile String
status String

The status of the gateway.

vpcId String

The ID of the vpc.

enableDetails boolean

Default to false. Set it to true can output more details about resource attributes.

gatewayName string

The name of the Gateway.

ids string[]

A list of Gateway IDs.

nameRegex string

A regex string to filter results by Gateway name.

outputFile string
status string

The status of the gateway.

vpcId string

The ID of the vpc.

enable_details bool

Default to false. Set it to true can output more details about resource attributes.

gateway_name str

The name of the Gateway.

ids Sequence[str]

A list of Gateway IDs.

name_regex str

A regex string to filter results by Gateway name.

output_file str
status str

The status of the gateway.

vpc_id str

The ID of the vpc.

enableDetails Boolean

Default to false. Set it to true can output more details about resource attributes.

gatewayName String

The name of the Gateway.

ids List<String>

A list of Gateway IDs.

nameRegex String

A regex string to filter results by Gateway name.

outputFile String
status String

The status of the gateway.

vpcId String

The ID of the vpc.

getGateways Result

The following output properties are available:

Gateways List<Pulumi.AliCloud.Mse.Outputs.GetGatewaysGateway>
Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Names List<string>
EnableDetails bool
GatewayName string
NameRegex string
OutputFile string
Status string
VpcId string
Gateways []GetGatewaysGateway
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Names []string
EnableDetails bool
GatewayName string
NameRegex string
OutputFile string
Status string
VpcId string
gateways List<GetGatewaysGateway>
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
names List<String>
enableDetails Boolean
gatewayName String
nameRegex String
outputFile String
status String
vpcId String
gateways GetGatewaysGateway[]
id string

The provider-assigned unique ID for this managed resource.

ids string[]
names string[]
enableDetails boolean
gatewayName string
nameRegex string
outputFile string
status string
vpcId string
gateways Sequence[GetGatewaysGateway]
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
names Sequence[str]
enable_details bool
gateway_name str
name_regex str
output_file str
status str
vpc_id str
gateways List<Property Map>
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
names List<String>
enableDetails Boolean
gatewayName String
nameRegex String
outputFile String
status String
vpcId String

Supporting Types

GetGatewaysGateway

BackupVswitchId string

The backup vswitch id.

GatewayName string

The name of the Gateway.

GatewayUniqueId string

Gateway unique identification.

Id string

The ID of the Gateway.

PaymentType string

The payment type of the resource.

Replica string

Number of Gateway Nodes.

SlbLists List<Pulumi.AliCloud.Mse.Inputs.GetGatewaysGatewaySlbList>

A list of gateway Slb.

Spec string

Gateway Node Specifications.

Status string

The status of the gateway.

VpcId string

The ID of the vpc.

VswitchId string

The ID of the vswitch.

BackupVswitchId string

The backup vswitch id.

GatewayName string

The name of the Gateway.

GatewayUniqueId string

Gateway unique identification.

Id string

The ID of the Gateway.

PaymentType string

The payment type of the resource.

Replica string

Number of Gateway Nodes.

SlbLists []GetGatewaysGatewaySlbList

A list of gateway Slb.

Spec string

Gateway Node Specifications.

Status string

The status of the gateway.

VpcId string

The ID of the vpc.

VswitchId string

The ID of the vswitch.

backupVswitchId String

The backup vswitch id.

gatewayName String

The name of the Gateway.

gatewayUniqueId String

Gateway unique identification.

id String

The ID of the Gateway.

paymentType String

The payment type of the resource.

replica String

Number of Gateway Nodes.

slbLists List<GetGatewaysGatewaySlbList>

A list of gateway Slb.

spec String

Gateway Node Specifications.

status String

The status of the gateway.

vpcId String

The ID of the vpc.

vswitchId String

The ID of the vswitch.

backupVswitchId string

The backup vswitch id.

gatewayName string

The name of the Gateway.

gatewayUniqueId string

Gateway unique identification.

id string

The ID of the Gateway.

paymentType string

The payment type of the resource.

replica string

Number of Gateway Nodes.

slbLists GetGatewaysGatewaySlbList[]

A list of gateway Slb.

spec string

Gateway Node Specifications.

status string

The status of the gateway.

vpcId string

The ID of the vpc.

vswitchId string

The ID of the vswitch.

backup_vswitch_id str

The backup vswitch id.

gateway_name str

The name of the Gateway.

gateway_unique_id str

Gateway unique identification.

id str

The ID of the Gateway.

payment_type str

The payment type of the resource.

replica str

Number of Gateway Nodes.

slb_lists Sequence[GetGatewaysGatewaySlbList]

A list of gateway Slb.

spec str

Gateway Node Specifications.

status str

The status of the gateway.

vpc_id str

The ID of the vpc.

vswitch_id str

The ID of the vswitch.

backupVswitchId String

The backup vswitch id.

gatewayName String

The name of the Gateway.

gatewayUniqueId String

Gateway unique identification.

id String

The ID of the Gateway.

paymentType String

The payment type of the resource.

replica String

Number of Gateway Nodes.

slbLists List<Property Map>

A list of gateway Slb.

spec String

Gateway Node Specifications.

status String

The status of the gateway.

vpcId String

The ID of the vpc.

vswitchId String

The ID of the vswitch.

GetGatewaysGatewaySlbList

AssociateId string

The associate id.

GatewaySlbMode string

The Mode of the gateway slb.

GatewaySlbStatus string

The Status of the gateway slb.

GmtCreate string

The creation time of the gateway slb.

SlbId string

The ID of the gateway slb.

SlbIp string

The ip of the gateway slb.

SlbPort string

The port of the gateway slb.

Type string

The type of the gateway slb.

AssociateId string

The associate id.

GatewaySlbMode string

The Mode of the gateway slb.

GatewaySlbStatus string

The Status of the gateway slb.

GmtCreate string

The creation time of the gateway slb.

SlbId string

The ID of the gateway slb.

SlbIp string

The ip of the gateway slb.

SlbPort string

The port of the gateway slb.

Type string

The type of the gateway slb.

associateId String

The associate id.

gatewaySlbMode String

The Mode of the gateway slb.

gatewaySlbStatus String

The Status of the gateway slb.

gmtCreate String

The creation time of the gateway slb.

slbId String

The ID of the gateway slb.

slbIp String

The ip of the gateway slb.

slbPort String

The port of the gateway slb.

type String

The type of the gateway slb.

associateId string

The associate id.

gatewaySlbMode string

The Mode of the gateway slb.

gatewaySlbStatus string

The Status of the gateway slb.

gmtCreate string

The creation time of the gateway slb.

slbId string

The ID of the gateway slb.

slbIp string

The ip of the gateway slb.

slbPort string

The port of the gateway slb.

type string

The type of the gateway slb.

associate_id str

The associate id.

gateway_slb_mode str

The Mode of the gateway slb.

gateway_slb_status str

The Status of the gateway slb.

gmt_create str

The creation time of the gateway slb.

slb_id str

The ID of the gateway slb.

slb_ip str

The ip of the gateway slb.

slb_port str

The port of the gateway slb.

type str

The type of the gateway slb.

associateId String

The associate id.

gatewaySlbMode String

The Mode of the gateway slb.

gatewaySlbStatus String

The Status of the gateway slb.

gmtCreate String

The creation time of the gateway slb.

slbId String

The ID of the gateway slb.

slbIp String

The ip of the gateway slb.

slbPort String

The port of the gateway slb.

type String

The type of the gateway slb.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.