1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. ClbFunctionTargetsAttachment
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack

tencentcloud.ClbFunctionTargetsAttachment

Explore with Pulumi AI

Provides a resource to create a clb function_targets_attachment

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const functionTargets = new tencentcloud.ClbFunctionTargetsAttachment("functionTargets", {
    domain: "xxx.com",
    functionTargets: {
        "function": {
            functionName: "keep-tf-test-1675954233",
            functionNamespace: "default",
            functionQualifier: "$LATEST",
            functionQualifierType: "VERSION",
        },
        weight: 10,
    },
    listenerId: "lbl-nonkgvc2",
    loadBalancerId: "lb-5dnrkgry",
    url: "/",
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

function_targets = tencentcloud.ClbFunctionTargetsAttachment("functionTargets",
    domain="xxx.com",
    function_targets={
        "function": {
            "function_name": "keep-tf-test-1675954233",
            "function_namespace": "default",
            "function_qualifier": "$LATEST",
            "function_qualifier_type": "VERSION",
        },
        "weight": 10,
    },
    listener_id="lbl-nonkgvc2",
    load_balancer_id="lb-5dnrkgry",
    url="/")
Copy
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.NewClbFunctionTargetsAttachment(ctx, "functionTargets", &tencentcloud.ClbFunctionTargetsAttachmentArgs{
			Domain: pulumi.String("xxx.com"),
			FunctionTargets: &tencentcloud.ClbFunctionTargetsAttachmentFunctionTargetsArgs{
				Function: &tencentcloud.ClbFunctionTargetsAttachmentFunctionTargetsFunctionArgs{
					FunctionName:          pulumi.String("keep-tf-test-1675954233"),
					FunctionNamespace:     pulumi.String("default"),
					FunctionQualifier:     pulumi.String("$LATEST"),
					FunctionQualifierType: pulumi.String("VERSION"),
				},
				Weight: pulumi.Float64(10),
			},
			ListenerId:     pulumi.String("lbl-nonkgvc2"),
			LoadBalancerId: pulumi.String("lb-5dnrkgry"),
			Url:            pulumi.String("/"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var functionTargets = new Tencentcloud.ClbFunctionTargetsAttachment("functionTargets", new()
    {
        Domain = "xxx.com",
        FunctionTargets = new Tencentcloud.Inputs.ClbFunctionTargetsAttachmentFunctionTargetsArgs
        {
            Function = new Tencentcloud.Inputs.ClbFunctionTargetsAttachmentFunctionTargetsFunctionArgs
            {
                FunctionName = "keep-tf-test-1675954233",
                FunctionNamespace = "default",
                FunctionQualifier = "$LATEST",
                FunctionQualifierType = "VERSION",
            },
            Weight = 10,
        },
        ListenerId = "lbl-nonkgvc2",
        LoadBalancerId = "lb-5dnrkgry",
        Url = "/",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ClbFunctionTargetsAttachment;
import com.pulumi.tencentcloud.ClbFunctionTargetsAttachmentArgs;
import com.pulumi.tencentcloud.inputs.ClbFunctionTargetsAttachmentFunctionTargetsArgs;
import com.pulumi.tencentcloud.inputs.ClbFunctionTargetsAttachmentFunctionTargetsFunctionArgs;
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 functionTargets = new ClbFunctionTargetsAttachment("functionTargets", ClbFunctionTargetsAttachmentArgs.builder()
            .domain("xxx.com")
            .functionTargets(ClbFunctionTargetsAttachmentFunctionTargetsArgs.builder()
                .function(ClbFunctionTargetsAttachmentFunctionTargetsFunctionArgs.builder()
                    .functionName("keep-tf-test-1675954233")
                    .functionNamespace("default")
                    .functionQualifier("$LATEST")
                    .functionQualifierType("VERSION")
                    .build())
                .weight(10)
                .build())
            .listenerId("lbl-nonkgvc2")
            .loadBalancerId("lb-5dnrkgry")
            .url("/")
            .build());

    }
}
Copy
resources:
  functionTargets:
    type: tencentcloud:ClbFunctionTargetsAttachment
    properties:
      domain: xxx.com
      functionTargets:
        function:
          functionName: keep-tf-test-1675954233
          functionNamespace: default
          functionQualifier: $LATEST
          functionQualifierType: VERSION
        weight: 10
      listenerId: lbl-nonkgvc2
      loadBalancerId: lb-5dnrkgry
      url: /
Copy

Create ClbFunctionTargetsAttachment Resource

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

Constructor syntax

new ClbFunctionTargetsAttachment(name: string, args: ClbFunctionTargetsAttachmentArgs, opts?: CustomResourceOptions);
@overload
def ClbFunctionTargetsAttachment(resource_name: str,
                                 args: ClbFunctionTargetsAttachmentArgs,
                                 opts: Optional[ResourceOptions] = None)

@overload
def ClbFunctionTargetsAttachment(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 function_targets: Optional[ClbFunctionTargetsAttachmentFunctionTargetsArgs] = None,
                                 listener_id: Optional[str] = None,
                                 load_balancer_id: Optional[str] = None,
                                 clb_function_targets_attachment_id: Optional[str] = None,
                                 domain: Optional[str] = None,
                                 location_id: Optional[str] = None,
                                 url: Optional[str] = None)
func NewClbFunctionTargetsAttachment(ctx *Context, name string, args ClbFunctionTargetsAttachmentArgs, opts ...ResourceOption) (*ClbFunctionTargetsAttachment, error)
public ClbFunctionTargetsAttachment(string name, ClbFunctionTargetsAttachmentArgs args, CustomResourceOptions? opts = null)
public ClbFunctionTargetsAttachment(String name, ClbFunctionTargetsAttachmentArgs args)
public ClbFunctionTargetsAttachment(String name, ClbFunctionTargetsAttachmentArgs args, CustomResourceOptions options)
type: tencentcloud:ClbFunctionTargetsAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ClbFunctionTargetsAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ClbFunctionTargetsAttachmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ClbFunctionTargetsAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ClbFunctionTargetsAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ClbFunctionTargetsAttachmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

FunctionTargets This property is required. ClbFunctionTargetsAttachmentFunctionTargets
List of cloud functions to be bound.
ListenerId This property is required. string
Load Balancer Listener ID.
LoadBalancerId This property is required. string
Load Balancer Instance ID.
ClbFunctionTargetsAttachmentId string
ID of the resource.
Domain string
The domain name of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
LocationId string
The ID of the target forwarding rule. When binding the cloud function to a layer-7 forwarding rule, this parameter or the Domain+Url parameter must be entered.
Url string
The URL of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
FunctionTargets This property is required. ClbFunctionTargetsAttachmentFunctionTargetsArgs
List of cloud functions to be bound.
ListenerId This property is required. string
Load Balancer Listener ID.
LoadBalancerId This property is required. string
Load Balancer Instance ID.
ClbFunctionTargetsAttachmentId string
ID of the resource.
Domain string
The domain name of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
LocationId string
The ID of the target forwarding rule. When binding the cloud function to a layer-7 forwarding rule, this parameter or the Domain+Url parameter must be entered.
Url string
The URL of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
functionTargets This property is required. ClbFunctionTargetsAttachmentFunctionTargets
List of cloud functions to be bound.
listenerId This property is required. String
Load Balancer Listener ID.
loadBalancerId This property is required. String
Load Balancer Instance ID.
clbFunctionTargetsAttachmentId String
ID of the resource.
domain String
The domain name of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
locationId String
The ID of the target forwarding rule. When binding the cloud function to a layer-7 forwarding rule, this parameter or the Domain+Url parameter must be entered.
url String
The URL of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
functionTargets This property is required. ClbFunctionTargetsAttachmentFunctionTargets
List of cloud functions to be bound.
listenerId This property is required. string
Load Balancer Listener ID.
loadBalancerId This property is required. string
Load Balancer Instance ID.
clbFunctionTargetsAttachmentId string
ID of the resource.
domain string
The domain name of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
locationId string
The ID of the target forwarding rule. When binding the cloud function to a layer-7 forwarding rule, this parameter or the Domain+Url parameter must be entered.
url string
The URL of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
function_targets This property is required. ClbFunctionTargetsAttachmentFunctionTargetsArgs
List of cloud functions to be bound.
listener_id This property is required. str
Load Balancer Listener ID.
load_balancer_id This property is required. str
Load Balancer Instance ID.
clb_function_targets_attachment_id str
ID of the resource.
domain str
The domain name of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
location_id str
The ID of the target forwarding rule. When binding the cloud function to a layer-7 forwarding rule, this parameter or the Domain+Url parameter must be entered.
url str
The URL of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
functionTargets This property is required. Property Map
List of cloud functions to be bound.
listenerId This property is required. String
Load Balancer Listener ID.
loadBalancerId This property is required. String
Load Balancer Instance ID.
clbFunctionTargetsAttachmentId String
ID of the resource.
domain String
The domain name of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
locationId String
The ID of the target forwarding rule. When binding the cloud function to a layer-7 forwarding rule, this parameter or the Domain+Url parameter must be entered.
url String
The URL of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.

Outputs

All input properties are implicitly available as output properties. Additionally, the ClbFunctionTargetsAttachment 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 ClbFunctionTargetsAttachment Resource

Get an existing ClbFunctionTargetsAttachment 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?: ClbFunctionTargetsAttachmentState, opts?: CustomResourceOptions): ClbFunctionTargetsAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        clb_function_targets_attachment_id: Optional[str] = None,
        domain: Optional[str] = None,
        function_targets: Optional[ClbFunctionTargetsAttachmentFunctionTargetsArgs] = None,
        listener_id: Optional[str] = None,
        load_balancer_id: Optional[str] = None,
        location_id: Optional[str] = None,
        url: Optional[str] = None) -> ClbFunctionTargetsAttachment
func GetClbFunctionTargetsAttachment(ctx *Context, name string, id IDInput, state *ClbFunctionTargetsAttachmentState, opts ...ResourceOption) (*ClbFunctionTargetsAttachment, error)
public static ClbFunctionTargetsAttachment Get(string name, Input<string> id, ClbFunctionTargetsAttachmentState? state, CustomResourceOptions? opts = null)
public static ClbFunctionTargetsAttachment get(String name, Output<String> id, ClbFunctionTargetsAttachmentState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:ClbFunctionTargetsAttachment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ClbFunctionTargetsAttachmentId string
ID of the resource.
Domain string
The domain name of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
FunctionTargets ClbFunctionTargetsAttachmentFunctionTargets
List of cloud functions to be bound.
ListenerId string
Load Balancer Listener ID.
LoadBalancerId string
Load Balancer Instance ID.
LocationId string
The ID of the target forwarding rule. When binding the cloud function to a layer-7 forwarding rule, this parameter or the Domain+Url parameter must be entered.
Url string
The URL of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
ClbFunctionTargetsAttachmentId string
ID of the resource.
Domain string
The domain name of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
FunctionTargets ClbFunctionTargetsAttachmentFunctionTargetsArgs
List of cloud functions to be bound.
ListenerId string
Load Balancer Listener ID.
LoadBalancerId string
Load Balancer Instance ID.
LocationId string
The ID of the target forwarding rule. When binding the cloud function to a layer-7 forwarding rule, this parameter or the Domain+Url parameter must be entered.
Url string
The URL of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
clbFunctionTargetsAttachmentId String
ID of the resource.
domain String
The domain name of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
functionTargets ClbFunctionTargetsAttachmentFunctionTargets
List of cloud functions to be bound.
listenerId String
Load Balancer Listener ID.
loadBalancerId String
Load Balancer Instance ID.
locationId String
The ID of the target forwarding rule. When binding the cloud function to a layer-7 forwarding rule, this parameter or the Domain+Url parameter must be entered.
url String
The URL of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
clbFunctionTargetsAttachmentId string
ID of the resource.
domain string
The domain name of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
functionTargets ClbFunctionTargetsAttachmentFunctionTargets
List of cloud functions to be bound.
listenerId string
Load Balancer Listener ID.
loadBalancerId string
Load Balancer Instance ID.
locationId string
The ID of the target forwarding rule. When binding the cloud function to a layer-7 forwarding rule, this parameter or the Domain+Url parameter must be entered.
url string
The URL of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
clb_function_targets_attachment_id str
ID of the resource.
domain str
The domain name of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
function_targets ClbFunctionTargetsAttachmentFunctionTargetsArgs
List of cloud functions to be bound.
listener_id str
Load Balancer Listener ID.
load_balancer_id str
Load Balancer Instance ID.
location_id str
The ID of the target forwarding rule. When binding the cloud function to a layer-7 forwarding rule, this parameter or the Domain+Url parameter must be entered.
url str
The URL of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
clbFunctionTargetsAttachmentId String
ID of the resource.
domain String
The domain name of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.
functionTargets Property Map
List of cloud functions to be bound.
listenerId String
Load Balancer Listener ID.
loadBalancerId String
Load Balancer Instance ID.
locationId String
The ID of the target forwarding rule. When binding the cloud function to a layer-7 forwarding rule, this parameter or the Domain+Url parameter must be entered.
url String
The URL of the target forwarding rule. If the LocationId parameter has been entered, this parameter will not take effect.

Supporting Types

ClbFunctionTargetsAttachmentFunctionTargets
, ClbFunctionTargetsAttachmentFunctionTargetsArgs

Function This property is required. ClbFunctionTargetsAttachmentFunctionTargetsFunction
Information about cloud functions.Note: This field may return null, indicating that no valid value can be obtained.
Weight double
Weight. The default is 10.
Function This property is required. ClbFunctionTargetsAttachmentFunctionTargetsFunction
Information about cloud functions.Note: This field may return null, indicating that no valid value can be obtained.
Weight float64
Weight. The default is 10.
function This property is required. ClbFunctionTargetsAttachmentFunctionTargetsFunction
Information about cloud functions.Note: This field may return null, indicating that no valid value can be obtained.
weight Double
Weight. The default is 10.
function This property is required. ClbFunctionTargetsAttachmentFunctionTargetsFunction
Information about cloud functions.Note: This field may return null, indicating that no valid value can be obtained.
weight number
Weight. The default is 10.
function This property is required. ClbFunctionTargetsAttachmentFunctionTargetsFunction
Information about cloud functions.Note: This field may return null, indicating that no valid value can be obtained.
weight float
Weight. The default is 10.
function This property is required. Property Map
Information about cloud functions.Note: This field may return null, indicating that no valid value can be obtained.
weight Number
Weight. The default is 10.

ClbFunctionTargetsAttachmentFunctionTargetsFunction
, ClbFunctionTargetsAttachmentFunctionTargetsFunctionArgs

FunctionName This property is required. string
The name of function.
FunctionNamespace This property is required. string
The namespace of function.
FunctionQualifier This property is required. string
The version name or alias of the function.
FunctionQualifierType string
Identifies the type of FunctionQualifier parameter, possible values: VERSION, ALIAS.Note: This field may return null, indicating that no valid value can be obtained.
FunctionName This property is required. string
The name of function.
FunctionNamespace This property is required. string
The namespace of function.
FunctionQualifier This property is required. string
The version name or alias of the function.
FunctionQualifierType string
Identifies the type of FunctionQualifier parameter, possible values: VERSION, ALIAS.Note: This field may return null, indicating that no valid value can be obtained.
functionName This property is required. String
The name of function.
functionNamespace This property is required. String
The namespace of function.
functionQualifier This property is required. String
The version name or alias of the function.
functionQualifierType String
Identifies the type of FunctionQualifier parameter, possible values: VERSION, ALIAS.Note: This field may return null, indicating that no valid value can be obtained.
functionName This property is required. string
The name of function.
functionNamespace This property is required. string
The namespace of function.
functionQualifier This property is required. string
The version name or alias of the function.
functionQualifierType string
Identifies the type of FunctionQualifier parameter, possible values: VERSION, ALIAS.Note: This field may return null, indicating that no valid value can be obtained.
function_name This property is required. str
The name of function.
function_namespace This property is required. str
The namespace of function.
function_qualifier This property is required. str
The version name or alias of the function.
function_qualifier_type str
Identifies the type of FunctionQualifier parameter, possible values: VERSION, ALIAS.Note: This field may return null, indicating that no valid value can be obtained.
functionName This property is required. String
The name of function.
functionNamespace This property is required. String
The namespace of function.
functionQualifier This property is required. String
The version name or alias of the function.
functionQualifierType String
Identifies the type of FunctionQualifier parameter, possible values: VERSION, ALIAS.Note: This field may return null, indicating that no valid value can be obtained.

Import

clb function_targets_attachment can be imported using the id, e.g.

$ pulumi import tencentcloud:index/clbFunctionTargetsAttachment:ClbFunctionTargetsAttachment function_targets loadBalancerId#listenerId#locationId or loadBalancerId#listenerId#domain#rule
Copy

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.