1. Packages
  2. Packages
  3. Tencentcloud Provider
  4. API Docs
  5. TeoSecurityJsInjectionRule
Viewing docs for tencentcloud 1.82.93
published on Monday, May 11, 2026 by tencentcloudstack
Viewing docs for tencentcloud 1.82.93
published on Monday, May 11, 2026 by tencentcloudstack

    Provides a resource to create a TEO security JavaScript injection rule.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.TeoSecurityJsInjectionRule("example", {
        zoneId: "zone-3fkff38fyw8s",
        jsInjectionRules: {
            name: "tf-example",
            priority: 50,
            condition: "${http.request.host} in ['www.demo.com']",
            injectJs: "inject-sdk-only",
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.TeoSecurityJsInjectionRule("example",
        zone_id="zone-3fkff38fyw8s",
        js_injection_rules={
            "name": "tf-example",
            "priority": 50,
            "condition": "${http.request.host} in ['www.demo.com']",
            "inject_js": "inject-sdk-only",
        })
    
    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.NewTeoSecurityJsInjectionRule(ctx, "example", &tencentcloud.TeoSecurityJsInjectionRuleArgs{
    			ZoneId: pulumi.String("zone-3fkff38fyw8s"),
    			JsInjectionRules: &tencentcloud.TeoSecurityJsInjectionRuleJsInjectionRulesArgs{
    				Name:      pulumi.String("tf-example"),
    				Priority:  pulumi.Float64(50),
    				Condition: pulumi.String("${http.request.host} in ['www.demo.com']"),
    				InjectJs:  pulumi.String("inject-sdk-only"),
    			},
    		})
    		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.TeoSecurityJsInjectionRule("example", new()
        {
            ZoneId = "zone-3fkff38fyw8s",
            JsInjectionRules = new Tencentcloud.Inputs.TeoSecurityJsInjectionRuleJsInjectionRulesArgs
            {
                Name = "tf-example",
                Priority = 50,
                Condition = "${http.request.host} in ['www.demo.com']",
                InjectJs = "inject-sdk-only",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TeoSecurityJsInjectionRule;
    import com.pulumi.tencentcloud.TeoSecurityJsInjectionRuleArgs;
    import com.pulumi.tencentcloud.inputs.TeoSecurityJsInjectionRuleJsInjectionRulesArgs;
    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 TeoSecurityJsInjectionRule("example", TeoSecurityJsInjectionRuleArgs.builder()
                .zoneId("zone-3fkff38fyw8s")
                .jsInjectionRules(TeoSecurityJsInjectionRuleJsInjectionRulesArgs.builder()
                    .name("tf-example")
                    .priority(50.0)
                    .condition("${http.request.host} in ['www.demo.com']")
                    .injectJs("inject-sdk-only")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:TeoSecurityJsInjectionRule
        properties:
          zoneId: zone-3fkff38fyw8s
          jsInjectionRules:
            name: tf-example
            priority: 50
            condition: $${http.request.host} in ['www.demo.com']
            injectJs: inject-sdk-only
    
    Example coming soon!
    

    Create TeoSecurityJsInjectionRule Resource

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

    Constructor syntax

    new TeoSecurityJsInjectionRule(name: string, args: TeoSecurityJsInjectionRuleArgs, opts?: CustomResourceOptions);
    @overload
    def TeoSecurityJsInjectionRule(resource_name: str,
                                   args: TeoSecurityJsInjectionRuleArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def TeoSecurityJsInjectionRule(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   js_injection_rules: Optional[TeoSecurityJsInjectionRuleJsInjectionRulesArgs] = None,
                                   zone_id: Optional[str] = None,
                                   teo_security_js_injection_rule_id: Optional[str] = None)
    func NewTeoSecurityJsInjectionRule(ctx *Context, name string, args TeoSecurityJsInjectionRuleArgs, opts ...ResourceOption) (*TeoSecurityJsInjectionRule, error)
    public TeoSecurityJsInjectionRule(string name, TeoSecurityJsInjectionRuleArgs args, CustomResourceOptions? opts = null)
    public TeoSecurityJsInjectionRule(String name, TeoSecurityJsInjectionRuleArgs args)
    public TeoSecurityJsInjectionRule(String name, TeoSecurityJsInjectionRuleArgs args, CustomResourceOptions options)
    
    type: tencentcloud:TeoSecurityJsInjectionRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "tencentcloud_teosecurityjsinjectionrule" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args TeoSecurityJsInjectionRuleArgs
    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 TeoSecurityJsInjectionRuleArgs
    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 TeoSecurityJsInjectionRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TeoSecurityJsInjectionRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TeoSecurityJsInjectionRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    JsInjectionRules TeoSecurityJsInjectionRuleJsInjectionRules
    JavaScript injection rule configuration. Only one rule is allowed per request.
    ZoneId string
    Site ID.
    TeoSecurityJsInjectionRuleId string
    ID of the resource.
    JsInjectionRules TeoSecurityJsInjectionRuleJsInjectionRulesArgs
    JavaScript injection rule configuration. Only one rule is allowed per request.
    ZoneId string
    Site ID.
    TeoSecurityJsInjectionRuleId string
    ID of the resource.
    js_injection_rules object
    JavaScript injection rule configuration. Only one rule is allowed per request.
    zone_id string
    Site ID.
    teo_security_js_injection_rule_id string
    ID of the resource.
    jsInjectionRules TeoSecurityJsInjectionRuleJsInjectionRules
    JavaScript injection rule configuration. Only one rule is allowed per request.
    zoneId String
    Site ID.
    teoSecurityJsInjectionRuleId String
    ID of the resource.
    jsInjectionRules TeoSecurityJsInjectionRuleJsInjectionRules
    JavaScript injection rule configuration. Only one rule is allowed per request.
    zoneId string
    Site ID.
    teoSecurityJsInjectionRuleId string
    ID of the resource.
    js_injection_rules TeoSecurityJsInjectionRuleJsInjectionRulesArgs
    JavaScript injection rule configuration. Only one rule is allowed per request.
    zone_id str
    Site ID.
    teo_security_js_injection_rule_id str
    ID of the resource.
    jsInjectionRules Property Map
    JavaScript injection rule configuration. Only one rule is allowed per request.
    zoneId String
    Site ID.
    teoSecurityJsInjectionRuleId String
    ID of the resource.

    Outputs

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

    Get an existing TeoSecurityJsInjectionRule 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?: TeoSecurityJsInjectionRuleState, opts?: CustomResourceOptions): TeoSecurityJsInjectionRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            js_injection_rules: Optional[TeoSecurityJsInjectionRuleJsInjectionRulesArgs] = None,
            teo_security_js_injection_rule_id: Optional[str] = None,
            zone_id: Optional[str] = None) -> TeoSecurityJsInjectionRule
    func GetTeoSecurityJsInjectionRule(ctx *Context, name string, id IDInput, state *TeoSecurityJsInjectionRuleState, opts ...ResourceOption) (*TeoSecurityJsInjectionRule, error)
    public static TeoSecurityJsInjectionRule Get(string name, Input<string> id, TeoSecurityJsInjectionRuleState? state, CustomResourceOptions? opts = null)
    public static TeoSecurityJsInjectionRule get(String name, Output<String> id, TeoSecurityJsInjectionRuleState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:TeoSecurityJsInjectionRule    get:      id: ${id}
    import {
      to = tencentcloud_teosecurityjsinjectionrule.example
      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:
    JsInjectionRules TeoSecurityJsInjectionRuleJsInjectionRules
    JavaScript injection rule configuration. Only one rule is allowed per request.
    TeoSecurityJsInjectionRuleId string
    ID of the resource.
    ZoneId string
    Site ID.
    JsInjectionRules TeoSecurityJsInjectionRuleJsInjectionRulesArgs
    JavaScript injection rule configuration. Only one rule is allowed per request.
    TeoSecurityJsInjectionRuleId string
    ID of the resource.
    ZoneId string
    Site ID.
    js_injection_rules object
    JavaScript injection rule configuration. Only one rule is allowed per request.
    teo_security_js_injection_rule_id string
    ID of the resource.
    zone_id string
    Site ID.
    jsInjectionRules TeoSecurityJsInjectionRuleJsInjectionRules
    JavaScript injection rule configuration. Only one rule is allowed per request.
    teoSecurityJsInjectionRuleId String
    ID of the resource.
    zoneId String
    Site ID.
    jsInjectionRules TeoSecurityJsInjectionRuleJsInjectionRules
    JavaScript injection rule configuration. Only one rule is allowed per request.
    teoSecurityJsInjectionRuleId string
    ID of the resource.
    zoneId string
    Site ID.
    js_injection_rules TeoSecurityJsInjectionRuleJsInjectionRulesArgs
    JavaScript injection rule configuration. Only one rule is allowed per request.
    teo_security_js_injection_rule_id str
    ID of the resource.
    zone_id str
    Site ID.
    jsInjectionRules Property Map
    JavaScript injection rule configuration. Only one rule is allowed per request.
    teoSecurityJsInjectionRuleId String
    ID of the resource.
    zoneId String
    Site ID.

    Supporting Types

    TeoSecurityJsInjectionRuleJsInjectionRules, TeoSecurityJsInjectionRuleJsInjectionRulesArgs

    Condition string
    Match condition expression, e.g. ${http.request.host} in ['www.example.com'] and ${http.request.uri.path} in ['/path'].
    InjectJs string
    JavaScript injection option. Valid values: no-injection (do not inject JS); inject-sdk-only (inject SDK for all supported authentication methods, currently TC-RCE and TC-CAPTCHA).
    Name string
    Rule name.
    Priority double
    Rule priority. Range: 0-100, smaller value means higher priority. Default: 0.
    RuleId string
    Rule ID, e.g. injection-xxxxxxxx.
    Condition string
    Match condition expression, e.g. ${http.request.host} in ['www.example.com'] and ${http.request.uri.path} in ['/path'].
    InjectJs string
    JavaScript injection option. Valid values: no-injection (do not inject JS); inject-sdk-only (inject SDK for all supported authentication methods, currently TC-RCE and TC-CAPTCHA).
    Name string
    Rule name.
    Priority float64
    Rule priority. Range: 0-100, smaller value means higher priority. Default: 0.
    RuleId string
    Rule ID, e.g. injection-xxxxxxxx.
    condition string
    Match condition expression, e.g. ${http.request.host} in ['www.example.com'] and ${http.request.uri.path} in ['/path'].
    inject_js string
    JavaScript injection option. Valid values: no-injection (do not inject JS); inject-sdk-only (inject SDK for all supported authentication methods, currently TC-RCE and TC-CAPTCHA).
    name string
    Rule name.
    priority number
    Rule priority. Range: 0-100, smaller value means higher priority. Default: 0.
    rule_id string
    Rule ID, e.g. injection-xxxxxxxx.
    condition String
    Match condition expression, e.g. ${http.request.host} in ['www.example.com'] and ${http.request.uri.path} in ['/path'].
    injectJs String
    JavaScript injection option. Valid values: no-injection (do not inject JS); inject-sdk-only (inject SDK for all supported authentication methods, currently TC-RCE and TC-CAPTCHA).
    name String
    Rule name.
    priority Double
    Rule priority. Range: 0-100, smaller value means higher priority. Default: 0.
    ruleId String
    Rule ID, e.g. injection-xxxxxxxx.
    condition string
    Match condition expression, e.g. ${http.request.host} in ['www.example.com'] and ${http.request.uri.path} in ['/path'].
    injectJs string
    JavaScript injection option. Valid values: no-injection (do not inject JS); inject-sdk-only (inject SDK for all supported authentication methods, currently TC-RCE and TC-CAPTCHA).
    name string
    Rule name.
    priority number
    Rule priority. Range: 0-100, smaller value means higher priority. Default: 0.
    ruleId string
    Rule ID, e.g. injection-xxxxxxxx.
    condition str
    Match condition expression, e.g. ${http.request.host} in ['www.example.com'] and ${http.request.uri.path} in ['/path'].
    inject_js str
    JavaScript injection option. Valid values: no-injection (do not inject JS); inject-sdk-only (inject SDK for all supported authentication methods, currently TC-RCE and TC-CAPTCHA).
    name str
    Rule name.
    priority float
    Rule priority. Range: 0-100, smaller value means higher priority. Default: 0.
    rule_id str
    Rule ID, e.g. injection-xxxxxxxx.
    condition String
    Match condition expression, e.g. ${http.request.host} in ['www.example.com'] and ${http.request.uri.path} in ['/path'].
    injectJs String
    JavaScript injection option. Valid values: no-injection (do not inject JS); inject-sdk-only (inject SDK for all supported authentication methods, currently TC-RCE and TC-CAPTCHA).
    name String
    Rule name.
    priority Number
    Rule priority. Range: 0-100, smaller value means higher priority. Default: 0.
    ruleId String
    Rule ID, e.g. injection-xxxxxxxx.

    Import

    TEO security JavaScript injection rule can be imported using the zoneId#ruleId, e.g.

    $ pulumi import tencentcloud:index/teoSecurityJsInjectionRule:TeoSecurityJsInjectionRule example zone-3fkff38fyw8s#inject-0000040467
    

    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.
    Viewing docs for tencentcloud 1.82.93
    published on Monday, May 11, 2026 by tencentcloudstack
      Try Pulumi Cloud free. Your team will thank you.