Alibaba Cloud

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

Gateway

Provides a Microservice Engine (MSE) Gateway resource.

For information about Microservice Engine (MSE) Gateway and how to use it, see What is Gateway.

NOTE: Available in v1.157.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
        {
            AvailableResourceCreation = "VSwitch",
        }));
        var defaultNetworks = Output.Create(AliCloud.Vpc.GetNetworks.InvokeAsync(new AliCloud.Vpc.GetNetworksArgs
        {
            NameRegex = "default-NODELETING",
        }));
        var defaultSwitches = Output.Tuple(defaultNetworks, defaultZones).Apply(values =>
        {
            var defaultNetworks = values.Item1;
            var defaultZones = values.Item2;
            return Output.Create(AliCloud.Vpc.GetSwitches.InvokeAsync(new AliCloud.Vpc.GetSwitchesArgs
            {
                VpcId = defaultNetworks.Ids?[0],
                ZoneId = defaultZones.Zones?[0]?.Id,
            }));
        });
        var example = new AliCloud.Mse.Gateway("example", new AliCloud.Mse.GatewayArgs
        {
            GatewayName = "example_value",
            Replica = 2,
            Spec = "MSE_GTW_2_4_200_c",
            VswitchId = defaultSwitches.Apply(defaultSwitches => defaultSwitches.Ids?[0]),
            BackupVswitchId = defaultSwitches.Apply(defaultSwitches => defaultSwitches.Ids?[1]),
            VpcId = defaultNetworks.Apply(defaultNetworks => defaultNetworks.Ids?[0]),
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mse"
	"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 {
		defaultZones, err := alicloud.GetZones(ctx, &GetZonesArgs{
			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
		}, nil)
		if err != nil {
			return err
		}
		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]),
			ZoneId: pulumi.StringRef(defaultZones.Zones[0].Id),
		}, nil)
		if err != nil {
			return err
		}
		_, err = mse.NewGateway(ctx, "example", &mse.GatewayArgs{
			GatewayName:     pulumi.String("example_value"),
			Replica:         pulumi.Int(2),
			Spec:            pulumi.String("MSE_GTW_2_4_200_c"),
			VswitchId:       pulumi.String(defaultSwitches.Ids[0]),
			BackupVswitchId: pulumi.String(defaultSwitches.Ids[1]),
			VpcId:           pulumi.String(defaultNetworks.Ids[0]),
		})
		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.AlicloudFunctions;
import com.pulumi.alicloud.adb.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.cloudconnect.inputs.GetNetworksArgs;
import com.pulumi.alicloud.vpc.inputs.GetSwitchesArgs;
import com.pulumi.alicloud.mse.Gateway;
import com.pulumi.alicloud.mse.GatewayArgs;
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 defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
            .availableResourceCreation("VSwitch")
            .build());

        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]))
            .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
            .build());

        var example = new Gateway("example", GatewayArgs.builder()        
            .gatewayName("example_value")
            .replica(2)
            .spec("MSE_GTW_2_4_200_c")
            .vswitchId(defaultSwitches.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]))
            .backupVswitchId(defaultSwitches.applyValue(getSwitchesResult -> getSwitchesResult.ids()[1]))
            .vpcId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_zones = alicloud.get_zones(available_resource_creation="VSwitch")
default_networks = alicloud.vpc.get_networks(name_regex="default-NODELETING")
default_switches = alicloud.vpc.get_switches(vpc_id=default_networks.ids[0],
    zone_id=default_zones.zones[0].id)
example = alicloud.mse.Gateway("example",
    gateway_name="example_value",
    replica=2,
    spec="MSE_GTW_2_4_200_c",
    vswitch_id=default_switches.ids[0],
    backup_vswitch_id=default_switches.ids[1],
    vpc_id=default_networks.ids[0])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultZones = alicloud.getZones({
    availableResourceCreation: "VSwitch",
});
const defaultNetworks = alicloud.vpc.getNetworks({
    nameRegex: "default-NODELETING",
});
const defaultSwitches = Promise.all([defaultNetworks, defaultZones]).then(([defaultNetworks, defaultZones]) => alicloud.vpc.getSwitches({
    vpcId: defaultNetworks.ids?[0],
    zoneId: defaultZones.zones?[0]?.id,
}));
const example = new alicloud.mse.Gateway("example", {
    gatewayName: "example_value",
    replica: 2,
    spec: "MSE_GTW_2_4_200_c",
    vswitchId: defaultSwitches.then(defaultSwitches => defaultSwitches.ids?[0]),
    backupVswitchId: defaultSwitches.then(defaultSwitches => defaultSwitches.ids?[1]),
    vpcId: defaultNetworks.then(defaultNetworks => defaultNetworks.ids?[0]),
});
resources:
  example:
    type: alicloud:mse:Gateway
    properties:
      gatewayName: example_value
      replica: 2
      spec: MSE_GTW_2_4_200_c
      vswitchId: ${defaultSwitches.ids[0]}
      backupVswitchId: ${defaultSwitches.ids[1]}
      vpcId: ${defaultNetworks.ids[0]}
variables:
  defaultZones:
    Fn::Invoke:
      Function: alicloud:getZones
      Arguments:
        availableResourceCreation: VSwitch
  defaultNetworks:
    Fn::Invoke:
      Function: alicloud:vpc:getNetworks
      Arguments:
        nameRegex: default-NODELETING
  defaultSwitches:
    Fn::Invoke:
      Function: alicloud:vpc:getSwitches
      Arguments:
        vpcId: ${defaultNetworks.ids[0]}
        zoneId: ${defaultZones.zones[0].id}

Create a Gateway Resource

new Gateway(name: string, args: GatewayArgs, opts?: CustomResourceOptions);
@overload
def Gateway(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            backup_vswitch_id: Optional[str] = None,
            delete_slb: Optional[bool] = None,
            enterprise_security_group: Optional[bool] = None,
            gateway_name: Optional[str] = None,
            internet_slb_spec: Optional[str] = None,
            replica: Optional[int] = None,
            slb_spec: Optional[str] = None,
            spec: Optional[str] = None,
            vpc_id: Optional[str] = None,
            vswitch_id: Optional[str] = None)
@overload
def Gateway(resource_name: str,
            args: GatewayArgs,
            opts: Optional[ResourceOptions] = None)
func NewGateway(ctx *Context, name string, args GatewayArgs, opts ...ResourceOption) (*Gateway, error)
public Gateway(string name, GatewayArgs args, CustomResourceOptions? opts = null)
public Gateway(String name, GatewayArgs args)
public Gateway(String name, GatewayArgs args, CustomResourceOptions options)
type: alicloud:mse:Gateway
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args GatewayArgs
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 GatewayArgs
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 GatewayArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args GatewayArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

Replica int

Number of Gateway Nodes.

Spec string

Gateway Node Specifications. Valid values: MSE_GTW_2_4_200_c, MSE_GTW_4_8_200_c, MSE_GTW_8_16_200_c, MSE_GTW_16_32_200_c.

VpcId string

The ID of the vpc.

VswitchId string

The ID of the vswitch.

BackupVswitchId string

The backup vswitch id.

DeleteSlb bool

Whether to delete the SLB purchased on behalf of the gateway at the same time.

EnterpriseSecurityGroup bool

Whether the enterprise security group type.

GatewayName string

The name of the Gateway .

InternetSlbSpec string

Public network SLB specifications.

SlbSpec string

Private network SLB specifications.

Replica int

Number of Gateway Nodes.

Spec string

Gateway Node Specifications. Valid values: MSE_GTW_2_4_200_c, MSE_GTW_4_8_200_c, MSE_GTW_8_16_200_c, MSE_GTW_16_32_200_c.

VpcId string

The ID of the vpc.

VswitchId string

The ID of the vswitch.

BackupVswitchId string

The backup vswitch id.

DeleteSlb bool

Whether to delete the SLB purchased on behalf of the gateway at the same time.

EnterpriseSecurityGroup bool

Whether the enterprise security group type.

GatewayName string

The name of the Gateway .

InternetSlbSpec string

Public network SLB specifications.

SlbSpec string

Private network SLB specifications.

replica Integer

Number of Gateway Nodes.

spec String

Gateway Node Specifications. Valid values: MSE_GTW_2_4_200_c, MSE_GTW_4_8_200_c, MSE_GTW_8_16_200_c, MSE_GTW_16_32_200_c.

vpcId String

The ID of the vpc.

vswitchId String

The ID of the vswitch.

backupVswitchId String

The backup vswitch id.

deleteSlb Boolean

Whether to delete the SLB purchased on behalf of the gateway at the same time.

enterpriseSecurityGroup Boolean

Whether the enterprise security group type.

gatewayName String

The name of the Gateway .

internetSlbSpec String

Public network SLB specifications.

slbSpec String

Private network SLB specifications.

replica number

Number of Gateway Nodes.

spec string

Gateway Node Specifications. Valid values: MSE_GTW_2_4_200_c, MSE_GTW_4_8_200_c, MSE_GTW_8_16_200_c, MSE_GTW_16_32_200_c.

vpcId string

The ID of the vpc.

vswitchId string

The ID of the vswitch.

backupVswitchId string

The backup vswitch id.

deleteSlb boolean

Whether to delete the SLB purchased on behalf of the gateway at the same time.

enterpriseSecurityGroup boolean

Whether the enterprise security group type.

gatewayName string

The name of the Gateway .

internetSlbSpec string

Public network SLB specifications.

slbSpec string

Private network SLB specifications.

replica int

Number of Gateway Nodes.

spec str

Gateway Node Specifications. Valid values: MSE_GTW_2_4_200_c, MSE_GTW_4_8_200_c, MSE_GTW_8_16_200_c, MSE_GTW_16_32_200_c.

vpc_id str

The ID of the vpc.

vswitch_id str

The ID of the vswitch.

backup_vswitch_id str

The backup vswitch id.

delete_slb bool

Whether to delete the SLB purchased on behalf of the gateway at the same time.

enterprise_security_group bool

Whether the enterprise security group type.

gateway_name str

The name of the Gateway .

internet_slb_spec str

Public network SLB specifications.

slb_spec str

Private network SLB specifications.

replica Number

Number of Gateway Nodes.

spec String

Gateway Node Specifications. Valid values: MSE_GTW_2_4_200_c, MSE_GTW_4_8_200_c, MSE_GTW_8_16_200_c, MSE_GTW_16_32_200_c.

vpcId String

The ID of the vpc.

vswitchId String

The ID of the vswitch.

backupVswitchId String

The backup vswitch id.

deleteSlb Boolean

Whether to delete the SLB purchased on behalf of the gateway at the same time.

enterpriseSecurityGroup Boolean

Whether the enterprise security group type.

gatewayName String

The name of the Gateway .

internetSlbSpec String

Public network SLB specifications.

slbSpec String

Private network SLB specifications.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

SlbLists List<Pulumi.AliCloud.Mse.Outputs.GatewaySlbList>

A list of gateway Slb.

Status string

The status of the gateway.

Id string

The provider-assigned unique ID for this managed resource.

SlbLists []GatewaySlbList

A list of gateway Slb.

Status string

The status of the gateway.

id String

The provider-assigned unique ID for this managed resource.

slbLists List<GatewaySlbList>

A list of gateway Slb.

status String

The status of the gateway.

id string

The provider-assigned unique ID for this managed resource.

slbLists GatewaySlbList[]

A list of gateway Slb.

status string

The status of the gateway.

id str

The provider-assigned unique ID for this managed resource.

slb_lists Sequence[GatewaySlbList]

A list of gateway Slb.

status str

The status of the gateway.

id String

The provider-assigned unique ID for this managed resource.

slbLists List<Property Map>

A list of gateway Slb.

status String

The status of the gateway.

Look up an Existing Gateway Resource

Get an existing Gateway 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?: GatewayState, opts?: CustomResourceOptions): Gateway
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        backup_vswitch_id: Optional[str] = None,
        delete_slb: Optional[bool] = None,
        enterprise_security_group: Optional[bool] = None,
        gateway_name: Optional[str] = None,
        internet_slb_spec: Optional[str] = None,
        replica: Optional[int] = None,
        slb_lists: Optional[Sequence[GatewaySlbListArgs]] = None,
        slb_spec: Optional[str] = None,
        spec: Optional[str] = None,
        status: Optional[str] = None,
        vpc_id: Optional[str] = None,
        vswitch_id: Optional[str] = None) -> Gateway
func GetGateway(ctx *Context, name string, id IDInput, state *GatewayState, opts ...ResourceOption) (*Gateway, error)
public static Gateway Get(string name, Input<string> id, GatewayState? state, CustomResourceOptions? opts = null)
public static Gateway get(String name, Output<String> id, GatewayState 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:
BackupVswitchId string

The backup vswitch id.

DeleteSlb bool

Whether to delete the SLB purchased on behalf of the gateway at the same time.

EnterpriseSecurityGroup bool

Whether the enterprise security group type.

GatewayName string

The name of the Gateway .

InternetSlbSpec string

Public network SLB specifications.

Replica int

Number of Gateway Nodes.

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

A list of gateway Slb.

SlbSpec string

Private network SLB specifications.

Spec string

Gateway Node Specifications. Valid values: MSE_GTW_2_4_200_c, MSE_GTW_4_8_200_c, MSE_GTW_8_16_200_c, MSE_GTW_16_32_200_c.

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.

DeleteSlb bool

Whether to delete the SLB purchased on behalf of the gateway at the same time.

EnterpriseSecurityGroup bool

Whether the enterprise security group type.

GatewayName string

The name of the Gateway .

InternetSlbSpec string

Public network SLB specifications.

Replica int

Number of Gateway Nodes.

SlbLists []GatewaySlbListArgs

A list of gateway Slb.

SlbSpec string

Private network SLB specifications.

Spec string

Gateway Node Specifications. Valid values: MSE_GTW_2_4_200_c, MSE_GTW_4_8_200_c, MSE_GTW_8_16_200_c, MSE_GTW_16_32_200_c.

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.

deleteSlb Boolean

Whether to delete the SLB purchased on behalf of the gateway at the same time.

enterpriseSecurityGroup Boolean

Whether the enterprise security group type.

gatewayName String

The name of the Gateway .

internetSlbSpec String

Public network SLB specifications.

replica Integer

Number of Gateway Nodes.

slbLists List<GatewaySlbListArgs>

A list of gateway Slb.

slbSpec String

Private network SLB specifications.

spec String

Gateway Node Specifications. Valid values: MSE_GTW_2_4_200_c, MSE_GTW_4_8_200_c, MSE_GTW_8_16_200_c, MSE_GTW_16_32_200_c.

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.

deleteSlb boolean

Whether to delete the SLB purchased on behalf of the gateway at the same time.

enterpriseSecurityGroup boolean

Whether the enterprise security group type.

gatewayName string

The name of the Gateway .

internetSlbSpec string

Public network SLB specifications.

replica number

Number of Gateway Nodes.

slbLists GatewaySlbListArgs[]

A list of gateway Slb.

slbSpec string

Private network SLB specifications.

spec string

Gateway Node Specifications. Valid values: MSE_GTW_2_4_200_c, MSE_GTW_4_8_200_c, MSE_GTW_8_16_200_c, MSE_GTW_16_32_200_c.

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.

delete_slb bool

Whether to delete the SLB purchased on behalf of the gateway at the same time.

enterprise_security_group bool

Whether the enterprise security group type.

gateway_name str

The name of the Gateway .

internet_slb_spec str

Public network SLB specifications.

replica int

Number of Gateway Nodes.

slb_lists Sequence[GatewaySlbListArgs]

A list of gateway Slb.

slb_spec str

Private network SLB specifications.

spec str

Gateway Node Specifications. Valid values: MSE_GTW_2_4_200_c, MSE_GTW_4_8_200_c, MSE_GTW_8_16_200_c, MSE_GTW_16_32_200_c.

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.

deleteSlb Boolean

Whether to delete the SLB purchased on behalf of the gateway at the same time.

enterpriseSecurityGroup Boolean

Whether the enterprise security group type.

gatewayName String

The name of the Gateway .

internetSlbSpec String

Public network SLB specifications.

replica Number

Number of Gateway Nodes.

slbLists List<Property Map>

A list of gateway Slb.

slbSpec String

Private network SLB specifications.

spec String

Gateway Node Specifications. Valid values: MSE_GTW_2_4_200_c, MSE_GTW_4_8_200_c, MSE_GTW_8_16_200_c, MSE_GTW_16_32_200_c.

status String

The status of the gateway.

vpcId String

The ID of the vpc.

vswitchId String

The ID of the vswitch.

Supporting Types

GatewaySlbList

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.

Import

Microservice Engine (MSE) Gateway can be imported using the id, e.g.

 $ pulumi import alicloud:mse/gateway:Gateway example <id>

Package Details

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

This Pulumi package is based on the alicloud Terraform Provider.