1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. WafObject
Viewing docs for tencentcloud 1.82.79
published on Friday, Mar 27, 2026 by tencentcloudstack
tencentcloud logo
Viewing docs for tencentcloud 1.82.79
published on Friday, Mar 27, 2026 by tencentcloudstack

    Provides a resource to create a Waf object

    NOTE: If you need to change field instance_id, you need to keep status at 0; If you need to change field proxy(ip_headers), you need to keep status at 1.

    Example Usage

    Bind current account resources

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.WafObject("example", {
        objectId: "lb-9h5x9lze",
        instanceId: "waf_2kxtlbky11b2v4fe",
        status: 1,
        proxy: 3,
        ipHeaders: [
            "my-header1",
            "my-header2",
            "my-header3",
        ],
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.WafObject("example",
        object_id="lb-9h5x9lze",
        instance_id="waf_2kxtlbky11b2v4fe",
        status=1,
        proxy=3,
        ip_headers=[
            "my-header1",
            "my-header2",
            "my-header3",
        ])
    
    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.NewWafObject(ctx, "example", &tencentcloud.WafObjectArgs{
    			ObjectId:   pulumi.String("lb-9h5x9lze"),
    			InstanceId: pulumi.String("waf_2kxtlbky11b2v4fe"),
    			Status:     pulumi.Float64(1),
    			Proxy:      pulumi.Float64(3),
    			IpHeaders: pulumi.StringArray{
    				pulumi.String("my-header1"),
    				pulumi.String("my-header2"),
    				pulumi.String("my-header3"),
    			},
    		})
    		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.WafObject("example", new()
        {
            ObjectId = "lb-9h5x9lze",
            InstanceId = "waf_2kxtlbky11b2v4fe",
            Status = 1,
            Proxy = 3,
            IpHeaders = new[]
            {
                "my-header1",
                "my-header2",
                "my-header3",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.WafObject;
    import com.pulumi.tencentcloud.WafObjectArgs;
    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 WafObject("example", WafObjectArgs.builder()
                .objectId("lb-9h5x9lze")
                .instanceId("waf_2kxtlbky11b2v4fe")
                .status(1.0)
                .proxy(3.0)
                .ipHeaders(            
                    "my-header1",
                    "my-header2",
                    "my-header3")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:WafObject
        properties:
          objectId: lb-9h5x9lze
          instanceId: waf_2kxtlbky11b2v4fe
          status: 1
          proxy: 3
          ipHeaders:
            - my-header1
            - my-header2
            - my-header3
    

    Bind other member account resources

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.WafObject("example", {
        objectId: "lb-0ljh3xew",
        instanceId: "waf_2kxtlbky11b2v4fe",
        memberAppId: 1306832456,
        memberUin: "100987654164",
        status: 1,
        proxy: 1,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.WafObject("example",
        object_id="lb-0ljh3xew",
        instance_id="waf_2kxtlbky11b2v4fe",
        member_app_id=1306832456,
        member_uin="100987654164",
        status=1,
        proxy=1)
    
    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.NewWafObject(ctx, "example", &tencentcloud.WafObjectArgs{
    			ObjectId:    pulumi.String("lb-0ljh3xew"),
    			InstanceId:  pulumi.String("waf_2kxtlbky11b2v4fe"),
    			MemberAppId: pulumi.Float64(1306832456),
    			MemberUin:   pulumi.String("100987654164"),
    			Status:      pulumi.Float64(1),
    			Proxy:       pulumi.Float64(1),
    		})
    		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.WafObject("example", new()
        {
            ObjectId = "lb-0ljh3xew",
            InstanceId = "waf_2kxtlbky11b2v4fe",
            MemberAppId = 1306832456,
            MemberUin = "100987654164",
            Status = 1,
            Proxy = 1,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.WafObject;
    import com.pulumi.tencentcloud.WafObjectArgs;
    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 WafObject("example", WafObjectArgs.builder()
                .objectId("lb-0ljh3xew")
                .instanceId("waf_2kxtlbky11b2v4fe")
                .memberAppId(1306832456.0)
                .memberUin("100987654164")
                .status(1.0)
                .proxy(1.0)
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:WafObject
        properties:
          objectId: lb-0ljh3xew
          instanceId: waf_2kxtlbky11b2v4fe
          memberAppId: 1.306832456e+09
          memberUin: '100987654164'
          status: 1
          proxy: 1
    

    Create WafObject Resource

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

    Constructor syntax

    new WafObject(name: string, args: WafObjectArgs, opts?: CustomResourceOptions);
    @overload
    def WafObject(resource_name: str,
                  args: WafObjectArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def WafObject(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  object_id: Optional[str] = None,
                  instance_id: Optional[str] = None,
                  ip_headers: Optional[Sequence[str]] = None,
                  member_app_id: Optional[float] = None,
                  member_uin: Optional[str] = None,
                  proxy: Optional[float] = None,
                  status: Optional[float] = None,
                  waf_object_id: Optional[str] = None)
    func NewWafObject(ctx *Context, name string, args WafObjectArgs, opts ...ResourceOption) (*WafObject, error)
    public WafObject(string name, WafObjectArgs args, CustomResourceOptions? opts = null)
    public WafObject(String name, WafObjectArgs args)
    public WafObject(String name, WafObjectArgs args, CustomResourceOptions options)
    
    type: tencentcloud:WafObject
    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 WafObjectArgs
    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 WafObjectArgs
    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 WafObjectArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WafObjectArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WafObjectArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    ObjectId string
    Modifies the object identifier.
    InstanceId string
    New instance ID: considered a successful modification if identical to an already bound instance.
    IpHeaders List<string>
    This parameter indicates a custom header and is required when proxy is set to 3.
    MemberAppId double
    The ID of the member to whom the listener belongs.
    MemberUin string
    Uin of the listener member.
    Proxy double
    Whether to enable proxy. 0: do not enable; 1: use the first IP address in XFF as the client IP address; 2: use remote_addr as the client IP address; 3: obtain the client IP address from the specified header field that is given in ip_headers.
    Status double
    New WAF switch status, considered successful if identical to existing status.
    WafObjectId string
    ID of the resource.
    ObjectId string
    Modifies the object identifier.
    InstanceId string
    New instance ID: considered a successful modification if identical to an already bound instance.
    IpHeaders []string
    This parameter indicates a custom header and is required when proxy is set to 3.
    MemberAppId float64
    The ID of the member to whom the listener belongs.
    MemberUin string
    Uin of the listener member.
    Proxy float64
    Whether to enable proxy. 0: do not enable; 1: use the first IP address in XFF as the client IP address; 2: use remote_addr as the client IP address; 3: obtain the client IP address from the specified header field that is given in ip_headers.
    Status float64
    New WAF switch status, considered successful if identical to existing status.
    WafObjectId string
    ID of the resource.
    objectId String
    Modifies the object identifier.
    instanceId String
    New instance ID: considered a successful modification if identical to an already bound instance.
    ipHeaders List<String>
    This parameter indicates a custom header and is required when proxy is set to 3.
    memberAppId Double
    The ID of the member to whom the listener belongs.
    memberUin String
    Uin of the listener member.
    proxy Double
    Whether to enable proxy. 0: do not enable; 1: use the first IP address in XFF as the client IP address; 2: use remote_addr as the client IP address; 3: obtain the client IP address from the specified header field that is given in ip_headers.
    status Double
    New WAF switch status, considered successful if identical to existing status.
    wafObjectId String
    ID of the resource.
    objectId string
    Modifies the object identifier.
    instanceId string
    New instance ID: considered a successful modification if identical to an already bound instance.
    ipHeaders string[]
    This parameter indicates a custom header and is required when proxy is set to 3.
    memberAppId number
    The ID of the member to whom the listener belongs.
    memberUin string
    Uin of the listener member.
    proxy number
    Whether to enable proxy. 0: do not enable; 1: use the first IP address in XFF as the client IP address; 2: use remote_addr as the client IP address; 3: obtain the client IP address from the specified header field that is given in ip_headers.
    status number
    New WAF switch status, considered successful if identical to existing status.
    wafObjectId string
    ID of the resource.
    object_id str
    Modifies the object identifier.
    instance_id str
    New instance ID: considered a successful modification if identical to an already bound instance.
    ip_headers Sequence[str]
    This parameter indicates a custom header and is required when proxy is set to 3.
    member_app_id float
    The ID of the member to whom the listener belongs.
    member_uin str
    Uin of the listener member.
    proxy float
    Whether to enable proxy. 0: do not enable; 1: use the first IP address in XFF as the client IP address; 2: use remote_addr as the client IP address; 3: obtain the client IP address from the specified header field that is given in ip_headers.
    status float
    New WAF switch status, considered successful if identical to existing status.
    waf_object_id str
    ID of the resource.
    objectId String
    Modifies the object identifier.
    instanceId String
    New instance ID: considered a successful modification if identical to an already bound instance.
    ipHeaders List<String>
    This parameter indicates a custom header and is required when proxy is set to 3.
    memberAppId Number
    The ID of the member to whom the listener belongs.
    memberUin String
    Uin of the listener member.
    proxy Number
    Whether to enable proxy. 0: do not enable; 1: use the first IP address in XFF as the client IP address; 2: use remote_addr as the client IP address; 3: obtain the client IP address from the specified header field that is given in ip_headers.
    status Number
    New WAF switch status, considered successful if identical to existing status.
    wafObjectId String
    ID of the resource.

    Outputs

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

    Get an existing WafObject 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?: WafObjectState, opts?: CustomResourceOptions): WafObject
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            instance_id: Optional[str] = None,
            ip_headers: Optional[Sequence[str]] = None,
            member_app_id: Optional[float] = None,
            member_uin: Optional[str] = None,
            object_id: Optional[str] = None,
            proxy: Optional[float] = None,
            status: Optional[float] = None,
            waf_object_id: Optional[str] = None) -> WafObject
    func GetWafObject(ctx *Context, name string, id IDInput, state *WafObjectState, opts ...ResourceOption) (*WafObject, error)
    public static WafObject Get(string name, Input<string> id, WafObjectState? state, CustomResourceOptions? opts = null)
    public static WafObject get(String name, Output<String> id, WafObjectState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:WafObject    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:
    InstanceId string
    New instance ID: considered a successful modification if identical to an already bound instance.
    IpHeaders List<string>
    This parameter indicates a custom header and is required when proxy is set to 3.
    MemberAppId double
    The ID of the member to whom the listener belongs.
    MemberUin string
    Uin of the listener member.
    ObjectId string
    Modifies the object identifier.
    Proxy double
    Whether to enable proxy. 0: do not enable; 1: use the first IP address in XFF as the client IP address; 2: use remote_addr as the client IP address; 3: obtain the client IP address from the specified header field that is given in ip_headers.
    Status double
    New WAF switch status, considered successful if identical to existing status.
    WafObjectId string
    ID of the resource.
    InstanceId string
    New instance ID: considered a successful modification if identical to an already bound instance.
    IpHeaders []string
    This parameter indicates a custom header and is required when proxy is set to 3.
    MemberAppId float64
    The ID of the member to whom the listener belongs.
    MemberUin string
    Uin of the listener member.
    ObjectId string
    Modifies the object identifier.
    Proxy float64
    Whether to enable proxy. 0: do not enable; 1: use the first IP address in XFF as the client IP address; 2: use remote_addr as the client IP address; 3: obtain the client IP address from the specified header field that is given in ip_headers.
    Status float64
    New WAF switch status, considered successful if identical to existing status.
    WafObjectId string
    ID of the resource.
    instanceId String
    New instance ID: considered a successful modification if identical to an already bound instance.
    ipHeaders List<String>
    This parameter indicates a custom header and is required when proxy is set to 3.
    memberAppId Double
    The ID of the member to whom the listener belongs.
    memberUin String
    Uin of the listener member.
    objectId String
    Modifies the object identifier.
    proxy Double
    Whether to enable proxy. 0: do not enable; 1: use the first IP address in XFF as the client IP address; 2: use remote_addr as the client IP address; 3: obtain the client IP address from the specified header field that is given in ip_headers.
    status Double
    New WAF switch status, considered successful if identical to existing status.
    wafObjectId String
    ID of the resource.
    instanceId string
    New instance ID: considered a successful modification if identical to an already bound instance.
    ipHeaders string[]
    This parameter indicates a custom header and is required when proxy is set to 3.
    memberAppId number
    The ID of the member to whom the listener belongs.
    memberUin string
    Uin of the listener member.
    objectId string
    Modifies the object identifier.
    proxy number
    Whether to enable proxy. 0: do not enable; 1: use the first IP address in XFF as the client IP address; 2: use remote_addr as the client IP address; 3: obtain the client IP address from the specified header field that is given in ip_headers.
    status number
    New WAF switch status, considered successful if identical to existing status.
    wafObjectId string
    ID of the resource.
    instance_id str
    New instance ID: considered a successful modification if identical to an already bound instance.
    ip_headers Sequence[str]
    This parameter indicates a custom header and is required when proxy is set to 3.
    member_app_id float
    The ID of the member to whom the listener belongs.
    member_uin str
    Uin of the listener member.
    object_id str
    Modifies the object identifier.
    proxy float
    Whether to enable proxy. 0: do not enable; 1: use the first IP address in XFF as the client IP address; 2: use remote_addr as the client IP address; 3: obtain the client IP address from the specified header field that is given in ip_headers.
    status float
    New WAF switch status, considered successful if identical to existing status.
    waf_object_id str
    ID of the resource.
    instanceId String
    New instance ID: considered a successful modification if identical to an already bound instance.
    ipHeaders List<String>
    This parameter indicates a custom header and is required when proxy is set to 3.
    memberAppId Number
    The ID of the member to whom the listener belongs.
    memberUin String
    Uin of the listener member.
    objectId String
    Modifies the object identifier.
    proxy Number
    Whether to enable proxy. 0: do not enable; 1: use the first IP address in XFF as the client IP address; 2: use remote_addr as the client IP address; 3: obtain the client IP address from the specified header field that is given in ip_headers.
    status Number
    New WAF switch status, considered successful if identical to existing status.
    wafObjectId String
    ID of the resource.

    Import

    Waf object can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/wafObject:WafObject example lb-9h5x9lze
    

    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
    Viewing docs for tencentcloud 1.82.79
    published on Friday, Mar 27, 2026 by tencentcloudstack
      Try Pulumi Cloud free. Your team will thank you.