1. Packages
  2. Packages
  3. Tencentcloud Provider
  4. API Docs
  5. TeoSecurityApiResource
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 API security resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.TeoSecurityApiService("example", {
        zoneId: "zone-3fkff38fyw8s",
        apiServices: {
            name: "tf-example",
            basePath: "/api/v1",
        },
    });
    const exampleTeoSecurityApiResource = new tencentcloud.TeoSecurityApiResource("example", {
        zoneId: "zone-3fkff38fyw8s",
        apiResources: {
            name: "tf-example",
            path: "/api/v1/orders",
            apiServiceIds: [example.apiServices.apply(apiServices => apiServices.id)],
            methods: [
                "GET",
                "POST",
            ],
            requestConstraint: "${http.request.body.form['operationType']} in ['query', 'create']",
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.TeoSecurityApiService("example",
        zone_id="zone-3fkff38fyw8s",
        api_services={
            "name": "tf-example",
            "base_path": "/api/v1",
        })
    example_teo_security_api_resource = tencentcloud.TeoSecurityApiResource("example",
        zone_id="zone-3fkff38fyw8s",
        api_resources={
            "name": "tf-example",
            "path": "/api/v1/orders",
            "api_service_ids": [example.api_services.id],
            "methods": [
                "GET",
                "POST",
            ],
            "request_constraint": "${http.request.body.form['operationType']} in ['query', 'create']",
        })
    
    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 {
    		example, err := tencentcloud.NewTeoSecurityApiService(ctx, "example", &tencentcloud.TeoSecurityApiServiceArgs{
    			ZoneId: pulumi.String("zone-3fkff38fyw8s"),
    			ApiServices: &tencentcloud.TeoSecurityApiServiceApiServicesArgs{
    				Name:     pulumi.String("tf-example"),
    				BasePath: pulumi.String("/api/v1"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewTeoSecurityApiResource(ctx, "example", &tencentcloud.TeoSecurityApiResourceArgs{
    			ZoneId: pulumi.String("zone-3fkff38fyw8s"),
    			ApiResources: &tencentcloud.TeoSecurityApiResourceApiResourcesArgs{
    				Name: pulumi.String("tf-example"),
    				Path: pulumi.String("/api/v1/orders"),
    				ApiServiceIds: pulumi.StringArray{
    					example.ApiServices.ApplyT(func(apiServices tencentcloud.TeoSecurityApiServiceApiServices) (*string, error) {
    						return &apiServices.Id, nil
    					}).(pulumi.StringPtrOutput),
    				},
    				Methods: pulumi.StringArray{
    					pulumi.String("GET"),
    					pulumi.String("POST"),
    				},
    				RequestConstraint: pulumi.String("${http.request.body.form['operationType']} in ['query', 'create']"),
    			},
    		})
    		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.TeoSecurityApiService("example", new()
        {
            ZoneId = "zone-3fkff38fyw8s",
            ApiServices = new Tencentcloud.Inputs.TeoSecurityApiServiceApiServicesArgs
            {
                Name = "tf-example",
                BasePath = "/api/v1",
            },
        });
    
        var exampleTeoSecurityApiResource = new Tencentcloud.TeoSecurityApiResource("example", new()
        {
            ZoneId = "zone-3fkff38fyw8s",
            ApiResources = new Tencentcloud.Inputs.TeoSecurityApiResourceApiResourcesArgs
            {
                Name = "tf-example",
                Path = "/api/v1/orders",
                ApiServiceIds = new[]
                {
                    example.ApiServices.Apply(apiServices => apiServices.Id),
                },
                Methods = new[]
                {
                    "GET",
                    "POST",
                },
                RequestConstraint = "${http.request.body.form['operationType']} in ['query', 'create']",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TeoSecurityApiService;
    import com.pulumi.tencentcloud.TeoSecurityApiServiceArgs;
    import com.pulumi.tencentcloud.inputs.TeoSecurityApiServiceApiServicesArgs;
    import com.pulumi.tencentcloud.TeoSecurityApiResource;
    import com.pulumi.tencentcloud.TeoSecurityApiResourceArgs;
    import com.pulumi.tencentcloud.inputs.TeoSecurityApiResourceApiResourcesArgs;
    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 TeoSecurityApiService("example", TeoSecurityApiServiceArgs.builder()
                .zoneId("zone-3fkff38fyw8s")
                .apiServices(TeoSecurityApiServiceApiServicesArgs.builder()
                    .name("tf-example")
                    .basePath("/api/v1")
                    .build())
                .build());
    
            var exampleTeoSecurityApiResource = new TeoSecurityApiResource("exampleTeoSecurityApiResource", TeoSecurityApiResourceArgs.builder()
                .zoneId("zone-3fkff38fyw8s")
                .apiResources(TeoSecurityApiResourceApiResourcesArgs.builder()
                    .name("tf-example")
                    .path("/api/v1/orders")
                    .apiServiceIds(example.apiServices().applyValue(_apiServices -> _apiServices.id()))
                    .methods(                
                        "GET",
                        "POST")
                    .requestConstraint("${http.request.body.form['operationType']} in ['query', 'create']")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:TeoSecurityApiService
        properties:
          zoneId: zone-3fkff38fyw8s
          apiServices:
            name: tf-example
            basePath: /api/v1
      exampleTeoSecurityApiResource:
        type: tencentcloud:TeoSecurityApiResource
        name: example
        properties:
          zoneId: zone-3fkff38fyw8s
          apiResources:
            name: tf-example
            path: /api/v1/orders
            apiServiceIds:
              - ${example.apiServices.id}
            methods:
              - GET
              - POST
            requestConstraint: $${http.request.body.form['operationType']} in ['query', 'create']
    
    Example coming soon!
    

    Create TeoSecurityApiResource Resource

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

    Constructor syntax

    new TeoSecurityApiResource(name: string, args: TeoSecurityApiResourceArgs, opts?: CustomResourceOptions);
    @overload
    def TeoSecurityApiResource(resource_name: str,
                               args: TeoSecurityApiResourceArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def TeoSecurityApiResource(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               api_resources: Optional[TeoSecurityApiResourceApiResourcesArgs] = None,
                               zone_id: Optional[str] = None,
                               teo_security_api_resource_id: Optional[str] = None)
    func NewTeoSecurityApiResource(ctx *Context, name string, args TeoSecurityApiResourceArgs, opts ...ResourceOption) (*TeoSecurityApiResource, error)
    public TeoSecurityApiResource(string name, TeoSecurityApiResourceArgs args, CustomResourceOptions? opts = null)
    public TeoSecurityApiResource(String name, TeoSecurityApiResourceArgs args)
    public TeoSecurityApiResource(String name, TeoSecurityApiResourceArgs args, CustomResourceOptions options)
    
    type: tencentcloud:TeoSecurityApiResource
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "tencentcloud_teosecurityapiresource" "name" {
        # resource properties
    }

    Parameters

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

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

    ApiResources TeoSecurityApiResourceApiResources
    API resource configuration. Only one resource is allowed per request.
    ZoneId string
    Site ID.
    TeoSecurityApiResourceId string
    ID of the resource.
    ApiResources TeoSecurityApiResourceApiResourcesArgs
    API resource configuration. Only one resource is allowed per request.
    ZoneId string
    Site ID.
    TeoSecurityApiResourceId string
    ID of the resource.
    api_resources object
    API resource configuration. Only one resource is allowed per request.
    zone_id string
    Site ID.
    teo_security_api_resource_id string
    ID of the resource.
    apiResources TeoSecurityApiResourceApiResources
    API resource configuration. Only one resource is allowed per request.
    zoneId String
    Site ID.
    teoSecurityApiResourceId String
    ID of the resource.
    apiResources TeoSecurityApiResourceApiResources
    API resource configuration. Only one resource is allowed per request.
    zoneId string
    Site ID.
    teoSecurityApiResourceId string
    ID of the resource.
    api_resources TeoSecurityApiResourceApiResourcesArgs
    API resource configuration. Only one resource is allowed per request.
    zone_id str
    Site ID.
    teo_security_api_resource_id str
    ID of the resource.
    apiResources Property Map
    API resource configuration. Only one resource is allowed per request.
    zoneId String
    Site ID.
    teoSecurityApiResourceId String
    ID of the resource.

    Outputs

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

    Get an existing TeoSecurityApiResource 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?: TeoSecurityApiResourceState, opts?: CustomResourceOptions): TeoSecurityApiResource
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_resources: Optional[TeoSecurityApiResourceApiResourcesArgs] = None,
            teo_security_api_resource_id: Optional[str] = None,
            zone_id: Optional[str] = None) -> TeoSecurityApiResource
    func GetTeoSecurityApiResource(ctx *Context, name string, id IDInput, state *TeoSecurityApiResourceState, opts ...ResourceOption) (*TeoSecurityApiResource, error)
    public static TeoSecurityApiResource Get(string name, Input<string> id, TeoSecurityApiResourceState? state, CustomResourceOptions? opts = null)
    public static TeoSecurityApiResource get(String name, Output<String> id, TeoSecurityApiResourceState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:TeoSecurityApiResource    get:      id: ${id}
    import {
      to = tencentcloud_teosecurityapiresource.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:
    ApiResources TeoSecurityApiResourceApiResources
    API resource configuration. Only one resource is allowed per request.
    TeoSecurityApiResourceId string
    ID of the resource.
    ZoneId string
    Site ID.
    ApiResources TeoSecurityApiResourceApiResourcesArgs
    API resource configuration. Only one resource is allowed per request.
    TeoSecurityApiResourceId string
    ID of the resource.
    ZoneId string
    Site ID.
    api_resources object
    API resource configuration. Only one resource is allowed per request.
    teo_security_api_resource_id string
    ID of the resource.
    zone_id string
    Site ID.
    apiResources TeoSecurityApiResourceApiResources
    API resource configuration. Only one resource is allowed per request.
    teoSecurityApiResourceId String
    ID of the resource.
    zoneId String
    Site ID.
    apiResources TeoSecurityApiResourceApiResources
    API resource configuration. Only one resource is allowed per request.
    teoSecurityApiResourceId string
    ID of the resource.
    zoneId string
    Site ID.
    api_resources TeoSecurityApiResourceApiResourcesArgs
    API resource configuration. Only one resource is allowed per request.
    teo_security_api_resource_id str
    ID of the resource.
    zone_id str
    Site ID.
    apiResources Property Map
    API resource configuration. Only one resource is allowed per request.
    teoSecurityApiResourceId String
    ID of the resource.
    zoneId String
    Site ID.

    Supporting Types

    TeoSecurityApiResourceApiResources, TeoSecurityApiResourceApiResourcesArgs

    Name string
    API resource name.
    Path string
    API resource path, e.g. /ava.
    ApiServiceIds List<string>
    Associated API service ID list.
    Id string
    ID of the resource.
    Methods List<string>
    Allowed HTTP methods. Valid values: GET, POST, PUT, HEAD, PATCH, OPTIONS, DELETE.
    RequestConstraint string
    Request content matching rule expression.
    Name string
    API resource name.
    Path string
    API resource path, e.g. /ava.
    ApiServiceIds []string
    Associated API service ID list.
    Id string
    ID of the resource.
    Methods []string
    Allowed HTTP methods. Valid values: GET, POST, PUT, HEAD, PATCH, OPTIONS, DELETE.
    RequestConstraint string
    Request content matching rule expression.
    name string
    API resource name.
    path string
    API resource path, e.g. /ava.
    api_service_ids list(string)
    Associated API service ID list.
    id string
    ID of the resource.
    methods list(string)
    Allowed HTTP methods. Valid values: GET, POST, PUT, HEAD, PATCH, OPTIONS, DELETE.
    request_constraint string
    Request content matching rule expression.
    name String
    API resource name.
    path String
    API resource path, e.g. /ava.
    apiServiceIds List<String>
    Associated API service ID list.
    id String
    ID of the resource.
    methods List<String>
    Allowed HTTP methods. Valid values: GET, POST, PUT, HEAD, PATCH, OPTIONS, DELETE.
    requestConstraint String
    Request content matching rule expression.
    name string
    API resource name.
    path string
    API resource path, e.g. /ava.
    apiServiceIds string[]
    Associated API service ID list.
    id string
    ID of the resource.
    methods string[]
    Allowed HTTP methods. Valid values: GET, POST, PUT, HEAD, PATCH, OPTIONS, DELETE.
    requestConstraint string
    Request content matching rule expression.
    name str
    API resource name.
    path str
    API resource path, e.g. /ava.
    api_service_ids Sequence[str]
    Associated API service ID list.
    id str
    ID of the resource.
    methods Sequence[str]
    Allowed HTTP methods. Valid values: GET, POST, PUT, HEAD, PATCH, OPTIONS, DELETE.
    request_constraint str
    Request content matching rule expression.
    name String
    API resource name.
    path String
    API resource path, e.g. /ava.
    apiServiceIds List<String>
    Associated API service ID list.
    id String
    ID of the resource.
    methods List<String>
    Allowed HTTP methods. Valid values: GET, POST, PUT, HEAD, PATCH, OPTIONS, DELETE.
    requestConstraint String
    Request content matching rule expression.

    Import

    TEO security API resource can be imported using the zoneId#apiResourceId, e.g.

    $ pulumi import tencentcloud:index/teoSecurityApiResource:TeoSecurityApiResource example zone-3fkff38fyw8s#apires-0000039154
    

    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.