tencentcloud.ClbTargetGroupAttachments
Explore with Pulumi AI
Provides a resource to create a clb target_group_attachments
This resource supports bidirectional binding (target group binding to the load balancer, load balancer binding to the target group). When choosing either the load balancer or the target group as the binding target, up to 20 combinations can be bound at most.
Example Usage
Load balancer binding to the target group
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const targetGroupAttachments = new tencentcloud.ClbTargetGroupAttachments("targetGroupAttachments", {
associations: [{
listenerId: "lbl-m2q6sp9m",
locationId: "loc-jjqr0ric",
targetGroupId: "lbtg-5xunivs0",
}],
loadBalancerId: "lb-phbx2420",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
target_group_attachments = tencentcloud.ClbTargetGroupAttachments("targetGroupAttachments",
associations=[{
"listener_id": "lbl-m2q6sp9m",
"location_id": "loc-jjqr0ric",
"target_group_id": "lbtg-5xunivs0",
}],
load_balancer_id="lb-phbx2420")
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.NewClbTargetGroupAttachments(ctx, "targetGroupAttachments", &tencentcloud.ClbTargetGroupAttachmentsArgs{
Associations: tencentcloud.ClbTargetGroupAttachmentsAssociationArray{
&tencentcloud.ClbTargetGroupAttachmentsAssociationArgs{
ListenerId: pulumi.String("lbl-m2q6sp9m"),
LocationId: pulumi.String("loc-jjqr0ric"),
TargetGroupId: pulumi.String("lbtg-5xunivs0"),
},
},
LoadBalancerId: pulumi.String("lb-phbx2420"),
})
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 targetGroupAttachments = new Tencentcloud.ClbTargetGroupAttachments("targetGroupAttachments", new()
{
Associations = new[]
{
new Tencentcloud.Inputs.ClbTargetGroupAttachmentsAssociationArgs
{
ListenerId = "lbl-m2q6sp9m",
LocationId = "loc-jjqr0ric",
TargetGroupId = "lbtg-5xunivs0",
},
},
LoadBalancerId = "lb-phbx2420",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ClbTargetGroupAttachments;
import com.pulumi.tencentcloud.ClbTargetGroupAttachmentsArgs;
import com.pulumi.tencentcloud.inputs.ClbTargetGroupAttachmentsAssociationArgs;
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 targetGroupAttachments = new ClbTargetGroupAttachments("targetGroupAttachments", ClbTargetGroupAttachmentsArgs.builder()
.associations(ClbTargetGroupAttachmentsAssociationArgs.builder()
.listenerId("lbl-m2q6sp9m")
.locationId("loc-jjqr0ric")
.targetGroupId("lbtg-5xunivs0")
.build())
.loadBalancerId("lb-phbx2420")
.build());
}
}
resources:
targetGroupAttachments:
type: tencentcloud:ClbTargetGroupAttachments
properties:
associations:
- listenerId: lbl-m2q6sp9m
locationId: loc-jjqr0ric
targetGroupId: lbtg-5xunivs0
loadBalancerId: lb-phbx2420
Target group binding to the load balancer
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const targetGroupAttachments = new tencentcloud.ClbTargetGroupAttachments("targetGroupAttachments", {
associations: [{
listenerId: "lbl-m2q6sp9m",
loadBalancerId: "lb-phbx2420",
locationId: "loc-jjqr0ric",
}],
targetGroupId: "lbtg-5xunivs0",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
target_group_attachments = tencentcloud.ClbTargetGroupAttachments("targetGroupAttachments",
associations=[{
"listener_id": "lbl-m2q6sp9m",
"load_balancer_id": "lb-phbx2420",
"location_id": "loc-jjqr0ric",
}],
target_group_id="lbtg-5xunivs0")
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.NewClbTargetGroupAttachments(ctx, "targetGroupAttachments", &tencentcloud.ClbTargetGroupAttachmentsArgs{
Associations: tencentcloud.ClbTargetGroupAttachmentsAssociationArray{
&tencentcloud.ClbTargetGroupAttachmentsAssociationArgs{
ListenerId: pulumi.String("lbl-m2q6sp9m"),
LoadBalancerId: pulumi.String("lb-phbx2420"),
LocationId: pulumi.String("loc-jjqr0ric"),
},
},
TargetGroupId: pulumi.String("lbtg-5xunivs0"),
})
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 targetGroupAttachments = new Tencentcloud.ClbTargetGroupAttachments("targetGroupAttachments", new()
{
Associations = new[]
{
new Tencentcloud.Inputs.ClbTargetGroupAttachmentsAssociationArgs
{
ListenerId = "lbl-m2q6sp9m",
LoadBalancerId = "lb-phbx2420",
LocationId = "loc-jjqr0ric",
},
},
TargetGroupId = "lbtg-5xunivs0",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ClbTargetGroupAttachments;
import com.pulumi.tencentcloud.ClbTargetGroupAttachmentsArgs;
import com.pulumi.tencentcloud.inputs.ClbTargetGroupAttachmentsAssociationArgs;
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 targetGroupAttachments = new ClbTargetGroupAttachments("targetGroupAttachments", ClbTargetGroupAttachmentsArgs.builder()
.associations(ClbTargetGroupAttachmentsAssociationArgs.builder()
.listenerId("lbl-m2q6sp9m")
.loadBalancerId("lb-phbx2420")
.locationId("loc-jjqr0ric")
.build())
.targetGroupId("lbtg-5xunivs0")
.build());
}
}
resources:
targetGroupAttachments:
type: tencentcloud:ClbTargetGroupAttachments
properties:
associations:
- listenerId: lbl-m2q6sp9m
loadBalancerId: lb-phbx2420
locationId: loc-jjqr0ric
targetGroupId: lbtg-5xunivs0
Create ClbTargetGroupAttachments Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ClbTargetGroupAttachments(name: string, args: ClbTargetGroupAttachmentsArgs, opts?: CustomResourceOptions);
@overload
def ClbTargetGroupAttachments(resource_name: str,
args: ClbTargetGroupAttachmentsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ClbTargetGroupAttachments(resource_name: str,
opts: Optional[ResourceOptions] = None,
associations: Optional[Sequence[ClbTargetGroupAttachmentsAssociationArgs]] = None,
clb_target_group_attachments_id: Optional[str] = None,
load_balancer_id: Optional[str] = None,
target_group_id: Optional[str] = None)
func NewClbTargetGroupAttachments(ctx *Context, name string, args ClbTargetGroupAttachmentsArgs, opts ...ResourceOption) (*ClbTargetGroupAttachments, error)
public ClbTargetGroupAttachments(string name, ClbTargetGroupAttachmentsArgs args, CustomResourceOptions? opts = null)
public ClbTargetGroupAttachments(String name, ClbTargetGroupAttachmentsArgs args)
public ClbTargetGroupAttachments(String name, ClbTargetGroupAttachmentsArgs args, CustomResourceOptions options)
type: tencentcloud:ClbTargetGroupAttachments
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 ClbTargetGroupAttachmentsArgs
- 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 ClbTargetGroupAttachmentsArgs
- 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 ClbTargetGroupAttachmentsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ClbTargetGroupAttachmentsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ClbTargetGroupAttachmentsArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ClbTargetGroupAttachments 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 ClbTargetGroupAttachments resource accepts the following input properties:
- Associations
List<Clb
Target Group Attachments Association> - Association array, the combination cannot exceed 20.
- Clb
Target stringGroup Attachments Id - ID of the resource.
- Load
Balancer stringId - CLB instance ID, (load_balancer_id and target_group_id require at least one).
- Target
Group stringId - Target group ID, (load_balancer_id and target_group_id require at least one).
- Associations
[]Clb
Target Group Attachments Association Args - Association array, the combination cannot exceed 20.
- Clb
Target stringGroup Attachments Id - ID of the resource.
- Load
Balancer stringId - CLB instance ID, (load_balancer_id and target_group_id require at least one).
- Target
Group stringId - Target group ID, (load_balancer_id and target_group_id require at least one).
- associations
List<Clb
Target Group Attachments Association> - Association array, the combination cannot exceed 20.
- clb
Target StringGroup Attachments Id - ID of the resource.
- load
Balancer StringId - CLB instance ID, (load_balancer_id and target_group_id require at least one).
- target
Group StringId - Target group ID, (load_balancer_id and target_group_id require at least one).
- associations
Clb
Target Group Attachments Association[] - Association array, the combination cannot exceed 20.
- clb
Target stringGroup Attachments Id - ID of the resource.
- load
Balancer stringId - CLB instance ID, (load_balancer_id and target_group_id require at least one).
- target
Group stringId - Target group ID, (load_balancer_id and target_group_id require at least one).
- associations
Sequence[Clb
Target Group Attachments Association Args] - Association array, the combination cannot exceed 20.
- clb_
target_ strgroup_ attachments_ id - ID of the resource.
- load_
balancer_ strid - CLB instance ID, (load_balancer_id and target_group_id require at least one).
- target_
group_ strid - Target group ID, (load_balancer_id and target_group_id require at least one).
- associations List<Property Map>
- Association array, the combination cannot exceed 20.
- clb
Target StringGroup Attachments Id - ID of the resource.
- load
Balancer StringId - CLB instance ID, (load_balancer_id and target_group_id require at least one).
- target
Group StringId - Target group ID, (load_balancer_id and target_group_id require at least one).
Outputs
All input properties are implicitly available as output properties. Additionally, the ClbTargetGroupAttachments 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 ClbTargetGroupAttachments Resource
Get an existing ClbTargetGroupAttachments 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?: ClbTargetGroupAttachmentsState, opts?: CustomResourceOptions): ClbTargetGroupAttachments
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
associations: Optional[Sequence[ClbTargetGroupAttachmentsAssociationArgs]] = None,
clb_target_group_attachments_id: Optional[str] = None,
load_balancer_id: Optional[str] = None,
target_group_id: Optional[str] = None) -> ClbTargetGroupAttachments
func GetClbTargetGroupAttachments(ctx *Context, name string, id IDInput, state *ClbTargetGroupAttachmentsState, opts ...ResourceOption) (*ClbTargetGroupAttachments, error)
public static ClbTargetGroupAttachments Get(string name, Input<string> id, ClbTargetGroupAttachmentsState? state, CustomResourceOptions? opts = null)
public static ClbTargetGroupAttachments get(String name, Output<String> id, ClbTargetGroupAttachmentsState state, CustomResourceOptions options)
resources: _: type: tencentcloud:ClbTargetGroupAttachments 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.
- Associations
List<Clb
Target Group Attachments Association> - Association array, the combination cannot exceed 20.
- Clb
Target stringGroup Attachments Id - ID of the resource.
- Load
Balancer stringId - CLB instance ID, (load_balancer_id and target_group_id require at least one).
- Target
Group stringId - Target group ID, (load_balancer_id and target_group_id require at least one).
- Associations
[]Clb
Target Group Attachments Association Args - Association array, the combination cannot exceed 20.
- Clb
Target stringGroup Attachments Id - ID of the resource.
- Load
Balancer stringId - CLB instance ID, (load_balancer_id and target_group_id require at least one).
- Target
Group stringId - Target group ID, (load_balancer_id and target_group_id require at least one).
- associations
List<Clb
Target Group Attachments Association> - Association array, the combination cannot exceed 20.
- clb
Target StringGroup Attachments Id - ID of the resource.
- load
Balancer StringId - CLB instance ID, (load_balancer_id and target_group_id require at least one).
- target
Group StringId - Target group ID, (load_balancer_id and target_group_id require at least one).
- associations
Clb
Target Group Attachments Association[] - Association array, the combination cannot exceed 20.
- clb
Target stringGroup Attachments Id - ID of the resource.
- load
Balancer stringId - CLB instance ID, (load_balancer_id and target_group_id require at least one).
- target
Group stringId - Target group ID, (load_balancer_id and target_group_id require at least one).
- associations
Sequence[Clb
Target Group Attachments Association Args] - Association array, the combination cannot exceed 20.
- clb_
target_ strgroup_ attachments_ id - ID of the resource.
- load_
balancer_ strid - CLB instance ID, (load_balancer_id and target_group_id require at least one).
- target_
group_ strid - Target group ID, (load_balancer_id and target_group_id require at least one).
- associations List<Property Map>
- Association array, the combination cannot exceed 20.
- clb
Target StringGroup Attachments Id - ID of the resource.
- load
Balancer StringId - CLB instance ID, (load_balancer_id and target_group_id require at least one).
- target
Group StringId - Target group ID, (load_balancer_id and target_group_id require at least one).
Supporting Types
ClbTargetGroupAttachmentsAssociation, ClbTargetGroupAttachmentsAssociationArgs
- Listener
Id string - Listener ID.
- Load
Balancer stringId - CLB instance ID, when the binding target is target group, load_balancer_id in associations is required.
- Location
Id string - Forwarding rule ID.
- Target
Group stringId - Target group ID, when the binding target is clb, the target_group_id in associations is required.
- Listener
Id string - Listener ID.
- Load
Balancer stringId - CLB instance ID, when the binding target is target group, load_balancer_id in associations is required.
- Location
Id string - Forwarding rule ID.
- Target
Group stringId - Target group ID, when the binding target is clb, the target_group_id in associations is required.
- listener
Id String - Listener ID.
- load
Balancer StringId - CLB instance ID, when the binding target is target group, load_balancer_id in associations is required.
- location
Id String - Forwarding rule ID.
- target
Group StringId - Target group ID, when the binding target is clb, the target_group_id in associations is required.
- listener
Id string - Listener ID.
- load
Balancer stringId - CLB instance ID, when the binding target is target group, load_balancer_id in associations is required.
- location
Id string - Forwarding rule ID.
- target
Group stringId - Target group ID, when the binding target is clb, the target_group_id in associations is required.
- listener_
id str - Listener ID.
- load_
balancer_ strid - CLB instance ID, when the binding target is target group, load_balancer_id in associations is required.
- location_
id str - Forwarding rule ID.
- target_
group_ strid - Target group ID, when the binding target is clb, the target_group_id in associations is required.
- listener
Id String - Listener ID.
- load
Balancer StringId - CLB instance ID, when the binding target is target group, load_balancer_id in associations is required.
- location
Id String - Forwarding rule ID.
- target
Group StringId - Target group ID, when the binding target is clb, the target_group_id in associations is required.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.