alicloud.slb.ServerGroupServerAttachment
Explore with Pulumi AI
Provides a Load Balancer Virtual Backend Server Group Server Attachment resource.
NOTE: Available since v1.163.0.
For information about Load Balancer Virtual Backend Server Group Server Attachment and how to use it, see What is Virtual Backend Server Group Server Attachment.
NOTE: Applying this resource may conflict with applying
alicloud.slb.Listener
, and thealicloud.slb.Listener
block should usedepends_on = [alicloud_slb_server_group_server_attachment.xxx]
to avoid it.
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 _default = alicloud.slb.getZones({
availableSlbAddressType: "vpc",
});
const defaultGetInstanceTypes = _default.then(_default => alicloud.ecs.getInstanceTypes({
availabilityZone: _default.zones?.[0]?.id,
instanceTypeFamily: "ecs.sn1ne",
}));
const defaultGetImages = alicloud.ecs.getImages({
nameRegex: "^ubuntu_[0-9]+_[0-9]+_x64*",
mostRecent: true,
owners: "system",
});
const defaultNetwork = new alicloud.vpc.Network("default", {
vpcName: name,
cidrBlock: "192.168.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
vswitchName: name,
vpcId: defaultNetwork.id,
cidrBlock: "192.168.192.0/24",
zoneId: _default.then(_default => _default.zones?.[0]?.id),
});
const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {
name: name,
vpcId: defaultNetwork.id,
});
const defaultApplicationLoadBalancer = new alicloud.slb.ApplicationLoadBalancer("default", {
loadBalancerName: name,
vswitchId: defaultSwitch.id,
loadBalancerSpec: "slb.s2.small",
addressType: "intranet",
});
const defaultServerGroup = new alicloud.slb.ServerGroup("default", {
loadBalancerId: defaultApplicationLoadBalancer.id,
name: name,
});
const defaultInstance = new alicloud.ecs.Instance("default", {
imageId: defaultGetImages.then(defaultGetImages => defaultGetImages.images?.[0]?.id),
instanceType: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.instanceTypes?.[0]?.id),
instanceName: name,
securityGroups: [defaultSecurityGroup].map(__item => __item.id),
internetChargeType: "PayByTraffic",
internetMaxBandwidthOut: 10,
availabilityZone: _default.then(_default => _default.zones?.[0]?.id),
instanceChargeType: "PostPaid",
systemDiskCategory: "cloud_efficiency",
vswitchId: defaultSwitch.id,
});
const serverAttachment = new alicloud.slb.ServerGroupServerAttachment("server_attachment", {
serverGroupId: defaultServerGroup.id,
serverId: defaultInstance.id,
port: 8080,
type: "ecs",
weight: 0,
description: name,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.slb.get_zones(available_slb_address_type="vpc")
default_get_instance_types = alicloud.ecs.get_instance_types(availability_zone=default.zones[0].id,
instance_type_family="ecs.sn1ne")
default_get_images = alicloud.ecs.get_images(name_regex="^ubuntu_[0-9]+_[0-9]+_x64*",
most_recent=True,
owners="system")
default_network = alicloud.vpc.Network("default",
vpc_name=name,
cidr_block="192.168.0.0/16")
default_switch = alicloud.vpc.Switch("default",
vswitch_name=name,
vpc_id=default_network.id,
cidr_block="192.168.192.0/24",
zone_id=default.zones[0].id)
default_security_group = alicloud.ecs.SecurityGroup("default",
name=name,
vpc_id=default_network.id)
default_application_load_balancer = alicloud.slb.ApplicationLoadBalancer("default",
load_balancer_name=name,
vswitch_id=default_switch.id,
load_balancer_spec="slb.s2.small",
address_type="intranet")
default_server_group = alicloud.slb.ServerGroup("default",
load_balancer_id=default_application_load_balancer.id,
name=name)
default_instance = alicloud.ecs.Instance("default",
image_id=default_get_images.images[0].id,
instance_type=default_get_instance_types.instance_types[0].id,
instance_name=name,
security_groups=[__item.id for __item in [default_security_group]],
internet_charge_type="PayByTraffic",
internet_max_bandwidth_out=10,
availability_zone=default.zones[0].id,
instance_charge_type="PostPaid",
system_disk_category="cloud_efficiency",
vswitch_id=default_switch.id)
server_attachment = alicloud.slb.ServerGroupServerAttachment("server_attachment",
server_group_id=default_server_group.id,
server_id=default_instance.id,
port=8080,
type="ecs",
weight=0,
description=name)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/slb"
"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
}
_default, err := slb.GetZones(ctx, &slb.GetZonesArgs{
AvailableSlbAddressType: pulumi.StringRef("vpc"),
}, nil);
if err != nil {
return err
}
defaultGetInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
AvailabilityZone: pulumi.StringRef(_default.Zones[0].Id),
InstanceTypeFamily: pulumi.StringRef("ecs.sn1ne"),
}, nil);
if err != nil {
return err
}
defaultGetImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
NameRegex: pulumi.StringRef("^ubuntu_[0-9]+_[0-9]+_x64*"),
MostRecent: pulumi.BoolRef(true),
Owners: pulumi.StringRef("system"),
}, nil);
if err != nil {
return err
}
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
}
defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
VswitchName: pulumi.String(name),
VpcId: defaultNetwork.ID(),
CidrBlock: pulumi.String("192.168.192.0/24"),
ZoneId: pulumi.String(_default.Zones[0].Id),
})
if err != nil {
return err
}
defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "default", &ecs.SecurityGroupArgs{
Name: pulumi.String(name),
VpcId: defaultNetwork.ID(),
})
if err != nil {
return err
}
defaultApplicationLoadBalancer, err := slb.NewApplicationLoadBalancer(ctx, "default", &slb.ApplicationLoadBalancerArgs{
LoadBalancerName: pulumi.String(name),
VswitchId: defaultSwitch.ID(),
LoadBalancerSpec: pulumi.String("slb.s2.small"),
AddressType: pulumi.String("intranet"),
})
if err != nil {
return err
}
defaultServerGroup, err := slb.NewServerGroup(ctx, "default", &slb.ServerGroupArgs{
LoadBalancerId: defaultApplicationLoadBalancer.ID(),
Name: pulumi.String(name),
})
if err != nil {
return err
}
var splat0 pulumi.StringArray
for _, val0 := range %!v(PANIC=Format method: fatal: An assertion has failed: tok: ) {
splat0 = append(splat0, val0.ID())
}
defaultInstance, err := ecs.NewInstance(ctx, "default", &ecs.InstanceArgs{
ImageId: pulumi.String(defaultGetImages.Images[0].Id),
InstanceType: pulumi.String(defaultGetInstanceTypes.InstanceTypes[0].Id),
InstanceName: pulumi.String(name),
SecurityGroups: splat0,
InternetChargeType: pulumi.String("PayByTraffic"),
InternetMaxBandwidthOut: pulumi.Int(10),
AvailabilityZone: pulumi.String(_default.Zones[0].Id),
InstanceChargeType: pulumi.String("PostPaid"),
SystemDiskCategory: pulumi.String("cloud_efficiency"),
VswitchId: defaultSwitch.ID(),
})
if err != nil {
return err
}
_, err = slb.NewServerGroupServerAttachment(ctx, "server_attachment", &slb.ServerGroupServerAttachmentArgs{
ServerGroupId: defaultServerGroup.ID(),
ServerId: defaultInstance.ID(),
Port: pulumi.Int(8080),
Type: pulumi.String("ecs"),
Weight: pulumi.Int(0),
Description: pulumi.String(name),
})
if err != nil {
return err
}
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 @default = AliCloud.Slb.GetZones.Invoke(new()
{
AvailableSlbAddressType = "vpc",
});
var defaultGetInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
{
AvailabilityZone = @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
InstanceTypeFamily = "ecs.sn1ne",
});
var defaultGetImages = AliCloud.Ecs.GetImages.Invoke(new()
{
NameRegex = "^ubuntu_[0-9]+_[0-9]+_x64*",
MostRecent = true,
Owners = "system",
});
var defaultNetwork = new AliCloud.Vpc.Network("default", new()
{
VpcName = name,
CidrBlock = "192.168.0.0/16",
});
var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
{
VswitchName = name,
VpcId = defaultNetwork.Id,
CidrBlock = "192.168.192.0/24",
ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
});
var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("default", new()
{
Name = name,
VpcId = defaultNetwork.Id,
});
var defaultApplicationLoadBalancer = new AliCloud.Slb.ApplicationLoadBalancer("default", new()
{
LoadBalancerName = name,
VswitchId = defaultSwitch.Id,
LoadBalancerSpec = "slb.s2.small",
AddressType = "intranet",
});
var defaultServerGroup = new AliCloud.Slb.ServerGroup("default", new()
{
LoadBalancerId = defaultApplicationLoadBalancer.Id,
Name = name,
});
var defaultInstance = new AliCloud.Ecs.Instance("default", new()
{
ImageId = defaultGetImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
InstanceName = name,
SecurityGroups = new[]
{
defaultSecurityGroup,
}.Select(__item => __item.Id).ToList(),
InternetChargeType = "PayByTraffic",
InternetMaxBandwidthOut = 10,
AvailabilityZone = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
InstanceChargeType = "PostPaid",
SystemDiskCategory = "cloud_efficiency",
VswitchId = defaultSwitch.Id,
});
var serverAttachment = new AliCloud.Slb.ServerGroupServerAttachment("server_attachment", new()
{
ServerGroupId = defaultServerGroup.Id,
ServerId = defaultInstance.Id,
Port = 8080,
Type = "ecs",
Weight = 0,
Description = name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.slb.SlbFunctions;
import com.pulumi.alicloud.slb.inputs.GetZonesArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
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.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.slb.ApplicationLoadBalancer;
import com.pulumi.alicloud.slb.ApplicationLoadBalancerArgs;
import com.pulumi.alicloud.slb.ServerGroup;
import com.pulumi.alicloud.slb.ServerGroupArgs;
import com.pulumi.alicloud.ecs.Instance;
import com.pulumi.alicloud.ecs.InstanceArgs;
import com.pulumi.alicloud.slb.ServerGroupServerAttachment;
import com.pulumi.alicloud.slb.ServerGroupServerAttachmentArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
final var default = SlbFunctions.getZones(GetZonesArgs.builder()
.availableSlbAddressType("vpc")
.build());
final var defaultGetInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.availabilityZone(default_.zones()[0].id())
.instanceTypeFamily("ecs.sn1ne")
.build());
final var defaultGetImages = EcsFunctions.getImages(GetImagesArgs.builder()
.nameRegex("^ubuntu_[0-9]+_[0-9]+_x64*")
.mostRecent(true)
.owners("system")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("192.168.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(name)
.vpcId(defaultNetwork.id())
.cidrBlock("192.168.192.0/24")
.zoneId(default_.zones()[0].id())
.build());
var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
.name(name)
.vpcId(defaultNetwork.id())
.build());
var defaultApplicationLoadBalancer = new ApplicationLoadBalancer("defaultApplicationLoadBalancer", ApplicationLoadBalancerArgs.builder()
.loadBalancerName(name)
.vswitchId(defaultSwitch.id())
.loadBalancerSpec("slb.s2.small")
.addressType("intranet")
.build());
var defaultServerGroup = new ServerGroup("defaultServerGroup", ServerGroupArgs.builder()
.loadBalancerId(defaultApplicationLoadBalancer.id())
.name(name)
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.imageId(defaultGetImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
.instanceName(name)
.securityGroups(defaultSecurityGroup.stream().map(element -> element.id()).collect(toList()))
.internetChargeType("PayByTraffic")
.internetMaxBandwidthOut("10")
.availabilityZone(default_.zones()[0].id())
.instanceChargeType("PostPaid")
.systemDiskCategory("cloud_efficiency")
.vswitchId(defaultSwitch.id())
.build());
var serverAttachment = new ServerGroupServerAttachment("serverAttachment", ServerGroupServerAttachmentArgs.builder()
.serverGroupId(defaultServerGroup.id())
.serverId(defaultInstance.id())
.port(8080)
.type("ecs")
.weight(0)
.description(name)
.build());
}
}
Coming soon!
Create ServerGroupServerAttachment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ServerGroupServerAttachment(name: string, args: ServerGroupServerAttachmentArgs, opts?: CustomResourceOptions);
@overload
def ServerGroupServerAttachment(resource_name: str,
args: ServerGroupServerAttachmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ServerGroupServerAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
port: Optional[int] = None,
server_group_id: Optional[str] = None,
server_id: Optional[str] = None,
description: Optional[str] = None,
type: Optional[str] = None,
weight: Optional[int] = None)
func NewServerGroupServerAttachment(ctx *Context, name string, args ServerGroupServerAttachmentArgs, opts ...ResourceOption) (*ServerGroupServerAttachment, error)
public ServerGroupServerAttachment(string name, ServerGroupServerAttachmentArgs args, CustomResourceOptions? opts = null)
public ServerGroupServerAttachment(String name, ServerGroupServerAttachmentArgs args)
public ServerGroupServerAttachment(String name, ServerGroupServerAttachmentArgs args, CustomResourceOptions options)
type: alicloud:slb:ServerGroupServerAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ServerGroupServerAttachmentArgs
- 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 ServerGroupServerAttachmentArgs
- 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 ServerGroupServerAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServerGroupServerAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServerGroupServerAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var alicloudServerGroupServerAttachmentResource = new AliCloud.Slb.ServerGroupServerAttachment("alicloudServerGroupServerAttachmentResource", new()
{
Port = 0,
ServerGroupId = "string",
ServerId = "string",
Description = "string",
Type = "string",
Weight = 0,
});
example, err := slb.NewServerGroupServerAttachment(ctx, "alicloudServerGroupServerAttachmentResource", &slb.ServerGroupServerAttachmentArgs{
Port: pulumi.Int(0),
ServerGroupId: pulumi.String("string"),
ServerId: pulumi.String("string"),
Description: pulumi.String("string"),
Type: pulumi.String("string"),
Weight: pulumi.Int(0),
})
var alicloudServerGroupServerAttachmentResource = new com.pulumi.alicloud.slb.ServerGroupServerAttachment("alicloudServerGroupServerAttachmentResource", com.pulumi.alicloud.slb.ServerGroupServerAttachmentArgs.builder()
.port(0)
.serverGroupId("string")
.serverId("string")
.description("string")
.type("string")
.weight(0)
.build());
alicloud_server_group_server_attachment_resource = alicloud.slb.ServerGroupServerAttachment("alicloudServerGroupServerAttachmentResource",
port=0,
server_group_id="string",
server_id="string",
description="string",
type="string",
weight=0)
const alicloudServerGroupServerAttachmentResource = new alicloud.slb.ServerGroupServerAttachment("alicloudServerGroupServerAttachmentResource", {
port: 0,
serverGroupId: "string",
serverId: "string",
description: "string",
type: "string",
weight: 0,
});
type: alicloud:slb:ServerGroupServerAttachment
properties:
description: string
port: 0
serverGroupId: string
serverId: string
type: string
weight: 0
ServerGroupServerAttachment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ServerGroupServerAttachment resource accepts the following input properties:
- Port int
- The port that is used by the backend server. Valid values:
1
to65535
. - Server
Group stringId - The ID of the server group.
- Server
Id string - The ID of the backend server. You can specify the ID of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).
- Description string
- The description of the backend server.
- Type string
- The type of backend server. Valid values:
ecs
,eni
,eci
. NOTE: From version 1.246.0,type
can be set toeci
. - Weight int
- The weight of the backend server. Valid values:
0
to100
. Default value:100
. If the value is set to0
, no requests are forwarded to the backend server.
- Port int
- The port that is used by the backend server. Valid values:
1
to65535
. - Server
Group stringId - The ID of the server group.
- Server
Id string - The ID of the backend server. You can specify the ID of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).
- Description string
- The description of the backend server.
- Type string
- The type of backend server. Valid values:
ecs
,eni
,eci
. NOTE: From version 1.246.0,type
can be set toeci
. - Weight int
- The weight of the backend server. Valid values:
0
to100
. Default value:100
. If the value is set to0
, no requests are forwarded to the backend server.
- port Integer
- The port that is used by the backend server. Valid values:
1
to65535
. - server
Group StringId - The ID of the server group.
- server
Id String - The ID of the backend server. You can specify the ID of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).
- description String
- The description of the backend server.
- type String
- The type of backend server. Valid values:
ecs
,eni
,eci
. NOTE: From version 1.246.0,type
can be set toeci
. - weight Integer
- The weight of the backend server. Valid values:
0
to100
. Default value:100
. If the value is set to0
, no requests are forwarded to the backend server.
- port number
- The port that is used by the backend server. Valid values:
1
to65535
. - server
Group stringId - The ID of the server group.
- server
Id string - The ID of the backend server. You can specify the ID of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).
- description string
- The description of the backend server.
- type string
- The type of backend server. Valid values:
ecs
,eni
,eci
. NOTE: From version 1.246.0,type
can be set toeci
. - weight number
- The weight of the backend server. Valid values:
0
to100
. Default value:100
. If the value is set to0
, no requests are forwarded to the backend server.
- port int
- The port that is used by the backend server. Valid values:
1
to65535
. - server_
group_ strid - The ID of the server group.
- server_
id str - The ID of the backend server. You can specify the ID of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).
- description str
- The description of the backend server.
- type str
- The type of backend server. Valid values:
ecs
,eni
,eci
. NOTE: From version 1.246.0,type
can be set toeci
. - weight int
- The weight of the backend server. Valid values:
0
to100
. Default value:100
. If the value is set to0
, no requests are forwarded to the backend server.
- port Number
- The port that is used by the backend server. Valid values:
1
to65535
. - server
Group StringId - The ID of the server group.
- server
Id String - The ID of the backend server. You can specify the ID of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).
- description String
- The description of the backend server.
- type String
- The type of backend server. Valid values:
ecs
,eni
,eci
. NOTE: From version 1.246.0,type
can be set toeci
. - weight Number
- The weight of the backend server. Valid values:
0
to100
. Default value:100
. If the value is set to0
, no requests are forwarded to the backend server.
Outputs
All input properties are implicitly available as output properties. Additionally, the ServerGroupServerAttachment resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ServerGroupServerAttachment Resource
Get an existing ServerGroupServerAttachment 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?: ServerGroupServerAttachmentState, opts?: CustomResourceOptions): ServerGroupServerAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
port: Optional[int] = None,
server_group_id: Optional[str] = None,
server_id: Optional[str] = None,
type: Optional[str] = None,
weight: Optional[int] = None) -> ServerGroupServerAttachment
func GetServerGroupServerAttachment(ctx *Context, name string, id IDInput, state *ServerGroupServerAttachmentState, opts ...ResourceOption) (*ServerGroupServerAttachment, error)
public static ServerGroupServerAttachment Get(string name, Input<string> id, ServerGroupServerAttachmentState? state, CustomResourceOptions? opts = null)
public static ServerGroupServerAttachment get(String name, Output<String> id, ServerGroupServerAttachmentState state, CustomResourceOptions options)
resources: _: type: alicloud:slb:ServerGroupServerAttachment get: id: ${id}
- 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.
- Description string
- The description of the backend server.
- Port int
- The port that is used by the backend server. Valid values:
1
to65535
. - Server
Group stringId - The ID of the server group.
- Server
Id string - The ID of the backend server. You can specify the ID of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).
- Type string
- The type of backend server. Valid values:
ecs
,eni
,eci
. NOTE: From version 1.246.0,type
can be set toeci
. - Weight int
- The weight of the backend server. Valid values:
0
to100
. Default value:100
. If the value is set to0
, no requests are forwarded to the backend server.
- Description string
- The description of the backend server.
- Port int
- The port that is used by the backend server. Valid values:
1
to65535
. - Server
Group stringId - The ID of the server group.
- Server
Id string - The ID of the backend server. You can specify the ID of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).
- Type string
- The type of backend server. Valid values:
ecs
,eni
,eci
. NOTE: From version 1.246.0,type
can be set toeci
. - Weight int
- The weight of the backend server. Valid values:
0
to100
. Default value:100
. If the value is set to0
, no requests are forwarded to the backend server.
- description String
- The description of the backend server.
- port Integer
- The port that is used by the backend server. Valid values:
1
to65535
. - server
Group StringId - The ID of the server group.
- server
Id String - The ID of the backend server. You can specify the ID of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).
- type String
- The type of backend server. Valid values:
ecs
,eni
,eci
. NOTE: From version 1.246.0,type
can be set toeci
. - weight Integer
- The weight of the backend server. Valid values:
0
to100
. Default value:100
. If the value is set to0
, no requests are forwarded to the backend server.
- description string
- The description of the backend server.
- port number
- The port that is used by the backend server. Valid values:
1
to65535
. - server
Group stringId - The ID of the server group.
- server
Id string - The ID of the backend server. You can specify the ID of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).
- type string
- The type of backend server. Valid values:
ecs
,eni
,eci
. NOTE: From version 1.246.0,type
can be set toeci
. - weight number
- The weight of the backend server. Valid values:
0
to100
. Default value:100
. If the value is set to0
, no requests are forwarded to the backend server.
- description str
- The description of the backend server.
- port int
- The port that is used by the backend server. Valid values:
1
to65535
. - server_
group_ strid - The ID of the server group.
- server_
id str - The ID of the backend server. You can specify the ID of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).
- type str
- The type of backend server. Valid values:
ecs
,eni
,eci
. NOTE: From version 1.246.0,type
can be set toeci
. - weight int
- The weight of the backend server. Valid values:
0
to100
. Default value:100
. If the value is set to0
, no requests are forwarded to the backend server.
- description String
- The description of the backend server.
- port Number
- The port that is used by the backend server. Valid values:
1
to65535
. - server
Group StringId - The ID of the server group.
- server
Id String - The ID of the backend server. You can specify the ID of an Elastic Compute Service (ECS) instance or an elastic network interface (ENI).
- type String
- The type of backend server. Valid values:
ecs
,eni
,eci
. NOTE: From version 1.246.0,type
can be set toeci
. - weight Number
- The weight of the backend server. Valid values:
0
to100
. Default value:100
. If the value is set to0
, no requests are forwarded to the backend server.
Import
Load Balancer Virtual Backend Server Group Server Attachment can be imported using the id, e.g.
$ pulumi import alicloud:slb/serverGroupServerAttachment:ServerGroupServerAttachment example <server_group_id>:<server_id>:<port>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.