Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
This data source provides VPC Route Target Group available to the user.What is Route Target Group
NOTE: Available since v1.292.0.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const region = config.get("region") || "cn-wulanchabu";
const zoneId1 = config.get("zoneId1") || "cn-wulanchabu-b";
const zoneId2 = config.get("zoneId2") || "cn-wulanchabu-c";
const defaultNetwork = new alicloud.vpc.Network("default", {
vpcName: name,
cidrBlock: "192.168.0.0/16",
});
const zoneA = new alicloud.vpc.Switch("zone_a", {
vpcId: defaultNetwork.id,
zoneId: zoneId1,
cidrBlock: "192.168.0.0/24",
});
const zoneB = new alicloud.vpc.Switch("zone_b", {
vpcId: defaultNetwork.id,
zoneId: zoneId2,
cidrBlock: "192.168.1.0/24",
});
// Active member (zone A): GWLB load balancer + GWLB-type endpoint service +
// service-resource attachment + GatewayLoadBalancer endpoint.
const active = new alicloud.gwlb.LoadBalancer("active", {
loadBalancerName: `${name}-gwlb-active`,
addressIpVersion: "Ipv4",
vpcId: defaultNetwork.id,
zoneMappings: [{
vswitchId: zoneA.id,
zoneId: zoneId1,
}],
});
const activeVpcEndpointService = new alicloud.privatelink.VpcEndpointService("active", {
autoAcceptConnection: true,
serviceDescription: `${name}-eps-active`,
serviceResourceType: "gwlb",
});
const activeVpcEndpointServiceResource = new alicloud.privatelink.VpcEndpointServiceResource("active", {
resourceId: active.id,
resourceType: "gwlb",
serviceId: activeVpcEndpointService.id,
zoneId: zoneId1,
dryRun: false,
});
const activeVpcEndpoint = new alicloud.privatelink.VpcEndpoint("active", {
serviceId: activeVpcEndpointService.id,
vpcEndpointName: `${name}-ep-active`,
vpcId: defaultNetwork.id,
serviceName: activeVpcEndpointService.vpcEndpointServiceName,
endpointType: "GatewayLoadBalancer",
});
// Attach zone A to the GWLB endpoint. The route target group backend looks up
// the member endpoint by zone, so the endpoint must carry a non-empty zone.
const activeVpcEndpointZone = new alicloud.privatelink.VpcEndpointZone("active", {
endpointId: activeVpcEndpoint.id,
vswitchId: zoneA.id,
});
// Standby member (zone B): identical chain in a different zone.
const standby = new alicloud.gwlb.LoadBalancer("standby", {
loadBalancerName: `${name}-gwlb-standby`,
addressIpVersion: "Ipv4",
vpcId: defaultNetwork.id,
zoneMappings: [{
vswitchId: zoneB.id,
zoneId: zoneId2,
}],
});
const standbyVpcEndpointService = new alicloud.privatelink.VpcEndpointService("standby", {
autoAcceptConnection: true,
serviceDescription: `${name}-eps-standby`,
serviceResourceType: "gwlb",
});
const standbyVpcEndpointServiceResource = new alicloud.privatelink.VpcEndpointServiceResource("standby", {
resourceId: standby.id,
resourceType: "gwlb",
serviceId: standbyVpcEndpointService.id,
zoneId: zoneId2,
dryRun: false,
});
const standbyVpcEndpoint = new alicloud.privatelink.VpcEndpoint("standby", {
serviceId: standbyVpcEndpointService.id,
vpcEndpointName: `${name}-ep-standby`,
vpcId: defaultNetwork.id,
serviceName: standbyVpcEndpointService.vpcEndpointServiceName,
endpointType: "GatewayLoadBalancer",
});
// Attach zone B to the standby GWLB endpoint (different zone from active).
const standbyVpcEndpointZone = new alicloud.privatelink.VpcEndpointZone("standby", {
endpointId: standbyVpcEndpoint.id,
vswitchId: zoneB.id,
});
// The route target group depends_on both endpoint zones: the backend looks up
// each member endpoint by zone, so the zones must exist before Create is called.
const defaultRouteTargetGroup = new alicloud.vpc.RouteTargetGroup("default", {
routeTargetGroupName: name,
routeTargetGroupDescription: name,
vpcId: defaultNetwork.id,
configMode: "Active-Standby",
routeTargetMemberLists: [
{
memberId: activeVpcEndpoint.id,
memberType: "GatewayLoadBalancerEndpoint",
weight: 100,
},
{
memberId: standbyVpcEndpoint.id,
memberType: "GatewayLoadBalancerEndpoint",
weight: 0,
},
],
});
const _default = alicloud.vpc.getRouteTargetGroupsOutput({
ids: [defaultRouteTargetGroup.id],
nameRegex: defaultRouteTargetGroup.routeTargetGroupName,
vpcId: defaultNetwork.id,
});
export const alicloudVpcRouteTargetGroupExampleId = _default.apply(_default => _default.groups?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
region = config.get("region")
if region is None:
region = "cn-wulanchabu"
zone_id1 = config.get("zoneId1")
if zone_id1 is None:
zone_id1 = "cn-wulanchabu-b"
zone_id2 = config.get("zoneId2")
if zone_id2 is None:
zone_id2 = "cn-wulanchabu-c"
default_network = alicloud.vpc.Network("default",
vpc_name=name,
cidr_block="192.168.0.0/16")
zone_a = alicloud.vpc.Switch("zone_a",
vpc_id=default_network.id,
zone_id=zone_id1,
cidr_block="192.168.0.0/24")
zone_b = alicloud.vpc.Switch("zone_b",
vpc_id=default_network.id,
zone_id=zone_id2,
cidr_block="192.168.1.0/24")
# Active member (zone A): GWLB load balancer + GWLB-type endpoint service +
# service-resource attachment + GatewayLoadBalancer endpoint.
active = alicloud.gwlb.LoadBalancer("active",
load_balancer_name=f"{name}-gwlb-active",
address_ip_version="Ipv4",
vpc_id=default_network.id,
zone_mappings=[{
"vswitch_id": zone_a.id,
"zone_id": zone_id1,
}])
active_vpc_endpoint_service = alicloud.privatelink.VpcEndpointService("active",
auto_accept_connection=True,
service_description=f"{name}-eps-active",
service_resource_type="gwlb")
active_vpc_endpoint_service_resource = alicloud.privatelink.VpcEndpointServiceResource("active",
resource_id=active.id,
resource_type="gwlb",
service_id=active_vpc_endpoint_service.id,
zone_id=zone_id1,
dry_run=False)
active_vpc_endpoint = alicloud.privatelink.VpcEndpoint("active",
service_id=active_vpc_endpoint_service.id,
vpc_endpoint_name=f"{name}-ep-active",
vpc_id=default_network.id,
service_name=active_vpc_endpoint_service.vpc_endpoint_service_name,
endpoint_type="GatewayLoadBalancer")
# Attach zone A to the GWLB endpoint. The route target group backend looks up
# the member endpoint by zone, so the endpoint must carry a non-empty zone.
active_vpc_endpoint_zone = alicloud.privatelink.VpcEndpointZone("active",
endpoint_id=active_vpc_endpoint.id,
vswitch_id=zone_a.id)
# Standby member (zone B): identical chain in a different zone.
standby = alicloud.gwlb.LoadBalancer("standby",
load_balancer_name=f"{name}-gwlb-standby",
address_ip_version="Ipv4",
vpc_id=default_network.id,
zone_mappings=[{
"vswitch_id": zone_b.id,
"zone_id": zone_id2,
}])
standby_vpc_endpoint_service = alicloud.privatelink.VpcEndpointService("standby",
auto_accept_connection=True,
service_description=f"{name}-eps-standby",
service_resource_type="gwlb")
standby_vpc_endpoint_service_resource = alicloud.privatelink.VpcEndpointServiceResource("standby",
resource_id=standby.id,
resource_type="gwlb",
service_id=standby_vpc_endpoint_service.id,
zone_id=zone_id2,
dry_run=False)
standby_vpc_endpoint = alicloud.privatelink.VpcEndpoint("standby",
service_id=standby_vpc_endpoint_service.id,
vpc_endpoint_name=f"{name}-ep-standby",
vpc_id=default_network.id,
service_name=standby_vpc_endpoint_service.vpc_endpoint_service_name,
endpoint_type="GatewayLoadBalancer")
# Attach zone B to the standby GWLB endpoint (different zone from active).
standby_vpc_endpoint_zone = alicloud.privatelink.VpcEndpointZone("standby",
endpoint_id=standby_vpc_endpoint.id,
vswitch_id=zone_b.id)
# The route target group depends_on both endpoint zones: the backend looks up
# each member endpoint by zone, so the zones must exist before Create is called.
default_route_target_group = alicloud.vpc.RouteTargetGroup("default",
route_target_group_name=name,
route_target_group_description=name,
vpc_id=default_network.id,
config_mode="Active-Standby",
route_target_member_lists=[
{
"member_id": active_vpc_endpoint.id,
"member_type": "GatewayLoadBalancerEndpoint",
"weight": 100,
},
{
"member_id": standby_vpc_endpoint.id,
"member_type": "GatewayLoadBalancerEndpoint",
"weight": 0,
},
])
default = alicloud.vpc.get_route_target_groups_output(ids=[default_route_target_group.id],
name_regex=default_route_target_group.route_target_group_name,
vpc_id=default_network.id)
pulumi.export("alicloudVpcRouteTargetGroupExampleId", default.groups[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/gwlb"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/privatelink"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
region := "cn-wulanchabu"
if param := cfg.Get("region"); param != "" {
region = param
}
zoneId1 := "cn-wulanchabu-b"
if param := cfg.Get("zoneId1"); param != "" {
zoneId1 = param
}
zoneId2 := "cn-wulanchabu-c"
if param := cfg.Get("zoneId2"); param != "" {
zoneId2 = param
}
defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
VpcName: pulumi.String(name),
CidrBlock: pulumi.String("192.168.0.0/16"),
})
if err != nil {
return err
}
zoneA, err := vpc.NewSwitch(ctx, "zone_a", &vpc.SwitchArgs{
VpcId: defaultNetwork.ID().ToIDOutput().ToStringOutput(),
ZoneId: pulumi.String(zoneId1),
CidrBlock: pulumi.String("192.168.0.0/24"),
})
if err != nil {
return err
}
zoneB, err := vpc.NewSwitch(ctx, "zone_b", &vpc.SwitchArgs{
VpcId: defaultNetwork.ID().ToIDOutput().ToStringOutput(),
ZoneId: pulumi.String(zoneId2),
CidrBlock: pulumi.String("192.168.1.0/24"),
})
if err != nil {
return err
}
// Active member (zone A): GWLB load balancer + GWLB-type endpoint service +
// service-resource attachment + GatewayLoadBalancer endpoint.
active, err := gwlb.NewLoadBalancer(ctx, "active", &gwlb.LoadBalancerArgs{
LoadBalancerName: pulumi.Sprintf("%v-gwlb-active", name),
AddressIpVersion: pulumi.String("Ipv4"),
VpcId: defaultNetwork.ID().ToIDOutput().ToStringOutput(),
ZoneMappings: gwlb.LoadBalancerZoneMappingArray{
&gwlb.LoadBalancerZoneMappingArgs{
VswitchId: zoneA.ID().ToIDOutput().ToStringOutput(),
ZoneId: pulumi.String(zoneId1),
},
},
})
if err != nil {
return err
}
activeVpcEndpointService, err := privatelink.NewVpcEndpointService(ctx, "active", &privatelink.VpcEndpointServiceArgs{
AutoAcceptConnection: pulumi.Bool(true),
ServiceDescription: pulumi.Sprintf("%v-eps-active", name),
ServiceResourceType: pulumi.String("gwlb"),
})
if err != nil {
return err
}
_, err = privatelink.NewVpcEndpointServiceResource(ctx, "active", &privatelink.VpcEndpointServiceResourceArgs{
ResourceId: active.ID().ToIDOutput().ToStringOutput(),
ResourceType: pulumi.String("gwlb"),
ServiceId: activeVpcEndpointService.ID().ToIDOutput().ToStringOutput(),
ZoneId: pulumi.String(zoneId1),
DryRun: pulumi.Bool(false),
})
if err != nil {
return err
}
activeVpcEndpoint, err := privatelink.NewVpcEndpoint(ctx, "active", &privatelink.VpcEndpointArgs{
ServiceId: activeVpcEndpointService.ID().ToIDOutput().ToStringOutput(),
VpcEndpointName: pulumi.Sprintf("%v-ep-active", name),
VpcId: defaultNetwork.ID().ToIDOutput().ToStringOutput(),
ServiceName: activeVpcEndpointService.VpcEndpointServiceName,
EndpointType: pulumi.String("GatewayLoadBalancer"),
})
if err != nil {
return err
}
// Attach zone A to the GWLB endpoint. The route target group backend looks up
// the member endpoint by zone, so the endpoint must carry a non-empty zone.
_, err = privatelink.NewVpcEndpointZone(ctx, "active", &privatelink.VpcEndpointZoneArgs{
EndpointId: activeVpcEndpoint.ID().ToIDOutput().ToStringOutput(),
VswitchId: zoneA.ID().ToIDOutput().ToStringOutput(),
})
if err != nil {
return err
}
// Standby member (zone B): identical chain in a different zone.
standby, err := gwlb.NewLoadBalancer(ctx, "standby", &gwlb.LoadBalancerArgs{
LoadBalancerName: pulumi.Sprintf("%v-gwlb-standby", name),
AddressIpVersion: pulumi.String("Ipv4"),
VpcId: defaultNetwork.ID().ToIDOutput().ToStringOutput(),
ZoneMappings: gwlb.LoadBalancerZoneMappingArray{
&gwlb.LoadBalancerZoneMappingArgs{
VswitchId: zoneB.ID().ToIDOutput().ToStringOutput(),
ZoneId: pulumi.String(zoneId2),
},
},
})
if err != nil {
return err
}
standbyVpcEndpointService, err := privatelink.NewVpcEndpointService(ctx, "standby", &privatelink.VpcEndpointServiceArgs{
AutoAcceptConnection: pulumi.Bool(true),
ServiceDescription: pulumi.Sprintf("%v-eps-standby", name),
ServiceResourceType: pulumi.String("gwlb"),
})
if err != nil {
return err
}
_, err = privatelink.NewVpcEndpointServiceResource(ctx, "standby", &privatelink.VpcEndpointServiceResourceArgs{
ResourceId: standby.ID().ToIDOutput().ToStringOutput(),
ResourceType: pulumi.String("gwlb"),
ServiceId: standbyVpcEndpointService.ID().ToIDOutput().ToStringOutput(),
ZoneId: pulumi.String(zoneId2),
DryRun: pulumi.Bool(false),
})
if err != nil {
return err
}
standbyVpcEndpoint, err := privatelink.NewVpcEndpoint(ctx, "standby", &privatelink.VpcEndpointArgs{
ServiceId: standbyVpcEndpointService.ID().ToIDOutput().ToStringOutput(),
VpcEndpointName: pulumi.Sprintf("%v-ep-standby", name),
VpcId: defaultNetwork.ID().ToIDOutput().ToStringOutput(),
ServiceName: standbyVpcEndpointService.VpcEndpointServiceName,
EndpointType: pulumi.String("GatewayLoadBalancer"),
})
if err != nil {
return err
}
// Attach zone B to the standby GWLB endpoint (different zone from active).
_, err = privatelink.NewVpcEndpointZone(ctx, "standby", &privatelink.VpcEndpointZoneArgs{
EndpointId: standbyVpcEndpoint.ID().ToIDOutput().ToStringOutput(),
VswitchId: zoneB.ID().ToIDOutput().ToStringOutput(),
})
if err != nil {
return err
}
// The route target group depends_on both endpoint zones: the backend looks up
// each member endpoint by zone, so the zones must exist before Create is called.
defaultRouteTargetGroup, err := vpc.NewRouteTargetGroup(ctx, "default", &vpc.RouteTargetGroupArgs{
RouteTargetGroupName: pulumi.String(name),
RouteTargetGroupDescription: pulumi.String(name),
VpcId: defaultNetwork.ID().ToIDOutput().ToStringOutput(),
ConfigMode: pulumi.String("Active-Standby"),
RouteTargetMemberLists: vpc.RouteTargetGroupRouteTargetMemberListArray{
&vpc.RouteTargetGroupRouteTargetMemberListArgs{
MemberId: activeVpcEndpoint.ID().ToIDOutput().ToStringOutput(),
MemberType: pulumi.String("GatewayLoadBalancerEndpoint"),
Weight: pulumi.Int(100),
},
&vpc.RouteTargetGroupRouteTargetMemberListArgs{
MemberId: standbyVpcEndpoint.ID().ToIDOutput().ToStringOutput(),
MemberType: pulumi.String("GatewayLoadBalancerEndpoint"),
Weight: pulumi.Int(0),
},
},
})
if err != nil {
return err
}
_default := vpc.GetRouteTargetGroupsOutput(ctx, vpc.GetRouteTargetGroupsOutputArgs{
Ids: pulumi.StringArray{
defaultRouteTargetGroup.ID().ToIDOutput().ToStringOutput(),
},
NameRegex: defaultRouteTargetGroup.RouteTargetGroupName,
VpcId: defaultNetwork.ID().ToIDOutput().ToStringOutput(),
}, nil)
ctx.Export("alicloudVpcRouteTargetGroupExampleId", _default.ApplyT(func(_default vpc.GetRouteTargetGroupsResult) (*string, error) {
return _default.Groups[0].Id, nil
}).(pulumi.StringPtrOutput))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var region = config.Get("region") ?? "cn-wulanchabu";
var zoneId1 = config.Get("zoneId1") ?? "cn-wulanchabu-b";
var zoneId2 = config.Get("zoneId2") ?? "cn-wulanchabu-c";
var defaultNetwork = new AliCloud.Vpc.Network("default", new()
{
VpcName = name,
CidrBlock = "192.168.0.0/16",
});
var zoneA = new AliCloud.Vpc.Switch("zone_a", new()
{
VpcId = defaultNetwork.Id,
ZoneId = zoneId1,
CidrBlock = "192.168.0.0/24",
});
var zoneB = new AliCloud.Vpc.Switch("zone_b", new()
{
VpcId = defaultNetwork.Id,
ZoneId = zoneId2,
CidrBlock = "192.168.1.0/24",
});
// Active member (zone A): GWLB load balancer + GWLB-type endpoint service +
// service-resource attachment + GatewayLoadBalancer endpoint.
var active = new AliCloud.Gwlb.LoadBalancer("active", new()
{
LoadBalancerName = $"{name}-gwlb-active",
AddressIpVersion = "Ipv4",
VpcId = defaultNetwork.Id,
ZoneMappings = new[]
{
new AliCloud.Gwlb.Inputs.LoadBalancerZoneMappingArgs
{
VswitchId = zoneA.Id,
ZoneId = zoneId1,
},
},
});
var activeVpcEndpointService = new AliCloud.PrivateLink.VpcEndpointService("active", new()
{
AutoAcceptConnection = true,
ServiceDescription = $"{name}-eps-active",
ServiceResourceType = "gwlb",
});
var activeVpcEndpointServiceResource = new AliCloud.PrivateLink.VpcEndpointServiceResource("active", new()
{
ResourceId = active.Id,
ResourceType = "gwlb",
ServiceId = activeVpcEndpointService.Id,
ZoneId = zoneId1,
DryRun = false,
});
var activeVpcEndpoint = new AliCloud.PrivateLink.VpcEndpoint("active", new()
{
ServiceId = activeVpcEndpointService.Id,
VpcEndpointName = $"{name}-ep-active",
VpcId = defaultNetwork.Id,
ServiceName = activeVpcEndpointService.VpcEndpointServiceName,
EndpointType = "GatewayLoadBalancer",
});
// Attach zone A to the GWLB endpoint. The route target group backend looks up
// the member endpoint by zone, so the endpoint must carry a non-empty zone.
var activeVpcEndpointZone = new AliCloud.PrivateLink.VpcEndpointZone("active", new()
{
EndpointId = activeVpcEndpoint.Id,
VswitchId = zoneA.Id,
});
// Standby member (zone B): identical chain in a different zone.
var standby = new AliCloud.Gwlb.LoadBalancer("standby", new()
{
LoadBalancerName = $"{name}-gwlb-standby",
AddressIpVersion = "Ipv4",
VpcId = defaultNetwork.Id,
ZoneMappings = new[]
{
new AliCloud.Gwlb.Inputs.LoadBalancerZoneMappingArgs
{
VswitchId = zoneB.Id,
ZoneId = zoneId2,
},
},
});
var standbyVpcEndpointService = new AliCloud.PrivateLink.VpcEndpointService("standby", new()
{
AutoAcceptConnection = true,
ServiceDescription = $"{name}-eps-standby",
ServiceResourceType = "gwlb",
});
var standbyVpcEndpointServiceResource = new AliCloud.PrivateLink.VpcEndpointServiceResource("standby", new()
{
ResourceId = standby.Id,
ResourceType = "gwlb",
ServiceId = standbyVpcEndpointService.Id,
ZoneId = zoneId2,
DryRun = false,
});
var standbyVpcEndpoint = new AliCloud.PrivateLink.VpcEndpoint("standby", new()
{
ServiceId = standbyVpcEndpointService.Id,
VpcEndpointName = $"{name}-ep-standby",
VpcId = defaultNetwork.Id,
ServiceName = standbyVpcEndpointService.VpcEndpointServiceName,
EndpointType = "GatewayLoadBalancer",
});
// Attach zone B to the standby GWLB endpoint (different zone from active).
var standbyVpcEndpointZone = new AliCloud.PrivateLink.VpcEndpointZone("standby", new()
{
EndpointId = standbyVpcEndpoint.Id,
VswitchId = zoneB.Id,
});
// The route target group depends_on both endpoint zones: the backend looks up
// each member endpoint by zone, so the zones must exist before Create is called.
var defaultRouteTargetGroup = new AliCloud.Vpc.RouteTargetGroup("default", new()
{
RouteTargetGroupName = name,
RouteTargetGroupDescription = name,
VpcId = defaultNetwork.Id,
ConfigMode = "Active-Standby",
RouteTargetMemberLists = new[]
{
new AliCloud.Vpc.Inputs.RouteTargetGroupRouteTargetMemberListArgs
{
MemberId = activeVpcEndpoint.Id,
MemberType = "GatewayLoadBalancerEndpoint",
Weight = 100,
},
new AliCloud.Vpc.Inputs.RouteTargetGroupRouteTargetMemberListArgs
{
MemberId = standbyVpcEndpoint.Id,
MemberType = "GatewayLoadBalancerEndpoint",
Weight = 0,
},
},
});
var @default = AliCloud.Vpc.GetRouteTargetGroups.Invoke(new()
{
Ids = new[]
{
defaultRouteTargetGroup.Id,
},
NameRegex = defaultRouteTargetGroup.RouteTargetGroupName,
VpcId = defaultNetwork.Id,
});
return new Dictionary<string, object?>
{
["alicloudVpcRouteTargetGroupExampleId"] = @default.Apply(@default => @default.Apply(getRouteTargetGroupsResult => getRouteTargetGroupsResult.Groups[0]?.Id)),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.gwlb.LoadBalancer;
import com.pulumi.alicloud.gwlb.LoadBalancerArgs;
import com.pulumi.alicloud.gwlb.inputs.LoadBalancerZoneMappingArgs;
import com.pulumi.alicloud.privatelink.VpcEndpointService;
import com.pulumi.alicloud.privatelink.VpcEndpointServiceArgs;
import com.pulumi.alicloud.privatelink.VpcEndpointServiceResource;
import com.pulumi.alicloud.privatelink.VpcEndpointServiceResourceArgs;
import com.pulumi.alicloud.privatelink.VpcEndpoint;
import com.pulumi.alicloud.privatelink.VpcEndpointArgs;
import com.pulumi.alicloud.privatelink.VpcEndpointZone;
import com.pulumi.alicloud.privatelink.VpcEndpointZoneArgs;
import com.pulumi.alicloud.vpc.RouteTargetGroup;
import com.pulumi.alicloud.vpc.RouteTargetGroupArgs;
import com.pulumi.alicloud.vpc.inputs.RouteTargetGroupRouteTargetMemberListArgs;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetRouteTargetGroupsArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
final var region = config.get("region").orElse("cn-wulanchabu");
final var zoneId1 = config.get("zoneId1").orElse("cn-wulanchabu-b");
final var zoneId2 = config.get("zoneId2").orElse("cn-wulanchabu-c");
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("192.168.0.0/16")
.build());
var zoneA = new Switch("zoneA", SwitchArgs.builder()
.vpcId(defaultNetwork.id())
.zoneId(zoneId1)
.cidrBlock("192.168.0.0/24")
.build());
var zoneB = new Switch("zoneB", SwitchArgs.builder()
.vpcId(defaultNetwork.id())
.zoneId(zoneId2)
.cidrBlock("192.168.1.0/24")
.build());
// Active member (zone A): GWLB load balancer + GWLB-type endpoint service +
// service-resource attachment + GatewayLoadBalancer endpoint.
var active = new LoadBalancer("active", LoadBalancerArgs.builder()
.loadBalancerName(String.format("%s-gwlb-active", name))
.addressIpVersion("Ipv4")
.vpcId(defaultNetwork.id())
.zoneMappings(LoadBalancerZoneMappingArgs.builder()
.vswitchId(zoneA.id())
.zoneId(zoneId1)
.build())
.build());
var activeVpcEndpointService = new VpcEndpointService("activeVpcEndpointService", VpcEndpointServiceArgs.builder()
.autoAcceptConnection(true)
.serviceDescription(String.format("%s-eps-active", name))
.serviceResourceType("gwlb")
.build());
var activeVpcEndpointServiceResource = new VpcEndpointServiceResource("activeVpcEndpointServiceResource", VpcEndpointServiceResourceArgs.builder()
.resourceId(active.id())
.resourceType("gwlb")
.serviceId(activeVpcEndpointService.id())
.zoneId(zoneId1)
.dryRun(false)
.build());
var activeVpcEndpoint = new VpcEndpoint("activeVpcEndpoint", VpcEndpointArgs.builder()
.serviceId(activeVpcEndpointService.id())
.vpcEndpointName(String.format("%s-ep-active", name))
.vpcId(defaultNetwork.id())
.serviceName(activeVpcEndpointService.vpcEndpointServiceName())
.endpointType("GatewayLoadBalancer")
.build());
// Attach zone A to the GWLB endpoint. The route target group backend looks up
// the member endpoint by zone, so the endpoint must carry a non-empty zone.
var activeVpcEndpointZone = new VpcEndpointZone("activeVpcEndpointZone", VpcEndpointZoneArgs.builder()
.endpointId(activeVpcEndpoint.id())
.vswitchId(zoneA.id())
.build());
// Standby member (zone B): identical chain in a different zone.
var standby = new LoadBalancer("standby", LoadBalancerArgs.builder()
.loadBalancerName(String.format("%s-gwlb-standby", name))
.addressIpVersion("Ipv4")
.vpcId(defaultNetwork.id())
.zoneMappings(LoadBalancerZoneMappingArgs.builder()
.vswitchId(zoneB.id())
.zoneId(zoneId2)
.build())
.build());
var standbyVpcEndpointService = new VpcEndpointService("standbyVpcEndpointService", VpcEndpointServiceArgs.builder()
.autoAcceptConnection(true)
.serviceDescription(String.format("%s-eps-standby", name))
.serviceResourceType("gwlb")
.build());
var standbyVpcEndpointServiceResource = new VpcEndpointServiceResource("standbyVpcEndpointServiceResource", VpcEndpointServiceResourceArgs.builder()
.resourceId(standby.id())
.resourceType("gwlb")
.serviceId(standbyVpcEndpointService.id())
.zoneId(zoneId2)
.dryRun(false)
.build());
var standbyVpcEndpoint = new VpcEndpoint("standbyVpcEndpoint", VpcEndpointArgs.builder()
.serviceId(standbyVpcEndpointService.id())
.vpcEndpointName(String.format("%s-ep-standby", name))
.vpcId(defaultNetwork.id())
.serviceName(standbyVpcEndpointService.vpcEndpointServiceName())
.endpointType("GatewayLoadBalancer")
.build());
// Attach zone B to the standby GWLB endpoint (different zone from active).
var standbyVpcEndpointZone = new VpcEndpointZone("standbyVpcEndpointZone", VpcEndpointZoneArgs.builder()
.endpointId(standbyVpcEndpoint.id())
.vswitchId(zoneB.id())
.build());
// The route target group depends_on both endpoint zones: the backend looks up
// each member endpoint by zone, so the zones must exist before Create is called.
var defaultRouteTargetGroup = new RouteTargetGroup("defaultRouteTargetGroup", RouteTargetGroupArgs.builder()
.routeTargetGroupName(name)
.routeTargetGroupDescription(name)
.vpcId(defaultNetwork.id())
.configMode("Active-Standby")
.routeTargetMemberLists(
RouteTargetGroupRouteTargetMemberListArgs.builder()
.memberId(activeVpcEndpoint.id())
.memberType("GatewayLoadBalancerEndpoint")
.weight(100)
.build(),
RouteTargetGroupRouteTargetMemberListArgs.builder()
.memberId(standbyVpcEndpoint.id())
.memberType("GatewayLoadBalancerEndpoint")
.weight(0)
.build())
.build());
final var default = VpcFunctions.getRouteTargetGroups(GetRouteTargetGroupsArgs.builder()
.ids(defaultRouteTargetGroup.id())
.nameRegex(defaultRouteTargetGroup.routeTargetGroupName())
.vpcId(defaultNetwork.id())
.build());
ctx.export("alicloudVpcRouteTargetGroupExampleId", default_.applyValue(_default_ -> _default_.groups()[0].id()));
}
}
configuration:
name:
type: string
default: terraform-example
region:
type: string
default: cn-wulanchabu
zoneId1:
type: string
default: cn-wulanchabu-b
zoneId2:
type: string
default: cn-wulanchabu-c
resources:
defaultNetwork:
type: alicloud:vpc:Network
name: default
properties:
vpcName: ${name}
cidrBlock: 192.168.0.0/16
zoneA:
type: alicloud:vpc:Switch
name: zone_a
properties:
vpcId: ${defaultNetwork.id}
zoneId: ${zoneId1}
cidrBlock: 192.168.0.0/24
zoneB:
type: alicloud:vpc:Switch
name: zone_b
properties:
vpcId: ${defaultNetwork.id}
zoneId: ${zoneId2}
cidrBlock: 192.168.1.0/24
# Active member (zone A): GWLB load balancer + GWLB-type endpoint service +
# service-resource attachment + GatewayLoadBalancer endpoint.
active:
type: alicloud:gwlb:LoadBalancer
properties:
loadBalancerName: ${name}-gwlb-active
addressIpVersion: Ipv4
vpcId: ${defaultNetwork.id}
zoneMappings:
- vswitchId: ${zoneA.id}
zoneId: ${zoneId1}
activeVpcEndpointService:
type: alicloud:privatelink:VpcEndpointService
name: active
properties:
autoAcceptConnection: true
serviceDescription: ${name}-eps-active
serviceResourceType: gwlb
activeVpcEndpointServiceResource:
type: alicloud:privatelink:VpcEndpointServiceResource
name: active
properties:
resourceId: ${active.id}
resourceType: gwlb
serviceId: ${activeVpcEndpointService.id}
zoneId: ${zoneId1}
dryRun: 'false'
activeVpcEndpoint:
type: alicloud:privatelink:VpcEndpoint
name: active
properties:
serviceId: ${activeVpcEndpointService.id}
vpcEndpointName: ${name}-ep-active
vpcId: ${defaultNetwork.id}
serviceName: ${activeVpcEndpointService.vpcEndpointServiceName}
endpointType: GatewayLoadBalancer
# Attach zone A to the GWLB endpoint. The route target group backend looks up
# the member endpoint by zone, so the endpoint must carry a non-empty zone.
activeVpcEndpointZone:
type: alicloud:privatelink:VpcEndpointZone
name: active
properties:
endpointId: ${activeVpcEndpoint.id}
vswitchId: ${zoneA.id}
# Standby member (zone B): identical chain in a different zone.
standby:
type: alicloud:gwlb:LoadBalancer
properties:
loadBalancerName: ${name}-gwlb-standby
addressIpVersion: Ipv4
vpcId: ${defaultNetwork.id}
zoneMappings:
- vswitchId: ${zoneB.id}
zoneId: ${zoneId2}
standbyVpcEndpointService:
type: alicloud:privatelink:VpcEndpointService
name: standby
properties:
autoAcceptConnection: true
serviceDescription: ${name}-eps-standby
serviceResourceType: gwlb
standbyVpcEndpointServiceResource:
type: alicloud:privatelink:VpcEndpointServiceResource
name: standby
properties:
resourceId: ${standby.id}
resourceType: gwlb
serviceId: ${standbyVpcEndpointService.id}
zoneId: ${zoneId2}
dryRun: 'false'
standbyVpcEndpoint:
type: alicloud:privatelink:VpcEndpoint
name: standby
properties:
serviceId: ${standbyVpcEndpointService.id}
vpcEndpointName: ${name}-ep-standby
vpcId: ${defaultNetwork.id}
serviceName: ${standbyVpcEndpointService.vpcEndpointServiceName}
endpointType: GatewayLoadBalancer
# Attach zone B to the standby GWLB endpoint (different zone from active).
standbyVpcEndpointZone:
type: alicloud:privatelink:VpcEndpointZone
name: standby
properties:
endpointId: ${standbyVpcEndpoint.id}
vswitchId: ${zoneB.id}
# The route target group depends_on both endpoint zones: the backend looks up
# each member endpoint by zone, so the zones must exist before Create is called.
defaultRouteTargetGroup:
type: alicloud:vpc:RouteTargetGroup
name: default
properties:
routeTargetGroupName: ${name}
routeTargetGroupDescription: ${name}
vpcId: ${defaultNetwork.id}
configMode: Active-Standby
routeTargetMemberLists:
- memberId: ${activeVpcEndpoint.id}
memberType: GatewayLoadBalancerEndpoint
weight: 100
- memberId: ${standbyVpcEndpoint.id}
memberType: GatewayLoadBalancerEndpoint
weight: 0
variables:
default:
fn::invoke:
function: alicloud:vpc:getRouteTargetGroups
arguments:
ids:
- ${defaultRouteTargetGroup.id}
nameRegex: ${defaultRouteTargetGroup.routeTargetGroupName}
vpcId: ${defaultNetwork.id}
outputs:
alicloudVpcRouteTargetGroupExampleId: ${default.groups[0].id}
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
data "alicloud_vpc_getroutetargetgroups" "default" {
ids = [alicloud_vpc_routetargetgroup.default.id]
name_regex = alicloud_vpc_routetargetgroup.default.route_target_group_name
vpc_id = alicloud_vpc_network.default.id
}
resource "alicloud_vpc_network" "default" {
vpc_name = var.name
cidr_block = "192.168.0.0/16"
}
resource "alicloud_vpc_switch" "zone_a" {
vpc_id = alicloud_vpc_network.default.id
zone_id = var.zoneId1
cidr_block = "192.168.0.0/24"
}
resource "alicloud_vpc_switch" "zone_b" {
vpc_id = alicloud_vpc_network.default.id
zone_id = var.zoneId2
cidr_block = "192.168.1.0/24"
}
# Active member (zone A): GWLB load balancer + GWLB-type endpoint service +
# service-resource attachment + GatewayLoadBalancer endpoint.
resource "alicloud_gwlb_loadbalancer" "active" {
load_balancer_name ="${var.name}-gwlb-active"
address_ip_version = "Ipv4"
vpc_id = alicloud_vpc_network.default.id
zone_mappings {
vswitch_id = alicloud_vpc_switch.zone_a.id
zone_id = var.zoneId1
}
}
resource "alicloud_privatelink_vpcendpointservice" "active" {
auto_accept_connection = true
service_description ="${var.name}-eps-active"
service_resource_type = "gwlb"
}
resource "alicloud_privatelink_vpcendpointserviceresource" "active" {
resource_id = alicloud_gwlb_loadbalancer.active.id
resource_type = "gwlb"
service_id = alicloud_privatelink_vpcendpointservice.active.id
zone_id = var.zoneId1
dry_run = "false"
}
resource "alicloud_privatelink_vpcendpoint" "active" {
service_id = alicloud_privatelink_vpcendpointservice.active.id
vpc_endpoint_name ="${var.name}-ep-active"
vpc_id = alicloud_vpc_network.default.id
service_name = alicloud_privatelink_vpcendpointservice.active.vpc_endpoint_service_name
endpoint_type = "GatewayLoadBalancer"
}
# Attach zone A to the GWLB endpoint. The route target group backend looks up
# the member endpoint by zone, so the endpoint must carry a non-empty zone.
resource "alicloud_privatelink_vpcendpointzone" "active" {
endpoint_id = alicloud_privatelink_vpcendpoint.active.id
vswitch_id = alicloud_vpc_switch.zone_a.id
}
# Standby member (zone B): identical chain in a different zone.
resource "alicloud_gwlb_loadbalancer" "standby" {
load_balancer_name ="${var.name}-gwlb-standby"
address_ip_version = "Ipv4"
vpc_id = alicloud_vpc_network.default.id
zone_mappings {
vswitch_id = alicloud_vpc_switch.zone_b.id
zone_id = var.zoneId2
}
}
resource "alicloud_privatelink_vpcendpointservice" "standby" {
auto_accept_connection = true
service_description ="${var.name}-eps-standby"
service_resource_type = "gwlb"
}
resource "alicloud_privatelink_vpcendpointserviceresource" "standby" {
resource_id = alicloud_gwlb_loadbalancer.standby.id
resource_type = "gwlb"
service_id = alicloud_privatelink_vpcendpointservice.standby.id
zone_id = var.zoneId2
dry_run = "false"
}
resource "alicloud_privatelink_vpcendpoint" "standby" {
service_id = alicloud_privatelink_vpcendpointservice.standby.id
vpc_endpoint_name ="${var.name}-ep-standby"
vpc_id = alicloud_vpc_network.default.id
service_name = alicloud_privatelink_vpcendpointservice.standby.vpc_endpoint_service_name
endpoint_type = "GatewayLoadBalancer"
}
# Attach zone B to the standby GWLB endpoint (different zone from active).
resource "alicloud_privatelink_vpcendpointzone" "standby" {
endpoint_id = alicloud_privatelink_vpcendpoint.standby.id
vswitch_id = alicloud_vpc_switch.zone_b.id
}
# The route target group depends_on both endpoint zones: the backend looks up
# each member endpoint by zone, so the zones must exist before Create is called.
resource "alicloud_vpc_routetargetgroup" "default" {
route_target_group_name = var.name
route_target_group_description = var.name
vpc_id = alicloud_vpc_network.default.id
config_mode = "Active-Standby"
route_target_member_lists {
member_id = alicloud_privatelink_vpcendpoint.active.id
member_type = "GatewayLoadBalancerEndpoint"
weight = 100
}
route_target_member_lists {
member_id = alicloud_privatelink_vpcendpoint.standby.id
member_type = "GatewayLoadBalancerEndpoint"
weight = 0
}
}
variable "name" {
type = string
default = "terraform-example"
}
variable "region" {
type = string
default = "cn-wulanchabu"
}
variable "zoneId1" {
type = string
default = "cn-wulanchabu-b"
}
variable "zoneId2" {
type = string
default = "cn-wulanchabu-c"
}
output "alicloudVpcRouteTargetGroupExampleId" {
value = data.alicloud_vpc_getroutetargetgroups.default.groups[0].id
}
Using getRouteTargetGroups
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 getRouteTargetGroups(args: GetRouteTargetGroupsArgs, opts?: InvokeOptions): Promise<GetRouteTargetGroupsResult>
function getRouteTargetGroupsOutput(args: GetRouteTargetGroupsOutputArgs, opts?: InvokeOutputOptions): Output<GetRouteTargetGroupsResult>def get_route_target_groups(ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
resource_group_id: Optional[str] = None,
route_target_group_id: Optional[str] = None,
route_target_member_lists: Optional[Sequence[GetRouteTargetGroupsRouteTargetMemberList]] = None,
tags: Optional[Mapping[str, str]] = None,
vpc_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRouteTargetGroupsResult
def get_route_target_groups_output(ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
name_regex: pulumi.Input[Optional[str]] = None,
output_file: pulumi.Input[Optional[str]] = None,
resource_group_id: pulumi.Input[Optional[str]] = None,
route_target_group_id: pulumi.Input[Optional[str]] = None,
route_target_member_lists: pulumi.Input[Optional[Sequence[pulumi.Input[GetRouteTargetGroupsRouteTargetMemberListArgs]]]] = None,
tags: pulumi.Input[Optional[Mapping[str, pulumi.Input[str]]]] = None,
vpc_id: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetRouteTargetGroupsResult]func GetRouteTargetGroups(ctx *Context, args *GetRouteTargetGroupsArgs, opts ...InvokeOption) (*GetRouteTargetGroupsResult, error)
func GetRouteTargetGroupsOutput(ctx *Context, args *GetRouteTargetGroupsOutputArgs, opts ...InvokeOption) GetRouteTargetGroupsResultOutput> Note: This function is named GetRouteTargetGroups in the Go SDK.
public static class GetRouteTargetGroups
{
public static Task<GetRouteTargetGroupsResult> InvokeAsync(GetRouteTargetGroupsArgs args, InvokeOptions? opts = null)
public static Output<GetRouteTargetGroupsResult> Invoke(GetRouteTargetGroupsInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetRouteTargetGroupsResult> Invoke(GetRouteTargetGroupsInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetRouteTargetGroupsResult> getRouteTargetGroups(GetRouteTargetGroupsArgs args, InvokeOptions options)
public static Output<GetRouteTargetGroupsResult> getRouteTargetGroups(GetRouteTargetGroupsArgs args, InvokeOptions options)
public static Output<GetRouteTargetGroupsResult> getRouteTargetGroups(GetRouteTargetGroupsArgs args, InvokeOutputOptions options)
fn::invoke:
function: alicloud:vpc/getRouteTargetGroups:getRouteTargetGroups
arguments:
# arguments dictionarydata "alicloud_vpc_get_route_target_groups" "name" {
# arguments
}The following arguments are supported:
- Ids List<string>
- A list of Route Target Group IDs.
- Name
Regex string - A regex string to filter Route Target Groups by name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Resource
Group stringId - The ID of the resource group to which the route target group belongs.
- Route
Target stringGroup Id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- Route
Target List<Pulumi.Member Lists Ali Cloud. Vpc. Inputs. Get Route Target Groups Route Target Member List> - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- Dictionary<string, string>
- The tags of the route target group.
- Vpc
Id string - The ID of the VPC to which the route target group belongs.
- Ids []string
- A list of Route Target Group IDs.
- Name
Regex string - A regex string to filter Route Target Groups by name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Resource
Group stringId - The ID of the resource group to which the route target group belongs.
- Route
Target stringGroup Id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- Route
Target []GetMember Lists Route Target Groups Route Target Member List - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- map[string]string
- The tags of the route target group.
- Vpc
Id string - The ID of the VPC to which the route target group belongs.
- ids list(string)
- A list of Route Target Group IDs.
- name_
regex string - A regex string to filter Route Target Groups by name.
- output_
file string - File name where to save data source results (after running
pulumi preview). - resource_
group_ stringid - The ID of the resource group to which the route target group belongs.
- route_
target_ stringgroup_ id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- route_
target_ list(object)member_ lists - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- map(string)
- The tags of the route target group.
- vpc_
id string - The ID of the VPC to which the route target group belongs.
- ids List<String>
- A list of Route Target Group IDs.
- name
Regex String - A regex string to filter Route Target Groups by name.
- output
File String - File name where to save data source results (after running
pulumi preview). - resource
Group StringId - The ID of the resource group to which the route target group belongs.
- route
Target StringGroup Id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- route
Target List<GetMember Lists Route Target Groups Route Target Member List> - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- Map<String,String>
- The tags of the route target group.
- vpc
Id String - The ID of the VPC to which the route target group belongs.
- ids string[]
- A list of Route Target Group IDs.
- name
Regex string - A regex string to filter Route Target Groups by name.
- output
File string - File name where to save data source results (after running
pulumi preview). - resource
Group stringId - The ID of the resource group to which the route target group belongs.
- route
Target stringGroup Id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- route
Target GetMember Lists Route Target Groups Route Target Member List[] - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- {[key: string]: string}
- The tags of the route target group.
- vpc
Id string - The ID of the VPC to which the route target group belongs.
- ids Sequence[str]
- A list of Route Target Group IDs.
- name_
regex str - A regex string to filter Route Target Groups by name.
- output_
file str - File name where to save data source results (after running
pulumi preview). - resource_
group_ strid - The ID of the resource group to which the route target group belongs.
- route_
target_ strgroup_ id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- route_
target_ Sequence[Getmember_ lists Route Target Groups Route Target Member List] - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- Mapping[str, str]
- The tags of the route target group.
- vpc_
id str - The ID of the VPC to which the route target group belongs.
- ids List<String>
- A list of Route Target Group IDs.
- name
Regex String - A regex string to filter Route Target Groups by name.
- output
File String - File name where to save data source results (after running
pulumi preview). - resource
Group StringId - The ID of the resource group to which the route target group belongs.
- route
Target StringGroup Id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- route
Target List<Property Map>Member Lists - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- Map<String>
- The tags of the route target group.
- vpc
Id String - The ID of the VPC to which the route target group belongs.
getRouteTargetGroups Result
The following output properties are available:
- Groups
List<Pulumi.
Ali Cloud. Vpc. Outputs. Get Route Target Groups Group> - A list of Route Target Group Entries. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of Route Target Group IDs.
- Names List<string>
- A list of name of Route Target Groups.
- Name
Regex string - Output
File string - Resource
Group stringId - The ID of the resource group to which the route target group belongs.
- Route
Target stringGroup Id - The ID of the route target group.
- Route
Target List<Pulumi.Member Lists Ali Cloud. Vpc. Outputs. Get Route Target Groups Route Target Member List> - The member list of the route target group.
- Dictionary<string, string>
- The tags of the route target group.
- Vpc
Id string - The ID of the VPC to which the route target group belongs.
- Groups
[]Get
Route Target Groups Group - A list of Route Target Group Entries. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of Route Target Group IDs.
- Names []string
- A list of name of Route Target Groups.
- Name
Regex string - Output
File string - Resource
Group stringId - The ID of the resource group to which the route target group belongs.
- Route
Target stringGroup Id - The ID of the route target group.
- Route
Target []GetMember Lists Route Target Groups Route Target Member List - The member list of the route target group.
- map[string]string
- The tags of the route target group.
- Vpc
Id string - The ID of the VPC to which the route target group belongs.
- groups list(object)
- A list of Route Target Group Entries. Each element contains the following attributes:
- id string
- The provider-assigned unique ID for this managed resource.
- ids list(string)
- A list of Route Target Group IDs.
- names list(string)
- A list of name of Route Target Groups.
- name_
regex string - output_
file string - resource_
group_ stringid - The ID of the resource group to which the route target group belongs.
- route_
target_ stringgroup_ id - The ID of the route target group.
- route_
target_ list(object)member_ lists - The member list of the route target group.
- map(string)
- The tags of the route target group.
- vpc_
id string - The ID of the VPC to which the route target group belongs.
- groups
List<Get
Route Target Groups Group> - A list of Route Target Group Entries. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Route Target Group IDs.
- names List<String>
- A list of name of Route Target Groups.
- name
Regex String - output
File String - resource
Group StringId - The ID of the resource group to which the route target group belongs.
- route
Target StringGroup Id - The ID of the route target group.
- route
Target List<GetMember Lists Route Target Groups Route Target Member List> - The member list of the route target group.
- Map<String,String>
- The tags of the route target group.
- vpc
Id String - The ID of the VPC to which the route target group belongs.
- groups
Get
Route Target Groups Group[] - A list of Route Target Group Entries. Each element contains the following attributes:
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of Route Target Group IDs.
- names string[]
- A list of name of Route Target Groups.
- name
Regex string - output
File string - resource
Group stringId - The ID of the resource group to which the route target group belongs.
- route
Target stringGroup Id - The ID of the route target group.
- route
Target GetMember Lists Route Target Groups Route Target Member List[] - The member list of the route target group.
- {[key: string]: string}
- The tags of the route target group.
- vpc
Id string - The ID of the VPC to which the route target group belongs.
- groups
Sequence[Get
Route Target Groups Group] - A list of Route Target Group Entries. Each element contains the following attributes:
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of Route Target Group IDs.
- names Sequence[str]
- A list of name of Route Target Groups.
- name_
regex str - output_
file str - resource_
group_ strid - The ID of the resource group to which the route target group belongs.
- route_
target_ strgroup_ id - The ID of the route target group.
- route_
target_ Sequence[Getmember_ lists Route Target Groups Route Target Member List] - The member list of the route target group.
- Mapping[str, str]
- The tags of the route target group.
- vpc_
id str - The ID of the VPC to which the route target group belongs.
- groups List<Property Map>
- A list of Route Target Group Entries. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Route Target Group IDs.
- names List<String>
- A list of name of Route Target Groups.
- name
Regex String - output
File String - resource
Group StringId - The ID of the resource group to which the route target group belongs.
- route
Target StringGroup Id - The ID of the route target group.
- route
Target List<Property Map>Member Lists - The member list of the route target group.
- Map<String>
- The tags of the route target group.
- vpc
Id String - The ID of the VPC to which the route target group belongs.
Supporting Types
GetRouteTargetGroupsGroup
- Config
Mode string - The configuration mode of the route target group.
- Create
Time string - The time when the route target group was created.
- Id string
- The ID of the resource supplied above.
- Region
Id string - The region ID of the VPC to which the route target group belongs.
- Resource
Group stringId - The ID of the resource group to which the route target group belongs.
- Route
Target stringGroup Description - The description of the route target group.
- Route
Target stringGroup Id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- Route
Target stringGroup Name - The name of the route target group.
- Route
Target List<Pulumi.Member Lists Ali Cloud. Vpc. Inputs. Get Route Target Groups Group Route Target Member List> - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- Status string
- The status of the route target group. Valid values:
Pending,Available. - Dictionary<string, string>
- The tags of the route target group.
- Vpc
Id string - The ID of the VPC to which the route target group belongs.
- Config
Mode string - The configuration mode of the route target group.
- Create
Time string - The time when the route target group was created.
- Id string
- The ID of the resource supplied above.
- Region
Id string - The region ID of the VPC to which the route target group belongs.
- Resource
Group stringId - The ID of the resource group to which the route target group belongs.
- Route
Target stringGroup Description - The description of the route target group.
- Route
Target stringGroup Id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- Route
Target stringGroup Name - The name of the route target group.
- Route
Target []GetMember Lists Route Target Groups Group Route Target Member List - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- Status string
- The status of the route target group. Valid values:
Pending,Available. - map[string]string
- The tags of the route target group.
- Vpc
Id string - The ID of the VPC to which the route target group belongs.
- config_
mode string - The configuration mode of the route target group.
- create_
time string - The time when the route target group was created.
- id string
- The ID of the resource supplied above.
- region_
id string - The region ID of the VPC to which the route target group belongs.
- resource_
group_ stringid - The ID of the resource group to which the route target group belongs.
- route_
target_ stringgroup_ description - The description of the route target group.
- route_
target_ stringgroup_ id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- route_
target_ stringgroup_ name - The name of the route target group.
- route_
target_ list(object)member_ lists - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- status string
- The status of the route target group. Valid values:
Pending,Available. - map(string)
- The tags of the route target group.
- vpc_
id string - The ID of the VPC to which the route target group belongs.
- config
Mode String - The configuration mode of the route target group.
- create
Time String - The time when the route target group was created.
- id String
- The ID of the resource supplied above.
- region
Id String - The region ID of the VPC to which the route target group belongs.
- resource
Group StringId - The ID of the resource group to which the route target group belongs.
- route
Target StringGroup Description - The description of the route target group.
- route
Target StringGroup Id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- route
Target StringGroup Name - The name of the route target group.
- route
Target List<GetMember Lists Route Target Groups Group Route Target Member List> - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- status String
- The status of the route target group. Valid values:
Pending,Available. - Map<String,String>
- The tags of the route target group.
- vpc
Id String - The ID of the VPC to which the route target group belongs.
- config
Mode string - The configuration mode of the route target group.
- create
Time string - The time when the route target group was created.
- id string
- The ID of the resource supplied above.
- region
Id string - The region ID of the VPC to which the route target group belongs.
- resource
Group stringId - The ID of the resource group to which the route target group belongs.
- route
Target stringGroup Description - The description of the route target group.
- route
Target stringGroup Id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- route
Target stringGroup Name - The name of the route target group.
- route
Target GetMember Lists Route Target Groups Group Route Target Member List[] - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- status string
- The status of the route target group. Valid values:
Pending,Available. - {[key: string]: string}
- The tags of the route target group.
- vpc
Id string - The ID of the VPC to which the route target group belongs.
- config_
mode str - The configuration mode of the route target group.
- create_
time str - The time when the route target group was created.
- id str
- The ID of the resource supplied above.
- region_
id str - The region ID of the VPC to which the route target group belongs.
- resource_
group_ strid - The ID of the resource group to which the route target group belongs.
- route_
target_ strgroup_ description - The description of the route target group.
- route_
target_ strgroup_ id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- route_
target_ strgroup_ name - The name of the route target group.
- route_
target_ Sequence[Getmember_ lists Route Target Groups Group Route Target Member List] - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- status str
- The status of the route target group. Valid values:
Pending,Available. - Mapping[str, str]
- The tags of the route target group.
- vpc_
id str - The ID of the VPC to which the route target group belongs.
- config
Mode String - The configuration mode of the route target group.
- create
Time String - The time when the route target group was created.
- id String
- The ID of the resource supplied above.
- region
Id String - The region ID of the VPC to which the route target group belongs.
- resource
Group StringId - The ID of the resource group to which the route target group belongs.
- route
Target StringGroup Description - The description of the route target group.
- route
Target StringGroup Id - The ID of the route target group. A maximum of 50 instance IDs can be specified in a single query.
- route
Target StringGroup Name - The name of the route target group.
- route
Target List<Property Map>Member Lists - The member list of the route target group.
In active/standby mode, the following restrictions apply to route target group members:
- The route target group must contain exactly two members.
- The route target group members must belong to different zones. See
routeTargetMemberListbelow.
- status String
- The status of the route target group. Valid values:
Pending,Available. - Map<String>
- The tags of the route target group.
- vpc
Id String - The ID of the VPC to which the route target group belongs.
GetRouteTargetGroupsGroupRouteTargetMemberList
- Enable
Status string - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - Health
Check stringStatus - The health check status of the current route target configuration.
- Member
Id string - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- Member
Type string - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- Weight int
- Sets the weight attribute for the current route target configuration.
- Enable
Status string - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - Health
Check stringStatus - The health check status of the current route target configuration.
- Member
Id string - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- Member
Type string - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- Weight int
- Sets the weight attribute for the current route target configuration.
- enable_
status string - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - health_
check_ stringstatus - The health check status of the current route target configuration.
- member_
id string - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- member_
type string - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- weight number
- Sets the weight attribute for the current route target configuration.
- enable
Status String - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - health
Check StringStatus - The health check status of the current route target configuration.
- member
Id String - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- member
Type String - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- weight Integer
- Sets the weight attribute for the current route target configuration.
- enable
Status string - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - health
Check stringStatus - The health check status of the current route target configuration.
- member
Id string - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- member
Type string - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- weight number
- Sets the weight attribute for the current route target configuration.
- enable_
status str - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - health_
check_ strstatus - The health check status of the current route target configuration.
- member_
id str - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- member_
type str - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- weight int
- Sets the weight attribute for the current route target configuration.
- enable
Status String - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - health
Check StringStatus - The health check status of the current route target configuration.
- member
Id String - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- member
Type String - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- weight Number
- Sets the weight attribute for the current route target configuration.
GetRouteTargetGroupsRouteTargetMemberList
- Enable
Status string - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - Health
Check stringStatus - The health check status of the current route target configuration.
- Member
Id string - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- Member
Type string - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- Weight int
- Sets the weight attribute for the current route target configuration.
- Enable
Status string - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - Health
Check stringStatus - The health check status of the current route target configuration.
- Member
Id string - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- Member
Type string - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- Weight int
- Sets the weight attribute for the current route target configuration.
- enable_
status string - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - health_
check_ stringstatus - The health check status of the current route target configuration.
- member_
id string - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- member_
type string - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- weight number
- Sets the weight attribute for the current route target configuration.
- enable
Status String - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - health
Check StringStatus - The health check status of the current route target configuration.
- member
Id String - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- member
Type String - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- weight Integer
- Sets the weight attribute for the current route target configuration.
- enable
Status string - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - health
Check stringStatus - The health check status of the current route target configuration.
- member
Id string - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- member
Type string - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- weight number
- Sets the weight attribute for the current route target configuration.
- enable_
status str - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - health_
check_ strstatus - The health check status of the current route target configuration.
- member_
id str - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- member_
type str - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- weight int
- Sets the weight attribute for the current route target configuration.
- enable
Status String - Indicates the enable status of the current route target configuration. Valid values:
Enable,Disable. - health
Check StringStatus - The health check status of the current route target configuration.
- member
Id String - The instance ID of the route target member. Used to filter route target groups that contain the specified member.
- member
Type String - The instance type of the route target configuration. The following type is currently supported: GatewayLoadBalancerEndpoint.
- weight Number
- Sets the weight attribute for the current route target configuration.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi