1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. mse
  5. getGateways
Alibaba Cloud v3.56.0 published on Friday, May 31, 2024 by Pulumi

alicloud.mse.getGateways

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.56.0 published on Friday, May 31, 2024 by Pulumi

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

    NOTE: Available in v1.157.0+.

    Example Usage

    Basic Usage

    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);
    
    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)
    
    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
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Mse.GetGateways.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var nameRegex = AliCloud.Mse.GetGateways.Invoke(new()
        {
            NameRegex = "^my-Gateway",
        });
    
        var status = AliCloud.Mse.GetGateways.Invoke(new()
        {
            Status = "2",
        });
    
        return new Dictionary<string, object?>
        {
            ["mseGatewayId1"] = ids.Apply(getGatewaysResult => getGatewaysResult.Gateways[0]?.Id),
            ["mseGatewayId2"] = nameRegex.Apply(getGatewaysResult => getGatewaysResult.Gateways[0]?.Id),
            ["mseGatewayId3"] = status.Apply(getGatewaysResult => getGatewaysResult.Gateways[0]?.Id),
        };
    });
    
    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.mse.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()));
        }
    }
    
    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
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the gateway. Valid values: 0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 12, 13.
    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
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the gateway. Valid values: 0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 12, 13.
    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
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the gateway. Valid values: 0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 12, 13.
    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
    File name where to save data source results (after running pulumi preview).
    status string
    The status of the gateway. Valid values: 0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 12, 13.
    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
    File name where to save data source results (after running pulumi preview).
    status str
    The status of the gateway. Valid values: 0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 12, 13.
    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
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the gateway. Valid values: 0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 12, 13.
    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
    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.56.0 published on Friday, May 31, 2024 by Pulumi