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

tencentcloud.TeoFunction

Explore with Pulumi AI

Provides a resource to create a teo teo_function

Example Usage

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

const teoFunction = new tencentcloud.TeoFunction("teoFunction", {
    content: `    addEventListener('fetch', e => {
      const response = new Response('Hello World!!');
      e.respondWith(response);
    });

`,
    remark: "test",
    zoneId: "zone-2qtuhspy7cr6",
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

teo_function = tencentcloud.TeoFunction("teoFunction",
    content="""    addEventListener('fetch', e => {
      const response = new Response('Hello World!!');
      e.respondWith(response);
    });

""",
    remark="test",
    zone_id="zone-2qtuhspy7cr6")
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.NewTeoFunction(ctx, "teoFunction", &tencentcloud.TeoFunctionArgs{
			Content: pulumi.String(`    addEventListener('fetch', e => {
      const response = new Response('Hello World!!');
      e.respondWith(response);
    });

`),
			Remark: pulumi.String("test"),
			ZoneId: pulumi.String("zone-2qtuhspy7cr6"),
		})
		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 teoFunction = new Tencentcloud.TeoFunction("teoFunction", new()
    {
        Content = @"    addEventListener('fetch', e => {
      const response = new Response('Hello World!!');
      e.respondWith(response);
    });

",
        Remark = "test",
        ZoneId = "zone-2qtuhspy7cr6",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TeoFunction;
import com.pulumi.tencentcloud.TeoFunctionArgs;
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 teoFunction = new TeoFunction("teoFunction", TeoFunctionArgs.builder()
            .content("""
    addEventListener('fetch', e => {
      const response = new Response('Hello World!!');
      e.respondWith(response);
    });

            """)
            .remark("test")
            .zoneId("zone-2qtuhspy7cr6")
            .build());

    }
}
Copy
resources:
  teoFunction:
    type: tencentcloud:TeoFunction
    properties:
      content: |2+
            addEventListener('fetch', e => {
              const response = new Response('Hello World!!');
              e.respondWith(response);
            });

      remark: test
      zoneId: zone-2qtuhspy7cr6
Copy

Create TeoFunction Resource

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

Constructor syntax

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

@overload
def TeoFunction(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                content: Optional[str] = None,
                zone_id: Optional[str] = None,
                name: Optional[str] = None,
                remark: Optional[str] = None,
                teo_function_id: Optional[str] = None)
func NewTeoFunction(ctx *Context, name string, args TeoFunctionArgs, opts ...ResourceOption) (*TeoFunction, error)
public TeoFunction(string name, TeoFunctionArgs args, CustomResourceOptions? opts = null)
public TeoFunction(String name, TeoFunctionArgs args)
public TeoFunction(String name, TeoFunctionArgs args, CustomResourceOptions options)
type: tencentcloud:TeoFunction
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. TeoFunctionArgs
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. TeoFunctionArgs
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. TeoFunctionArgs
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. TeoFunctionArgs
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. TeoFunctionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

Content This property is required. string
Function content, currently only supports JavaScript code, with a maximum size of 5MB.
ZoneId This property is required. string
ID of the site.
Name string
Function name. It can only contain lowercase letters, numbers, hyphens, must start and end with a letter or number, and can have a maximum length of 30 characters.
Remark string
Function description, maximum support of 60 characters.
TeoFunctionId string
ID of the resource.
Content This property is required. string
Function content, currently only supports JavaScript code, with a maximum size of 5MB.
ZoneId This property is required. string
ID of the site.
Name string
Function name. It can only contain lowercase letters, numbers, hyphens, must start and end with a letter or number, and can have a maximum length of 30 characters.
Remark string
Function description, maximum support of 60 characters.
TeoFunctionId string
ID of the resource.
content This property is required. String
Function content, currently only supports JavaScript code, with a maximum size of 5MB.
zoneId This property is required. String
ID of the site.
name String
Function name. It can only contain lowercase letters, numbers, hyphens, must start and end with a letter or number, and can have a maximum length of 30 characters.
remark String
Function description, maximum support of 60 characters.
teoFunctionId String
ID of the resource.
content This property is required. string
Function content, currently only supports JavaScript code, with a maximum size of 5MB.
zoneId This property is required. string
ID of the site.
name string
Function name. It can only contain lowercase letters, numbers, hyphens, must start and end with a letter or number, and can have a maximum length of 30 characters.
remark string
Function description, maximum support of 60 characters.
teoFunctionId string
ID of the resource.
content This property is required. str
Function content, currently only supports JavaScript code, with a maximum size of 5MB.
zone_id This property is required. str
ID of the site.
name str
Function name. It can only contain lowercase letters, numbers, hyphens, must start and end with a letter or number, and can have a maximum length of 30 characters.
remark str
Function description, maximum support of 60 characters.
teo_function_id str
ID of the resource.
content This property is required. String
Function content, currently only supports JavaScript code, with a maximum size of 5MB.
zoneId This property is required. String
ID of the site.
name String
Function name. It can only contain lowercase letters, numbers, hyphens, must start and end with a letter or number, and can have a maximum length of 30 characters.
remark String
Function description, maximum support of 60 characters.
teoFunctionId String
ID of the resource.

Outputs

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

CreateTime string
Creation time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
Domain string
The default domain name for the function.
FunctionId string
ID of the Function.
Id string
The provider-assigned unique ID for this managed resource.
UpdateTime string
Modification time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
CreateTime string
Creation time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
Domain string
The default domain name for the function.
FunctionId string
ID of the Function.
Id string
The provider-assigned unique ID for this managed resource.
UpdateTime string
Modification time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
createTime String
Creation time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
domain String
The default domain name for the function.
functionId String
ID of the Function.
id String
The provider-assigned unique ID for this managed resource.
updateTime String
Modification time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
createTime string
Creation time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
domain string
The default domain name for the function.
functionId string
ID of the Function.
id string
The provider-assigned unique ID for this managed resource.
updateTime string
Modification time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
create_time str
Creation time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
domain str
The default domain name for the function.
function_id str
ID of the Function.
id str
The provider-assigned unique ID for this managed resource.
update_time str
Modification time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
createTime String
Creation time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
domain String
The default domain name for the function.
functionId String
ID of the Function.
id String
The provider-assigned unique ID for this managed resource.
updateTime String
Modification time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.

Look up Existing TeoFunction Resource

Get an existing TeoFunction 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?: TeoFunctionState, opts?: CustomResourceOptions): TeoFunction
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        content: Optional[str] = None,
        create_time: Optional[str] = None,
        domain: Optional[str] = None,
        function_id: Optional[str] = None,
        name: Optional[str] = None,
        remark: Optional[str] = None,
        teo_function_id: Optional[str] = None,
        update_time: Optional[str] = None,
        zone_id: Optional[str] = None) -> TeoFunction
func GetTeoFunction(ctx *Context, name string, id IDInput, state *TeoFunctionState, opts ...ResourceOption) (*TeoFunction, error)
public static TeoFunction Get(string name, Input<string> id, TeoFunctionState? state, CustomResourceOptions? opts = null)
public static TeoFunction get(String name, Output<String> id, TeoFunctionState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:TeoFunction    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:
Content string
Function content, currently only supports JavaScript code, with a maximum size of 5MB.
CreateTime string
Creation time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
Domain string
The default domain name for the function.
FunctionId string
ID of the Function.
Name string
Function name. It can only contain lowercase letters, numbers, hyphens, must start and end with a letter or number, and can have a maximum length of 30 characters.
Remark string
Function description, maximum support of 60 characters.
TeoFunctionId string
ID of the resource.
UpdateTime string
Modification time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
ZoneId string
ID of the site.
Content string
Function content, currently only supports JavaScript code, with a maximum size of 5MB.
CreateTime string
Creation time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
Domain string
The default domain name for the function.
FunctionId string
ID of the Function.
Name string
Function name. It can only contain lowercase letters, numbers, hyphens, must start and end with a letter or number, and can have a maximum length of 30 characters.
Remark string
Function description, maximum support of 60 characters.
TeoFunctionId string
ID of the resource.
UpdateTime string
Modification time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
ZoneId string
ID of the site.
content String
Function content, currently only supports JavaScript code, with a maximum size of 5MB.
createTime String
Creation time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
domain String
The default domain name for the function.
functionId String
ID of the Function.
name String
Function name. It can only contain lowercase letters, numbers, hyphens, must start and end with a letter or number, and can have a maximum length of 30 characters.
remark String
Function description, maximum support of 60 characters.
teoFunctionId String
ID of the resource.
updateTime String
Modification time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
zoneId String
ID of the site.
content string
Function content, currently only supports JavaScript code, with a maximum size of 5MB.
createTime string
Creation time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
domain string
The default domain name for the function.
functionId string
ID of the Function.
name string
Function name. It can only contain lowercase letters, numbers, hyphens, must start and end with a letter or number, and can have a maximum length of 30 characters.
remark string
Function description, maximum support of 60 characters.
teoFunctionId string
ID of the resource.
updateTime string
Modification time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
zoneId string
ID of the site.
content str
Function content, currently only supports JavaScript code, with a maximum size of 5MB.
create_time str
Creation time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
domain str
The default domain name for the function.
function_id str
ID of the Function.
name str
Function name. It can only contain lowercase letters, numbers, hyphens, must start and end with a letter or number, and can have a maximum length of 30 characters.
remark str
Function description, maximum support of 60 characters.
teo_function_id str
ID of the resource.
update_time str
Modification time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
zone_id str
ID of the site.
content String
Function content, currently only supports JavaScript code, with a maximum size of 5MB.
createTime String
Creation time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
domain String
The default domain name for the function.
functionId String
ID of the Function.
name String
Function name. It can only contain lowercase letters, numbers, hyphens, must start and end with a letter or number, and can have a maximum length of 30 characters.
remark String
Function description, maximum support of 60 characters.
teoFunctionId String
ID of the resource.
updateTime String
Modification time. The time is in Coordinated Universal Time (UTC) and follows the date and time format specified by the ISO 8601 standard.
zoneId String
ID of the site.

Import

teo teo_function can be imported using the id, e.g.

$ pulumi import tencentcloud:index/teoFunction:TeoFunction teo_function zone_id#function_id
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.