1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. ClbAttachment
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.ClbAttachment

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a CLB attachment.

    NOTE: This resource is designed to manage the entire set of binding relationships associated with a particular CLB (Cloud Load Balancer). As such, it does not allow the simultaneous use of this resource for the same CLB across different contexts or environments.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.ClbAttachment("example", {
        clbId: "lb-k2zjp9lv",
        listenerId: "lbl-hh141sn9",
        ruleId: "loc-4xxr2cy7",
        targets: [{
            instanceId: "ins-1flbqyp8",
            port: 80,
            weight: 10,
        }],
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.ClbAttachment("example",
        clb_id="lb-k2zjp9lv",
        listener_id="lbl-hh141sn9",
        rule_id="loc-4xxr2cy7",
        targets=[{
            "instance_id": "ins-1flbqyp8",
            "port": 80,
            "weight": 10,
        }])
    
    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.NewClbAttachment(ctx, "example", &tencentcloud.ClbAttachmentArgs{
    			ClbId:      pulumi.String("lb-k2zjp9lv"),
    			ListenerId: pulumi.String("lbl-hh141sn9"),
    			RuleId:     pulumi.String("loc-4xxr2cy7"),
    			Targets: tencentcloud.ClbAttachmentTargetArray{
    				&tencentcloud.ClbAttachmentTargetArgs{
    					InstanceId: pulumi.String("ins-1flbqyp8"),
    					Port:       pulumi.Float64(80),
    					Weight:     pulumi.Float64(10),
    				},
    			},
    		})
    		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 example = new Tencentcloud.ClbAttachment("example", new()
        {
            ClbId = "lb-k2zjp9lv",
            ListenerId = "lbl-hh141sn9",
            RuleId = "loc-4xxr2cy7",
            Targets = new[]
            {
                new Tencentcloud.Inputs.ClbAttachmentTargetArgs
                {
                    InstanceId = "ins-1flbqyp8",
                    Port = 80,
                    Weight = 10,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ClbAttachment;
    import com.pulumi.tencentcloud.ClbAttachmentArgs;
    import com.pulumi.tencentcloud.inputs.ClbAttachmentTargetArgs;
    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 example = new ClbAttachment("example", ClbAttachmentArgs.builder()
                .clbId("lb-k2zjp9lv")
                .listenerId("lbl-hh141sn9")
                .ruleId("loc-4xxr2cy7")
                .targets(ClbAttachmentTargetArgs.builder()
                    .instanceId("ins-1flbqyp8")
                    .port(80)
                    .weight(10)
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:ClbAttachment
        properties:
          clbId: lb-k2zjp9lv
          listenerId: lbl-hh141sn9
          ruleId: loc-4xxr2cy7
          targets:
            - instanceId: ins-1flbqyp8
              port: 80
              weight: 10
    
    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.ClbAttachment("example", {
        clbId: "lb-k2zjp9lv",
        domain: "test.com",
        listenerId: "lbl-hh141sn9",
        targets: [{
            instanceId: "ins-1flbqyp8",
            port: 80,
            weight: 10,
        }],
        url: "/",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.ClbAttachment("example",
        clb_id="lb-k2zjp9lv",
        domain="test.com",
        listener_id="lbl-hh141sn9",
        targets=[{
            "instance_id": "ins-1flbqyp8",
            "port": 80,
            "weight": 10,
        }],
        url="/")
    
    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.NewClbAttachment(ctx, "example", &tencentcloud.ClbAttachmentArgs{
    			ClbId:      pulumi.String("lb-k2zjp9lv"),
    			Domain:     pulumi.String("test.com"),
    			ListenerId: pulumi.String("lbl-hh141sn9"),
    			Targets: tencentcloud.ClbAttachmentTargetArray{
    				&tencentcloud.ClbAttachmentTargetArgs{
    					InstanceId: pulumi.String("ins-1flbqyp8"),
    					Port:       pulumi.Float64(80),
    					Weight:     pulumi.Float64(10),
    				},
    			},
    			Url: pulumi.String("/"),
    		})
    		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 example = new Tencentcloud.ClbAttachment("example", new()
        {
            ClbId = "lb-k2zjp9lv",
            Domain = "test.com",
            ListenerId = "lbl-hh141sn9",
            Targets = new[]
            {
                new Tencentcloud.Inputs.ClbAttachmentTargetArgs
                {
                    InstanceId = "ins-1flbqyp8",
                    Port = 80,
                    Weight = 10,
                },
            },
            Url = "/",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ClbAttachment;
    import com.pulumi.tencentcloud.ClbAttachmentArgs;
    import com.pulumi.tencentcloud.inputs.ClbAttachmentTargetArgs;
    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 example = new ClbAttachment("example", ClbAttachmentArgs.builder()
                .clbId("lb-k2zjp9lv")
                .domain("test.com")
                .listenerId("lbl-hh141sn9")
                .targets(ClbAttachmentTargetArgs.builder()
                    .instanceId("ins-1flbqyp8")
                    .port(80)
                    .weight(10)
                    .build())
                .url("/")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:ClbAttachment
        properties:
          clbId: lb-k2zjp9lv
          domain: test.com
          listenerId: lbl-hh141sn9
          targets:
            - instanceId: ins-1flbqyp8
              port: 80
              weight: 10
          url: /
    
    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.ClbAttachment("example", {
        clbId: "lb-k2zjp9lv",
        listenerId: "lbl-hh141sn9",
        ruleId: "loc-4xxr2cy7",
        targets: [
            {
                instanceId: "ins-1flbqyp8",
                port: 80,
                weight: 10,
            },
            {
                instanceId: "ins-ekloqpa1",
                port: 81,
                weight: 10,
            },
        ],
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.ClbAttachment("example",
        clb_id="lb-k2zjp9lv",
        listener_id="lbl-hh141sn9",
        rule_id="loc-4xxr2cy7",
        targets=[
            {
                "instance_id": "ins-1flbqyp8",
                "port": 80,
                "weight": 10,
            },
            {
                "instance_id": "ins-ekloqpa1",
                "port": 81,
                "weight": 10,
            },
        ])
    
    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.NewClbAttachment(ctx, "example", &tencentcloud.ClbAttachmentArgs{
    			ClbId:      pulumi.String("lb-k2zjp9lv"),
    			ListenerId: pulumi.String("lbl-hh141sn9"),
    			RuleId:     pulumi.String("loc-4xxr2cy7"),
    			Targets: tencentcloud.ClbAttachmentTargetArray{
    				&tencentcloud.ClbAttachmentTargetArgs{
    					InstanceId: pulumi.String("ins-1flbqyp8"),
    					Port:       pulumi.Float64(80),
    					Weight:     pulumi.Float64(10),
    				},
    				&tencentcloud.ClbAttachmentTargetArgs{
    					InstanceId: pulumi.String("ins-ekloqpa1"),
    					Port:       pulumi.Float64(81),
    					Weight:     pulumi.Float64(10),
    				},
    			},
    		})
    		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 example = new Tencentcloud.ClbAttachment("example", new()
        {
            ClbId = "lb-k2zjp9lv",
            ListenerId = "lbl-hh141sn9",
            RuleId = "loc-4xxr2cy7",
            Targets = new[]
            {
                new Tencentcloud.Inputs.ClbAttachmentTargetArgs
                {
                    InstanceId = "ins-1flbqyp8",
                    Port = 80,
                    Weight = 10,
                },
                new Tencentcloud.Inputs.ClbAttachmentTargetArgs
                {
                    InstanceId = "ins-ekloqpa1",
                    Port = 81,
                    Weight = 10,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ClbAttachment;
    import com.pulumi.tencentcloud.ClbAttachmentArgs;
    import com.pulumi.tencentcloud.inputs.ClbAttachmentTargetArgs;
    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 example = new ClbAttachment("example", ClbAttachmentArgs.builder()
                .clbId("lb-k2zjp9lv")
                .listenerId("lbl-hh141sn9")
                .ruleId("loc-4xxr2cy7")
                .targets(            
                    ClbAttachmentTargetArgs.builder()
                        .instanceId("ins-1flbqyp8")
                        .port(80)
                        .weight(10)
                        .build(),
                    ClbAttachmentTargetArgs.builder()
                        .instanceId("ins-ekloqpa1")
                        .port(81)
                        .weight(10)
                        .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:ClbAttachment
        properties:
          clbId: lb-k2zjp9lv
          listenerId: lbl-hh141sn9
          ruleId: loc-4xxr2cy7
          targets:
            - instanceId: ins-1flbqyp8
              port: 80
              weight: 10
            - instanceId: ins-ekloqpa1
              port: 81
              weight: 10
    
    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.ClbAttachment("example", {
        clbId: "lb-k2zjp9lv",
        domain: "test.com",
        listenerId: "lbl-hh141sn9",
        targets: [
            {
                instanceId: "ins-1flbqyp8",
                port: 80,
                weight: 10,
            },
            {
                instanceId: "ins-ekloqpa1",
                port: 81,
                weight: 10,
            },
        ],
        url: "/",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.ClbAttachment("example",
        clb_id="lb-k2zjp9lv",
        domain="test.com",
        listener_id="lbl-hh141sn9",
        targets=[
            {
                "instance_id": "ins-1flbqyp8",
                "port": 80,
                "weight": 10,
            },
            {
                "instance_id": "ins-ekloqpa1",
                "port": 81,
                "weight": 10,
            },
        ],
        url="/")
    
    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.NewClbAttachment(ctx, "example", &tencentcloud.ClbAttachmentArgs{
    			ClbId:      pulumi.String("lb-k2zjp9lv"),
    			Domain:     pulumi.String("test.com"),
    			ListenerId: pulumi.String("lbl-hh141sn9"),
    			Targets: tencentcloud.ClbAttachmentTargetArray{
    				&tencentcloud.ClbAttachmentTargetArgs{
    					InstanceId: pulumi.String("ins-1flbqyp8"),
    					Port:       pulumi.Float64(80),
    					Weight:     pulumi.Float64(10),
    				},
    				&tencentcloud.ClbAttachmentTargetArgs{
    					InstanceId: pulumi.String("ins-ekloqpa1"),
    					Port:       pulumi.Float64(81),
    					Weight:     pulumi.Float64(10),
    				},
    			},
    			Url: pulumi.String("/"),
    		})
    		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 example = new Tencentcloud.ClbAttachment("example", new()
        {
            ClbId = "lb-k2zjp9lv",
            Domain = "test.com",
            ListenerId = "lbl-hh141sn9",
            Targets = new[]
            {
                new Tencentcloud.Inputs.ClbAttachmentTargetArgs
                {
                    InstanceId = "ins-1flbqyp8",
                    Port = 80,
                    Weight = 10,
                },
                new Tencentcloud.Inputs.ClbAttachmentTargetArgs
                {
                    InstanceId = "ins-ekloqpa1",
                    Port = 81,
                    Weight = 10,
                },
            },
            Url = "/",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ClbAttachment;
    import com.pulumi.tencentcloud.ClbAttachmentArgs;
    import com.pulumi.tencentcloud.inputs.ClbAttachmentTargetArgs;
    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 example = new ClbAttachment("example", ClbAttachmentArgs.builder()
                .clbId("lb-k2zjp9lv")
                .domain("test.com")
                .listenerId("lbl-hh141sn9")
                .targets(            
                    ClbAttachmentTargetArgs.builder()
                        .instanceId("ins-1flbqyp8")
                        .port(80)
                        .weight(10)
                        .build(),
                    ClbAttachmentTargetArgs.builder()
                        .instanceId("ins-ekloqpa1")
                        .port(81)
                        .weight(10)
                        .build())
                .url("/")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:ClbAttachment
        properties:
          clbId: lb-k2zjp9lv
          domain: test.com
          listenerId: lbl-hh141sn9
          targets:
            - instanceId: ins-1flbqyp8
              port: 80
              weight: 10
            - instanceId: ins-ekloqpa1
              port: 81
              weight: 10
          url: /
    
    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.ClbAttachment("example", {
        clbId: "lb-k2zjp9lv",
        listenerId: "lbl-hh141sn9",
        ruleId: "loc-4xxr2cy7",
        targets: [{
            eniIp: "172.16.16.52",
            port: 8090,
            weight: 50,
        }],
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.ClbAttachment("example",
        clb_id="lb-k2zjp9lv",
        listener_id="lbl-hh141sn9",
        rule_id="loc-4xxr2cy7",
        targets=[{
            "eni_ip": "172.16.16.52",
            "port": 8090,
            "weight": 50,
        }])
    
    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.NewClbAttachment(ctx, "example", &tencentcloud.ClbAttachmentArgs{
    			ClbId:      pulumi.String("lb-k2zjp9lv"),
    			ListenerId: pulumi.String("lbl-hh141sn9"),
    			RuleId:     pulumi.String("loc-4xxr2cy7"),
    			Targets: tencentcloud.ClbAttachmentTargetArray{
    				&tencentcloud.ClbAttachmentTargetArgs{
    					EniIp:  pulumi.String("172.16.16.52"),
    					Port:   pulumi.Float64(8090),
    					Weight: pulumi.Float64(50),
    				},
    			},
    		})
    		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 example = new Tencentcloud.ClbAttachment("example", new()
        {
            ClbId = "lb-k2zjp9lv",
            ListenerId = "lbl-hh141sn9",
            RuleId = "loc-4xxr2cy7",
            Targets = new[]
            {
                new Tencentcloud.Inputs.ClbAttachmentTargetArgs
                {
                    EniIp = "172.16.16.52",
                    Port = 8090,
                    Weight = 50,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ClbAttachment;
    import com.pulumi.tencentcloud.ClbAttachmentArgs;
    import com.pulumi.tencentcloud.inputs.ClbAttachmentTargetArgs;
    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 example = new ClbAttachment("example", ClbAttachmentArgs.builder()
                .clbId("lb-k2zjp9lv")
                .listenerId("lbl-hh141sn9")
                .ruleId("loc-4xxr2cy7")
                .targets(ClbAttachmentTargetArgs.builder()
                    .eniIp("172.16.16.52")
                    .port(8090)
                    .weight(50)
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:ClbAttachment
        properties:
          clbId: lb-k2zjp9lv
          listenerId: lbl-hh141sn9
          ruleId: loc-4xxr2cy7
          targets:
            - eniIp: 172.16.16.52
              port: 8090
              weight: 50
    
    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.ClbAttachment("example", {
        clbId: "lb-k2zjp9lv",
        domain: "test.com",
        listenerId: "lbl-hh141sn9",
        targets: [{
            eniIp: "172.16.16.52",
            port: 8090,
            weight: 50,
        }],
        url: "/",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.ClbAttachment("example",
        clb_id="lb-k2zjp9lv",
        domain="test.com",
        listener_id="lbl-hh141sn9",
        targets=[{
            "eni_ip": "172.16.16.52",
            "port": 8090,
            "weight": 50,
        }],
        url="/")
    
    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.NewClbAttachment(ctx, "example", &tencentcloud.ClbAttachmentArgs{
    			ClbId:      pulumi.String("lb-k2zjp9lv"),
    			Domain:     pulumi.String("test.com"),
    			ListenerId: pulumi.String("lbl-hh141sn9"),
    			Targets: tencentcloud.ClbAttachmentTargetArray{
    				&tencentcloud.ClbAttachmentTargetArgs{
    					EniIp:  pulumi.String("172.16.16.52"),
    					Port:   pulumi.Float64(8090),
    					Weight: pulumi.Float64(50),
    				},
    			},
    			Url: pulumi.String("/"),
    		})
    		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 example = new Tencentcloud.ClbAttachment("example", new()
        {
            ClbId = "lb-k2zjp9lv",
            Domain = "test.com",
            ListenerId = "lbl-hh141sn9",
            Targets = new[]
            {
                new Tencentcloud.Inputs.ClbAttachmentTargetArgs
                {
                    EniIp = "172.16.16.52",
                    Port = 8090,
                    Weight = 50,
                },
            },
            Url = "/",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ClbAttachment;
    import com.pulumi.tencentcloud.ClbAttachmentArgs;
    import com.pulumi.tencentcloud.inputs.ClbAttachmentTargetArgs;
    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 example = new ClbAttachment("example", ClbAttachmentArgs.builder()
                .clbId("lb-k2zjp9lv")
                .domain("test.com")
                .listenerId("lbl-hh141sn9")
                .targets(ClbAttachmentTargetArgs.builder()
                    .eniIp("172.16.16.52")
                    .port(8090)
                    .weight(50)
                    .build())
                .url("/")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:ClbAttachment
        properties:
          clbId: lb-k2zjp9lv
          domain: test.com
          listenerId: lbl-hh141sn9
          targets:
            - eniIp: 172.16.16.52
              port: 8090
              weight: 50
          url: /
    

    Create ClbAttachment Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ClbAttachment(name: string, args: ClbAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def ClbAttachment(resource_name: str,
                      args: ClbAttachmentArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClbAttachment(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      clb_id: Optional[str] = None,
                      listener_id: Optional[str] = None,
                      targets: Optional[Sequence[ClbAttachmentTargetArgs]] = None,
                      clb_attachment_id: Optional[str] = None,
                      domain: Optional[str] = None,
                      rule_id: Optional[str] = None,
                      url: Optional[str] = None)
    func NewClbAttachment(ctx *Context, name string, args ClbAttachmentArgs, opts ...ResourceOption) (*ClbAttachment, error)
    public ClbAttachment(string name, ClbAttachmentArgs args, CustomResourceOptions? opts = null)
    public ClbAttachment(String name, ClbAttachmentArgs args)
    public ClbAttachment(String name, ClbAttachmentArgs args, CustomResourceOptions options)
    
    type: tencentcloud:ClbAttachment
    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 ClbAttachmentArgs
    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 ClbAttachmentArgs
    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 ClbAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClbAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClbAttachmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    ClbId string
    ID of the CLB.
    ListenerId string
    ID of the CLB listener.
    Targets List<ClbAttachmentTarget>
    Information of the backends to be attached.
    ClbAttachmentId string
    ID of the resource.
    Domain string
    Domain of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    RuleId string
    ID of the CLB listener rule. Only supports listeners of HTTPS and HTTP protocol.
    Url string
    URL of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    ClbId string
    ID of the CLB.
    ListenerId string
    ID of the CLB listener.
    Targets []ClbAttachmentTargetArgs
    Information of the backends to be attached.
    ClbAttachmentId string
    ID of the resource.
    Domain string
    Domain of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    RuleId string
    ID of the CLB listener rule. Only supports listeners of HTTPS and HTTP protocol.
    Url string
    URL of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    clbId String
    ID of the CLB.
    listenerId String
    ID of the CLB listener.
    targets List<ClbAttachmentTarget>
    Information of the backends to be attached.
    clbAttachmentId String
    ID of the resource.
    domain String
    Domain of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    ruleId String
    ID of the CLB listener rule. Only supports listeners of HTTPS and HTTP protocol.
    url String
    URL of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    clbId string
    ID of the CLB.
    listenerId string
    ID of the CLB listener.
    targets ClbAttachmentTarget[]
    Information of the backends to be attached.
    clbAttachmentId string
    ID of the resource.
    domain string
    Domain of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    ruleId string
    ID of the CLB listener rule. Only supports listeners of HTTPS and HTTP protocol.
    url string
    URL of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    clb_id str
    ID of the CLB.
    listener_id str
    ID of the CLB listener.
    targets Sequence[ClbAttachmentTargetArgs]
    Information of the backends to be attached.
    clb_attachment_id str
    ID of the resource.
    domain str
    Domain of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    rule_id str
    ID of the CLB listener rule. Only supports listeners of HTTPS and HTTP protocol.
    url str
    URL of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    clbId String
    ID of the CLB.
    listenerId String
    ID of the CLB listener.
    targets List<Property Map>
    Information of the backends to be attached.
    clbAttachmentId String
    ID of the resource.
    domain String
    Domain of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    ruleId String
    ID of the CLB listener rule. Only supports listeners of HTTPS and HTTP protocol.
    url String
    URL of the target forwarding rule. Does not take effect when parameter rule_id is provided.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    ProtocolType string
    Type of protocol within the listener.
    Id string
    The provider-assigned unique ID for this managed resource.
    ProtocolType string
    Type of protocol within the listener.
    id String
    The provider-assigned unique ID for this managed resource.
    protocolType String
    Type of protocol within the listener.
    id string
    The provider-assigned unique ID for this managed resource.
    protocolType string
    Type of protocol within the listener.
    id str
    The provider-assigned unique ID for this managed resource.
    protocol_type str
    Type of protocol within the listener.
    id String
    The provider-assigned unique ID for this managed resource.
    protocolType String
    Type of protocol within the listener.

    Look up Existing ClbAttachment Resource

    Get an existing ClbAttachment 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?: ClbAttachmentState, opts?: CustomResourceOptions): ClbAttachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            clb_attachment_id: Optional[str] = None,
            clb_id: Optional[str] = None,
            domain: Optional[str] = None,
            listener_id: Optional[str] = None,
            protocol_type: Optional[str] = None,
            rule_id: Optional[str] = None,
            targets: Optional[Sequence[ClbAttachmentTargetArgs]] = None,
            url: Optional[str] = None) -> ClbAttachment
    func GetClbAttachment(ctx *Context, name string, id IDInput, state *ClbAttachmentState, opts ...ResourceOption) (*ClbAttachment, error)
    public static ClbAttachment Get(string name, Input<string> id, ClbAttachmentState? state, CustomResourceOptions? opts = null)
    public static ClbAttachment get(String name, Output<String> id, ClbAttachmentState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:ClbAttachment    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.
    The following state arguments are supported:
    ClbAttachmentId string
    ID of the resource.
    ClbId string
    ID of the CLB.
    Domain string
    Domain of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    ListenerId string
    ID of the CLB listener.
    ProtocolType string
    Type of protocol within the listener.
    RuleId string
    ID of the CLB listener rule. Only supports listeners of HTTPS and HTTP protocol.
    Targets List<ClbAttachmentTarget>
    Information of the backends to be attached.
    Url string
    URL of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    ClbAttachmentId string
    ID of the resource.
    ClbId string
    ID of the CLB.
    Domain string
    Domain of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    ListenerId string
    ID of the CLB listener.
    ProtocolType string
    Type of protocol within the listener.
    RuleId string
    ID of the CLB listener rule. Only supports listeners of HTTPS and HTTP protocol.
    Targets []ClbAttachmentTargetArgs
    Information of the backends to be attached.
    Url string
    URL of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    clbAttachmentId String
    ID of the resource.
    clbId String
    ID of the CLB.
    domain String
    Domain of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    listenerId String
    ID of the CLB listener.
    protocolType String
    Type of protocol within the listener.
    ruleId String
    ID of the CLB listener rule. Only supports listeners of HTTPS and HTTP protocol.
    targets List<ClbAttachmentTarget>
    Information of the backends to be attached.
    url String
    URL of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    clbAttachmentId string
    ID of the resource.
    clbId string
    ID of the CLB.
    domain string
    Domain of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    listenerId string
    ID of the CLB listener.
    protocolType string
    Type of protocol within the listener.
    ruleId string
    ID of the CLB listener rule. Only supports listeners of HTTPS and HTTP protocol.
    targets ClbAttachmentTarget[]
    Information of the backends to be attached.
    url string
    URL of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    clb_attachment_id str
    ID of the resource.
    clb_id str
    ID of the CLB.
    domain str
    Domain of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    listener_id str
    ID of the CLB listener.
    protocol_type str
    Type of protocol within the listener.
    rule_id str
    ID of the CLB listener rule. Only supports listeners of HTTPS and HTTP protocol.
    targets Sequence[ClbAttachmentTargetArgs]
    Information of the backends to be attached.
    url str
    URL of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    clbAttachmentId String
    ID of the resource.
    clbId String
    ID of the CLB.
    domain String
    Domain of the target forwarding rule. Does not take effect when parameter rule_id is provided.
    listenerId String
    ID of the CLB listener.
    protocolType String
    Type of protocol within the listener.
    ruleId String
    ID of the CLB listener rule. Only supports listeners of HTTPS and HTTP protocol.
    targets List<Property Map>
    Information of the backends to be attached.
    url String
    URL of the target forwarding rule. Does not take effect when parameter rule_id is provided.

    Supporting Types

    ClbAttachmentTarget, ClbAttachmentTargetArgs

    Port double
    Port of the backend server. Valid value ranges: (0~65535).
    EniIp string
    Eni IP address of the backend server, conflict with instance_id but must specify one of them.
    InstanceId string
    CVM Instance Id of the backend server, conflict with eni_ip but must specify one of them.
    Weight double
    Forwarding weight of the backend service. Valid value ranges: (0~100). defaults to 10.
    Port float64
    Port of the backend server. Valid value ranges: (0~65535).
    EniIp string
    Eni IP address of the backend server, conflict with instance_id but must specify one of them.
    InstanceId string
    CVM Instance Id of the backend server, conflict with eni_ip but must specify one of them.
    Weight float64
    Forwarding weight of the backend service. Valid value ranges: (0~100). defaults to 10.
    port Double
    Port of the backend server. Valid value ranges: (0~65535).
    eniIp String
    Eni IP address of the backend server, conflict with instance_id but must specify one of them.
    instanceId String
    CVM Instance Id of the backend server, conflict with eni_ip but must specify one of them.
    weight Double
    Forwarding weight of the backend service. Valid value ranges: (0~100). defaults to 10.
    port number
    Port of the backend server. Valid value ranges: (0~65535).
    eniIp string
    Eni IP address of the backend server, conflict with instance_id but must specify one of them.
    instanceId string
    CVM Instance Id of the backend server, conflict with eni_ip but must specify one of them.
    weight number
    Forwarding weight of the backend service. Valid value ranges: (0~100). defaults to 10.
    port float
    Port of the backend server. Valid value ranges: (0~65535).
    eni_ip str
    Eni IP address of the backend server, conflict with instance_id but must specify one of them.
    instance_id str
    CVM Instance Id of the backend server, conflict with eni_ip but must specify one of them.
    weight float
    Forwarding weight of the backend service. Valid value ranges: (0~100). defaults to 10.
    port Number
    Port of the backend server. Valid value ranges: (0~65535).
    eniIp String
    Eni IP address of the backend server, conflict with instance_id but must specify one of them.
    instanceId String
    CVM Instance Id of the backend server, conflict with eni_ip but must specify one of them.
    weight Number
    Forwarding weight of the backend service. Valid value ranges: (0~100). defaults to 10.

    Import

    CLB attachment can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/clbAttachment:ClbAttachment example loc-4xxr2cy7#lbl-hh141sn9#lb-7a0t6zqb
    

    Or

    $ pulumi import tencentcloud:index/clbAttachment:ClbAttachment example test.com,/#lbl-hh141sn9#lb-7a0t6zqb
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack