1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. ClsScheduledSql
tencentcloud 1.81.182 published on Monday, Apr 14, 2025 by tencentcloudstack

tencentcloud.ClsScheduledSql

Explore with Pulumi AI

Provides a resource to create a cls scheduled_sql

Example Usage

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

const logset = new tencentcloud.ClsLogset("logset", {
    logsetName: "tf-example-logset",
    tags: {
        createdBy: "terraform",
    },
});
const topic = new tencentcloud.ClsTopic("topic", {
    topicName: "tf-example-topic",
    logsetId: logset.clsLogsetId,
    autoSplit: false,
    maxSplitPartitions: 20,
    partitionCount: 1,
    period: 10,
    storageType: "hot",
    tags: {
        test: "test",
    },
});
const scheduledSql = new tencentcloud.ClsScheduledSql("scheduledSql", {
    srcTopicId: topic.clsTopicId,
    enableFlag: 1,
    dstResource: {
        topicId: topic.clsTopicId,
        region: "ap-guangzhou",
        bizType: 0,
        metricName: "test",
    },
    scheduledSqlContent: "xxx",
    processStartTime: 1690515360000,
    processType: 1,
    processPeriod: 10,
    processTimeWindow: "@m-15m,@m",
    processDelay: 5,
    srcTopicRegion: "ap-guangzhou",
    processEndTime: 1690515360000,
    syntaxRule: 0,
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

logset = tencentcloud.ClsLogset("logset",
    logset_name="tf-example-logset",
    tags={
        "createdBy": "terraform",
    })
topic = tencentcloud.ClsTopic("topic",
    topic_name="tf-example-topic",
    logset_id=logset.cls_logset_id,
    auto_split=False,
    max_split_partitions=20,
    partition_count=1,
    period=10,
    storage_type="hot",
    tags={
        "test": "test",
    })
scheduled_sql = tencentcloud.ClsScheduledSql("scheduledSql",
    src_topic_id=topic.cls_topic_id,
    enable_flag=1,
    dst_resource={
        "topic_id": topic.cls_topic_id,
        "region": "ap-guangzhou",
        "biz_type": 0,
        "metric_name": "test",
    },
    scheduled_sql_content="xxx",
    process_start_time=1690515360000,
    process_type=1,
    process_period=10,
    process_time_window="@m-15m,@m",
    process_delay=5,
    src_topic_region="ap-guangzhou",
    process_end_time=1690515360000,
    syntax_rule=0)
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 {
		logset, err := tencentcloud.NewClsLogset(ctx, "logset", &tencentcloud.ClsLogsetArgs{
			LogsetName: pulumi.String("tf-example-logset"),
			Tags: pulumi.StringMap{
				"createdBy": pulumi.String("terraform"),
			},
		})
		if err != nil {
			return err
		}
		topic, err := tencentcloud.NewClsTopic(ctx, "topic", &tencentcloud.ClsTopicArgs{
			TopicName:          pulumi.String("tf-example-topic"),
			LogsetId:           logset.ClsLogsetId,
			AutoSplit:          pulumi.Bool(false),
			MaxSplitPartitions: pulumi.Float64(20),
			PartitionCount:     pulumi.Float64(1),
			Period:             pulumi.Float64(10),
			StorageType:        pulumi.String("hot"),
			Tags: pulumi.StringMap{
				"test": pulumi.String("test"),
			},
		})
		if err != nil {
			return err
		}
		_, err = tencentcloud.NewClsScheduledSql(ctx, "scheduledSql", &tencentcloud.ClsScheduledSqlArgs{
			SrcTopicId: topic.ClsTopicId,
			EnableFlag: pulumi.Float64(1),
			DstResource: &tencentcloud.ClsScheduledSqlDstResourceArgs{
				TopicId:    topic.ClsTopicId,
				Region:     pulumi.String("ap-guangzhou"),
				BizType:    pulumi.Float64(0),
				MetricName: pulumi.String("test"),
			},
			ScheduledSqlContent: pulumi.String("xxx"),
			ProcessStartTime:    pulumi.Float64(1690515360000),
			ProcessType:         pulumi.Float64(1),
			ProcessPeriod:       pulumi.Float64(10),
			ProcessTimeWindow:   pulumi.String("@m-15m,@m"),
			ProcessDelay:        pulumi.Float64(5),
			SrcTopicRegion:      pulumi.String("ap-guangzhou"),
			ProcessEndTime:      pulumi.Float64(1690515360000),
			SyntaxRule:          pulumi.Float64(0),
		})
		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 logset = new Tencentcloud.ClsLogset("logset", new()
    {
        LogsetName = "tf-example-logset",
        Tags = 
        {
            { "createdBy", "terraform" },
        },
    });

    var topic = new Tencentcloud.ClsTopic("topic", new()
    {
        TopicName = "tf-example-topic",
        LogsetId = logset.ClsLogsetId,
        AutoSplit = false,
        MaxSplitPartitions = 20,
        PartitionCount = 1,
        Period = 10,
        StorageType = "hot",
        Tags = 
        {
            { "test", "test" },
        },
    });

    var scheduledSql = new Tencentcloud.ClsScheduledSql("scheduledSql", new()
    {
        SrcTopicId = topic.ClsTopicId,
        EnableFlag = 1,
        DstResource = new Tencentcloud.Inputs.ClsScheduledSqlDstResourceArgs
        {
            TopicId = topic.ClsTopicId,
            Region = "ap-guangzhou",
            BizType = 0,
            MetricName = "test",
        },
        ScheduledSqlContent = "xxx",
        ProcessStartTime = 1690515360000,
        ProcessType = 1,
        ProcessPeriod = 10,
        ProcessTimeWindow = "@m-15m,@m",
        ProcessDelay = 5,
        SrcTopicRegion = "ap-guangzhou",
        ProcessEndTime = 1690515360000,
        SyntaxRule = 0,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ClsLogset;
import com.pulumi.tencentcloud.ClsLogsetArgs;
import com.pulumi.tencentcloud.ClsTopic;
import com.pulumi.tencentcloud.ClsTopicArgs;
import com.pulumi.tencentcloud.ClsScheduledSql;
import com.pulumi.tencentcloud.ClsScheduledSqlArgs;
import com.pulumi.tencentcloud.inputs.ClsScheduledSqlDstResourceArgs;
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 logset = new ClsLogset("logset", ClsLogsetArgs.builder()
            .logsetName("tf-example-logset")
            .tags(Map.of("createdBy", "terraform"))
            .build());

        var topic = new ClsTopic("topic", ClsTopicArgs.builder()
            .topicName("tf-example-topic")
            .logsetId(logset.clsLogsetId())
            .autoSplit(false)
            .maxSplitPartitions(20)
            .partitionCount(1)
            .period(10)
            .storageType("hot")
            .tags(Map.of("test", "test"))
            .build());

        var scheduledSql = new ClsScheduledSql("scheduledSql", ClsScheduledSqlArgs.builder()
            .srcTopicId(topic.clsTopicId())
            .enableFlag(1)
            .dstResource(ClsScheduledSqlDstResourceArgs.builder()
                .topicId(topic.clsTopicId())
                .region("ap-guangzhou")
                .bizType(0)
                .metricName("test")
                .build())
            .scheduledSqlContent("xxx")
            .processStartTime(1690515360000)
            .processType(1)
            .processPeriod(10)
            .processTimeWindow("@m-15m,@m")
            .processDelay(5)
            .srcTopicRegion("ap-guangzhou")
            .processEndTime(1690515360000)
            .syntaxRule(0)
            .build());

    }
}
Copy
resources:
  logset:
    type: tencentcloud:ClsLogset
    properties:
      logsetName: tf-example-logset
      tags:
        createdBy: terraform
  topic:
    type: tencentcloud:ClsTopic
    properties:
      topicName: tf-example-topic
      logsetId: ${logset.clsLogsetId}
      autoSplit: false
      maxSplitPartitions: 20
      partitionCount: 1
      period: 10
      storageType: hot
      tags:
        test: test
  scheduledSql:
    type: tencentcloud:ClsScheduledSql
    properties:
      srcTopicId: ${topic.clsTopicId}
      enableFlag: 1
      dstResource:
        topicId: ${topic.clsTopicId}
        region: ap-guangzhou
        bizType: 0
        metricName: test
      scheduledSqlContent: xxx
      processStartTime: 1.69051536e+12
      processType: 1
      processPeriod: 10
      processTimeWindow: '@m-15m,@m'
      processDelay: 5
      srcTopicRegion: ap-guangzhou
      processEndTime: 1.69051536e+12
      syntaxRule: 0
Copy

Create ClsScheduledSql Resource

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

Constructor syntax

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

@overload
def ClsScheduledSql(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    process_type: Optional[float] = None,
                    src_topic_region: Optional[str] = None,
                    enable_flag: Optional[float] = None,
                    process_start_time: Optional[float] = None,
                    process_delay: Optional[float] = None,
                    src_topic_id: Optional[str] = None,
                    process_time_window: Optional[str] = None,
                    process_period: Optional[float] = None,
                    dst_resource: Optional[ClsScheduledSqlDstResourceArgs] = None,
                    scheduled_sql_content: Optional[str] = None,
                    cls_scheduled_sql_id: Optional[str] = None,
                    process_end_time: Optional[float] = None,
                    name: Optional[str] = None,
                    syntax_rule: Optional[float] = None)
func NewClsScheduledSql(ctx *Context, name string, args ClsScheduledSqlArgs, opts ...ResourceOption) (*ClsScheduledSql, error)
public ClsScheduledSql(string name, ClsScheduledSqlArgs args, CustomResourceOptions? opts = null)
public ClsScheduledSql(String name, ClsScheduledSqlArgs args)
public ClsScheduledSql(String name, ClsScheduledSqlArgs args, CustomResourceOptions options)
type: tencentcloud:ClsScheduledSql
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. ClsScheduledSqlArgs
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. ClsScheduledSqlArgs
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. ClsScheduledSqlArgs
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. ClsScheduledSqlArgs
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. ClsScheduledSqlArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

DstResource This property is required. ClsScheduledSqlDstResource
scheduled slq dst resource.
EnableFlag This property is required. double
task enable flag.
ProcessDelay This property is required. double
process delay.
ProcessPeriod This property is required. double
process period.
ProcessStartTime This property is required. double
process start timestamp.
ProcessTimeWindow This property is required. string
process time window.
ProcessType This property is required. double
process type.
ScheduledSqlContent This property is required. string
scheduled sql content.
SrcTopicId This property is required. string
src topic id.
SrcTopicRegion This property is required. string
src topic region.
ClsScheduledSqlId string
ID of the resource.
Name string
task name.
ProcessEndTime double
process end timestamp.
SyntaxRule double
syntax rule.
DstResource This property is required. ClsScheduledSqlDstResourceArgs
scheduled slq dst resource.
EnableFlag This property is required. float64
task enable flag.
ProcessDelay This property is required. float64
process delay.
ProcessPeriod This property is required. float64
process period.
ProcessStartTime This property is required. float64
process start timestamp.
ProcessTimeWindow This property is required. string
process time window.
ProcessType This property is required. float64
process type.
ScheduledSqlContent This property is required. string
scheduled sql content.
SrcTopicId This property is required. string
src topic id.
SrcTopicRegion This property is required. string
src topic region.
ClsScheduledSqlId string
ID of the resource.
Name string
task name.
ProcessEndTime float64
process end timestamp.
SyntaxRule float64
syntax rule.
dstResource This property is required. ClsScheduledSqlDstResource
scheduled slq dst resource.
enableFlag This property is required. Double
task enable flag.
processDelay This property is required. Double
process delay.
processPeriod This property is required. Double
process period.
processStartTime This property is required. Double
process start timestamp.
processTimeWindow This property is required. String
process time window.
processType This property is required. Double
process type.
scheduledSqlContent This property is required. String
scheduled sql content.
srcTopicId This property is required. String
src topic id.
srcTopicRegion This property is required. String
src topic region.
clsScheduledSqlId String
ID of the resource.
name String
task name.
processEndTime Double
process end timestamp.
syntaxRule Double
syntax rule.
dstResource This property is required. ClsScheduledSqlDstResource
scheduled slq dst resource.
enableFlag This property is required. number
task enable flag.
processDelay This property is required. number
process delay.
processPeriod This property is required. number
process period.
processStartTime This property is required. number
process start timestamp.
processTimeWindow This property is required. string
process time window.
processType This property is required. number
process type.
scheduledSqlContent This property is required. string
scheduled sql content.
srcTopicId This property is required. string
src topic id.
srcTopicRegion This property is required. string
src topic region.
clsScheduledSqlId string
ID of the resource.
name string
task name.
processEndTime number
process end timestamp.
syntaxRule number
syntax rule.
dst_resource This property is required. ClsScheduledSqlDstResourceArgs
scheduled slq dst resource.
enable_flag This property is required. float
task enable flag.
process_delay This property is required. float
process delay.
process_period This property is required. float
process period.
process_start_time This property is required. float
process start timestamp.
process_time_window This property is required. str
process time window.
process_type This property is required. float
process type.
scheduled_sql_content This property is required. str
scheduled sql content.
src_topic_id This property is required. str
src topic id.
src_topic_region This property is required. str
src topic region.
cls_scheduled_sql_id str
ID of the resource.
name str
task name.
process_end_time float
process end timestamp.
syntax_rule float
syntax rule.
dstResource This property is required. Property Map
scheduled slq dst resource.
enableFlag This property is required. Number
task enable flag.
processDelay This property is required. Number
process delay.
processPeriod This property is required. Number
process period.
processStartTime This property is required. Number
process start timestamp.
processTimeWindow This property is required. String
process time window.
processType This property is required. Number
process type.
scheduledSqlContent This property is required. String
scheduled sql content.
srcTopicId This property is required. String
src topic id.
srcTopicRegion This property is required. String
src topic region.
clsScheduledSqlId String
ID of the resource.
name String
task name.
processEndTime Number
process end timestamp.
syntaxRule Number
syntax rule.

Outputs

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

Get an existing ClsScheduledSql 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?: ClsScheduledSqlState, opts?: CustomResourceOptions): ClsScheduledSql
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cls_scheduled_sql_id: Optional[str] = None,
        dst_resource: Optional[ClsScheduledSqlDstResourceArgs] = None,
        enable_flag: Optional[float] = None,
        name: Optional[str] = None,
        process_delay: Optional[float] = None,
        process_end_time: Optional[float] = None,
        process_period: Optional[float] = None,
        process_start_time: Optional[float] = None,
        process_time_window: Optional[str] = None,
        process_type: Optional[float] = None,
        scheduled_sql_content: Optional[str] = None,
        src_topic_id: Optional[str] = None,
        src_topic_region: Optional[str] = None,
        syntax_rule: Optional[float] = None) -> ClsScheduledSql
func GetClsScheduledSql(ctx *Context, name string, id IDInput, state *ClsScheduledSqlState, opts ...ResourceOption) (*ClsScheduledSql, error)
public static ClsScheduledSql Get(string name, Input<string> id, ClsScheduledSqlState? state, CustomResourceOptions? opts = null)
public static ClsScheduledSql get(String name, Output<String> id, ClsScheduledSqlState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:ClsScheduledSql    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:
ClsScheduledSqlId string
ID of the resource.
DstResource ClsScheduledSqlDstResource
scheduled slq dst resource.
EnableFlag double
task enable flag.
Name string
task name.
ProcessDelay double
process delay.
ProcessEndTime double
process end timestamp.
ProcessPeriod double
process period.
ProcessStartTime double
process start timestamp.
ProcessTimeWindow string
process time window.
ProcessType double
process type.
ScheduledSqlContent string
scheduled sql content.
SrcTopicId string
src topic id.
SrcTopicRegion string
src topic region.
SyntaxRule double
syntax rule.
ClsScheduledSqlId string
ID of the resource.
DstResource ClsScheduledSqlDstResourceArgs
scheduled slq dst resource.
EnableFlag float64
task enable flag.
Name string
task name.
ProcessDelay float64
process delay.
ProcessEndTime float64
process end timestamp.
ProcessPeriod float64
process period.
ProcessStartTime float64
process start timestamp.
ProcessTimeWindow string
process time window.
ProcessType float64
process type.
ScheduledSqlContent string
scheduled sql content.
SrcTopicId string
src topic id.
SrcTopicRegion string
src topic region.
SyntaxRule float64
syntax rule.
clsScheduledSqlId String
ID of the resource.
dstResource ClsScheduledSqlDstResource
scheduled slq dst resource.
enableFlag Double
task enable flag.
name String
task name.
processDelay Double
process delay.
processEndTime Double
process end timestamp.
processPeriod Double
process period.
processStartTime Double
process start timestamp.
processTimeWindow String
process time window.
processType Double
process type.
scheduledSqlContent String
scheduled sql content.
srcTopicId String
src topic id.
srcTopicRegion String
src topic region.
syntaxRule Double
syntax rule.
clsScheduledSqlId string
ID of the resource.
dstResource ClsScheduledSqlDstResource
scheduled slq dst resource.
enableFlag number
task enable flag.
name string
task name.
processDelay number
process delay.
processEndTime number
process end timestamp.
processPeriod number
process period.
processStartTime number
process start timestamp.
processTimeWindow string
process time window.
processType number
process type.
scheduledSqlContent string
scheduled sql content.
srcTopicId string
src topic id.
srcTopicRegion string
src topic region.
syntaxRule number
syntax rule.
cls_scheduled_sql_id str
ID of the resource.
dst_resource ClsScheduledSqlDstResourceArgs
scheduled slq dst resource.
enable_flag float
task enable flag.
name str
task name.
process_delay float
process delay.
process_end_time float
process end timestamp.
process_period float
process period.
process_start_time float
process start timestamp.
process_time_window str
process time window.
process_type float
process type.
scheduled_sql_content str
scheduled sql content.
src_topic_id str
src topic id.
src_topic_region str
src topic region.
syntax_rule float
syntax rule.
clsScheduledSqlId String
ID of the resource.
dstResource Property Map
scheduled slq dst resource.
enableFlag Number
task enable flag.
name String
task name.
processDelay Number
process delay.
processEndTime Number
process end timestamp.
processPeriod Number
process period.
processStartTime Number
process start timestamp.
processTimeWindow String
process time window.
processType Number
process type.
scheduledSqlContent String
scheduled sql content.
srcTopicId String
src topic id.
srcTopicRegion String
src topic region.
syntaxRule Number
syntax rule.

Supporting Types

ClsScheduledSqlDstResource
, ClsScheduledSqlDstResourceArgs

TopicId This property is required. string
dst topic id.
BizType double
topic type.
MetricName string
metric name.
Region string
topic region.
TopicId This property is required. string
dst topic id.
BizType float64
topic type.
MetricName string
metric name.
Region string
topic region.
topicId This property is required. String
dst topic id.
bizType Double
topic type.
metricName String
metric name.
region String
topic region.
topicId This property is required. string
dst topic id.
bizType number
topic type.
metricName string
metric name.
region string
topic region.
topic_id This property is required. str
dst topic id.
biz_type float
topic type.
metric_name str
metric name.
region str
topic region.
topicId This property is required. String
dst topic id.
bizType Number
topic type.
metricName String
metric name.
region String
topic region.

Import

cls scheduled_sql can be imported using the id, e.g.

$ pulumi import tencentcloud:index/clsScheduledSql:ClsScheduledSql scheduled_sql scheduled_sql_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.