tencentcloud.AlbServerAttachment
Explore with Pulumi AI
Provides an tencentcloud application load balancer servers attachment as a resource, to attach and detach instances from load balancer.
NOTE: It has been deprecated and replaced by
tencentcloud.ClbAttachment
.
NOTE: Currently only support existing
loadbalancer_id
listener_id
location_id
and Application layer 7 load balancer
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const service1 = new tencentcloud.AlbServerAttachment("service1", {
backends: [
{
instanceId: "ins-4j30i5pe",
port: 80,
weight: 50,
},
{
instanceId: "ins-4j30i5pe",
port: 8080,
weight: 50,
},
],
listenerId: "lbl-ghoke4tl",
loadbalancerId: "lb-qk1dqox5",
locationId: "loc-i858qv1l",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
service1 = tencentcloud.AlbServerAttachment("service1",
backends=[
{
"instance_id": "ins-4j30i5pe",
"port": 80,
"weight": 50,
},
{
"instance_id": "ins-4j30i5pe",
"port": 8080,
"weight": 50,
},
],
listener_id="lbl-ghoke4tl",
loadbalancer_id="lb-qk1dqox5",
location_id="loc-i858qv1l")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewAlbServerAttachment(ctx, "service1", &tencentcloud.AlbServerAttachmentArgs{
Backends: tencentcloud.AlbServerAttachmentBackendArray{
&tencentcloud.AlbServerAttachmentBackendArgs{
InstanceId: pulumi.String("ins-4j30i5pe"),
Port: pulumi.Float64(80),
Weight: pulumi.Float64(50),
},
&tencentcloud.AlbServerAttachmentBackendArgs{
InstanceId: pulumi.String("ins-4j30i5pe"),
Port: pulumi.Float64(8080),
Weight: pulumi.Float64(50),
},
},
ListenerId: pulumi.String("lbl-ghoke4tl"),
LoadbalancerId: pulumi.String("lb-qk1dqox5"),
LocationId: pulumi.String("loc-i858qv1l"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var service1 = new Tencentcloud.AlbServerAttachment("service1", new()
{
Backends = new[]
{
new Tencentcloud.Inputs.AlbServerAttachmentBackendArgs
{
InstanceId = "ins-4j30i5pe",
Port = 80,
Weight = 50,
},
new Tencentcloud.Inputs.AlbServerAttachmentBackendArgs
{
InstanceId = "ins-4j30i5pe",
Port = 8080,
Weight = 50,
},
},
ListenerId = "lbl-ghoke4tl",
LoadbalancerId = "lb-qk1dqox5",
LocationId = "loc-i858qv1l",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.AlbServerAttachment;
import com.pulumi.tencentcloud.AlbServerAttachmentArgs;
import com.pulumi.tencentcloud.inputs.AlbServerAttachmentBackendArgs;
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) {
var service1 = new AlbServerAttachment("service1", AlbServerAttachmentArgs.builder()
.backends(
AlbServerAttachmentBackendArgs.builder()
.instanceId("ins-4j30i5pe")
.port(80)
.weight(50)
.build(),
AlbServerAttachmentBackendArgs.builder()
.instanceId("ins-4j30i5pe")
.port(8080)
.weight(50)
.build())
.listenerId("lbl-ghoke4tl")
.loadbalancerId("lb-qk1dqox5")
.locationId("loc-i858qv1l")
.build());
}
}
resources:
service1:
type: tencentcloud:AlbServerAttachment
properties:
backends:
- instanceId: ins-4j30i5pe
port: 80
weight: 50
- instanceId: ins-4j30i5pe
port: 8080
weight: 50
listenerId: lbl-ghoke4tl
loadbalancerId: lb-qk1dqox5
locationId: loc-i858qv1l
Create AlbServerAttachment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AlbServerAttachment(name: string, args: AlbServerAttachmentArgs, opts?: CustomResourceOptions);
@overload
def AlbServerAttachment(resource_name: str,
args: AlbServerAttachmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AlbServerAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
backends: Optional[Sequence[AlbServerAttachmentBackendArgs]] = None,
listener_id: Optional[str] = None,
loadbalancer_id: Optional[str] = None,
alb_server_attachment_id: Optional[str] = None,
location_id: Optional[str] = None)
func NewAlbServerAttachment(ctx *Context, name string, args AlbServerAttachmentArgs, opts ...ResourceOption) (*AlbServerAttachment, error)
public AlbServerAttachment(string name, AlbServerAttachmentArgs args, CustomResourceOptions? opts = null)
public AlbServerAttachment(String name, AlbServerAttachmentArgs args)
public AlbServerAttachment(String name, AlbServerAttachmentArgs args, CustomResourceOptions options)
type: tencentcloud:AlbServerAttachment
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 AlbServerAttachmentArgs
- 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 AlbServerAttachmentArgs
- 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 AlbServerAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AlbServerAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AlbServerAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
AlbServerAttachment 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 AlbServerAttachment resource accepts the following input properties:
- Backends
List<Alb
Server Attachment Backend> - list of backend server.
- Listener
Id string - listener ID.
- Loadbalancer
Id string - loadbalancer ID.
- Alb
Server stringAttachment Id - ID of the resource.
- Location
Id string - location ID, only support for layer 7 loadbalancer.
- Backends
[]Alb
Server Attachment Backend Args - list of backend server.
- Listener
Id string - listener ID.
- Loadbalancer
Id string - loadbalancer ID.
- Alb
Server stringAttachment Id - ID of the resource.
- Location
Id string - location ID, only support for layer 7 loadbalancer.
- backends
List<Alb
Server Attachment Backend> - list of backend server.
- listener
Id String - listener ID.
- loadbalancer
Id String - loadbalancer ID.
- alb
Server StringAttachment Id - ID of the resource.
- location
Id String - location ID, only support for layer 7 loadbalancer.
- backends
Alb
Server Attachment Backend[] - list of backend server.
- listener
Id string - listener ID.
- loadbalancer
Id string - loadbalancer ID.
- alb
Server stringAttachment Id - ID of the resource.
- location
Id string - location ID, only support for layer 7 loadbalancer.
- backends
Sequence[Alb
Server Attachment Backend Args] - list of backend server.
- listener_
id str - listener ID.
- loadbalancer_
id str - loadbalancer ID.
- alb_
server_ strattachment_ id - ID of the resource.
- location_
id str - location ID, only support for layer 7 loadbalancer.
- backends List<Property Map>
- list of backend server.
- listener
Id String - listener ID.
- loadbalancer
Id String - loadbalancer ID.
- alb
Server StringAttachment Id - ID of the resource.
- location
Id String - location ID, only support for layer 7 loadbalancer.
Outputs
All input properties are implicitly available as output properties. Additionally, the AlbServerAttachment resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Protocol
Type string - The protocol type, http or tcp.
- Id string
- The provider-assigned unique ID for this managed resource.
- Protocol
Type string - The protocol type, http or tcp.
- id String
- The provider-assigned unique ID for this managed resource.
- protocol
Type String - The protocol type, http or tcp.
- id string
- The provider-assigned unique ID for this managed resource.
- protocol
Type string - The protocol type, http or tcp.
- id str
- The provider-assigned unique ID for this managed resource.
- protocol_
type str - The protocol type, http or tcp.
- id String
- The provider-assigned unique ID for this managed resource.
- protocol
Type String - The protocol type, http or tcp.
Look up Existing AlbServerAttachment Resource
Get an existing AlbServerAttachment 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?: AlbServerAttachmentState, opts?: CustomResourceOptions): AlbServerAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
alb_server_attachment_id: Optional[str] = None,
backends: Optional[Sequence[AlbServerAttachmentBackendArgs]] = None,
listener_id: Optional[str] = None,
loadbalancer_id: Optional[str] = None,
location_id: Optional[str] = None,
protocol_type: Optional[str] = None) -> AlbServerAttachment
func GetAlbServerAttachment(ctx *Context, name string, id IDInput, state *AlbServerAttachmentState, opts ...ResourceOption) (*AlbServerAttachment, error)
public static AlbServerAttachment Get(string name, Input<string> id, AlbServerAttachmentState? state, CustomResourceOptions? opts = null)
public static AlbServerAttachment get(String name, Output<String> id, AlbServerAttachmentState state, CustomResourceOptions options)
resources: _: type: tencentcloud:AlbServerAttachment 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.
- Alb
Server stringAttachment Id - ID of the resource.
- Backends
List<Alb
Server Attachment Backend> - list of backend server.
- Listener
Id string - listener ID.
- Loadbalancer
Id string - loadbalancer ID.
- Location
Id string - location ID, only support for layer 7 loadbalancer.
- Protocol
Type string - The protocol type, http or tcp.
- Alb
Server stringAttachment Id - ID of the resource.
- Backends
[]Alb
Server Attachment Backend Args - list of backend server.
- Listener
Id string - listener ID.
- Loadbalancer
Id string - loadbalancer ID.
- Location
Id string - location ID, only support for layer 7 loadbalancer.
- Protocol
Type string - The protocol type, http or tcp.
- alb
Server StringAttachment Id - ID of the resource.
- backends
List<Alb
Server Attachment Backend> - list of backend server.
- listener
Id String - listener ID.
- loadbalancer
Id String - loadbalancer ID.
- location
Id String - location ID, only support for layer 7 loadbalancer.
- protocol
Type String - The protocol type, http or tcp.
- alb
Server stringAttachment Id - ID of the resource.
- backends
Alb
Server Attachment Backend[] - list of backend server.
- listener
Id string - listener ID.
- loadbalancer
Id string - loadbalancer ID.
- location
Id string - location ID, only support for layer 7 loadbalancer.
- protocol
Type string - The protocol type, http or tcp.
- alb_
server_ strattachment_ id - ID of the resource.
- backends
Sequence[Alb
Server Attachment Backend Args] - list of backend server.
- listener_
id str - listener ID.
- loadbalancer_
id str - loadbalancer ID.
- location_
id str - location ID, only support for layer 7 loadbalancer.
- protocol_
type str - The protocol type, http or tcp.
- alb
Server StringAttachment Id - ID of the resource.
- backends List<Property Map>
- list of backend server.
- listener
Id String - listener ID.
- loadbalancer
Id String - loadbalancer ID.
- location
Id String - location ID, only support for layer 7 loadbalancer.
- protocol
Type String - The protocol type, http or tcp.
Supporting Types
AlbServerAttachmentBackend, AlbServerAttachmentBackendArgs
- Instance
Id string - A list backend instance ID (CVM instance ID).
- Port double
- The port used by the backend server. Valid value range: [1-65535].
- Weight double
- Weight of the backend server. Valid value range: [0-100]. Default to 10.
- Instance
Id string - A list backend instance ID (CVM instance ID).
- Port float64
- The port used by the backend server. Valid value range: [1-65535].
- Weight float64
- Weight of the backend server. Valid value range: [0-100]. Default to 10.
- instance
Id String - A list backend instance ID (CVM instance ID).
- port Double
- The port used by the backend server. Valid value range: [1-65535].
- weight Double
- Weight of the backend server. Valid value range: [0-100]. Default to 10.
- instance
Id string - A list backend instance ID (CVM instance ID).
- port number
- The port used by the backend server. Valid value range: [1-65535].
- weight number
- Weight of the backend server. Valid value range: [0-100]. Default to 10.
- instance_
id str - A list backend instance ID (CVM instance ID).
- port float
- The port used by the backend server. Valid value range: [1-65535].
- weight float
- Weight of the backend server. Valid value range: [0-100]. Default to 10.
- instance
Id String - A list backend instance ID (CVM instance ID).
- port Number
- The port used by the backend server. Valid value range: [1-65535].
- weight Number
- Weight of the backend server. Valid value range: [0-100]. Default to 10.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.