1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. sls
  5. ScheduledSql
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.sls.ScheduledSql

Explore with Pulumi AI

Provides a SLS Scheduled SQL resource. Scheduled SQL task.

For information about SLS Scheduled SQL and how to use it, see What is Scheduled SQL.

NOTE: Available since v1.224.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";

const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new random.index.Integer("default", {
    min: 10000,
    max: 99999,
});
const defaultKIe4KV = new alicloud.log.Project("defaultKIe4KV", {
    description: `${name}-${_default.result}`,
    projectName: `${name}-${_default.result}`,
});
const default1LI9we = new alicloud.log.Store("default1LI9we", {
    hotTtl: 8,
    retentionPeriod: 30,
    shardCount: 2,
    projectName: defaultKIe4KV.projectName,
    logstoreName: `${name}-${_default.result}`,
});
const defaultScheduledSql = new alicloud.sls.ScheduledSql("default", {
    description: "example-tf-scheduled-sql-0006",
    schedule: {
        type: "Cron",
        timeZone: "+0700",
        delay: 20,
        cronExpression: "0 0/1 * * *",
    },
    displayName: "example-tf-scheduled-sql-0006",
    scheduledSqlConfiguration: {
        script: "* | select * from log",
        sqlType: "searchQuery",
        destEndpoint: "ap-northeast-1.log.aliyuncs.com",
        destProject: "job-e2e-project-jj78kur-ap-southeast-1",
        sourceLogstore: default1LI9we.logstoreName,
        destLogstore: "example-open-api02",
        roleArn: "acs:ram::1395894005868720:role/aliyunlogetlrole",
        destRoleArn: "acs:ram::1395894005868720:role/aliyunlogetlrole",
        fromTimeExpr: "@m-1m",
        toTimeExpr: "@m",
        maxRunTimeInSeconds: 1800,
        resourcePool: "enhanced",
        maxRetries: 5,
        fromTime: 1713196800,
        toTime: 0,
        dataFormat: "log2log",
    },
    scheduledSqlName: name,
    project: defaultKIe4KV.projectName,
});
Copy
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "terraform-example"
default = random.index.Integer("default",
    min=10000,
    max=99999)
default_k_ie4_kv = alicloud.log.Project("defaultKIe4KV",
    description=f"{name}-{default['result']}",
    project_name=f"{name}-{default['result']}")
default1_li9we = alicloud.log.Store("default1LI9we",
    hot_ttl=8,
    retention_period=30,
    shard_count=2,
    project_name=default_k_ie4_kv.project_name,
    logstore_name=f"{name}-{default['result']}")
default_scheduled_sql = alicloud.sls.ScheduledSql("default",
    description="example-tf-scheduled-sql-0006",
    schedule={
        "type": "Cron",
        "time_zone": "+0700",
        "delay": 20,
        "cron_expression": "0 0/1 * * *",
    },
    display_name="example-tf-scheduled-sql-0006",
    scheduled_sql_configuration={
        "script": "* | select * from log",
        "sql_type": "searchQuery",
        "dest_endpoint": "ap-northeast-1.log.aliyuncs.com",
        "dest_project": "job-e2e-project-jj78kur-ap-southeast-1",
        "source_logstore": default1_li9we.logstore_name,
        "dest_logstore": "example-open-api02",
        "role_arn": "acs:ram::1395894005868720:role/aliyunlogetlrole",
        "dest_role_arn": "acs:ram::1395894005868720:role/aliyunlogetlrole",
        "from_time_expr": "@m-1m",
        "to_time_expr": "@m",
        "max_run_time_in_seconds": 1800,
        "resource_pool": "enhanced",
        "max_retries": 5,
        "from_time": 1713196800,
        "to_time": 0,
        "data_format": "log2log",
    },
    scheduled_sql_name=name,
    project=default_k_ie4_kv.project_name)
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/sls"
	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "terraform-example"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		_default, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
			Min: 10000,
			Max: 99999,
		})
		if err != nil {
			return err
		}
		defaultKIe4KV, err := log.NewProject(ctx, "defaultKIe4KV", &log.ProjectArgs{
			Description: pulumi.Sprintf("%v-%v", name, _default.Result),
			ProjectName: pulumi.Sprintf("%v-%v", name, _default.Result),
		})
		if err != nil {
			return err
		}
		default1LI9we, err := log.NewStore(ctx, "default1LI9we", &log.StoreArgs{
			HotTtl:          pulumi.Int(8),
			RetentionPeriod: pulumi.Int(30),
			ShardCount:      pulumi.Int(2),
			ProjectName:     defaultKIe4KV.ProjectName,
			LogstoreName:    pulumi.Sprintf("%v-%v", name, _default.Result),
		})
		if err != nil {
			return err
		}
		_, err = sls.NewScheduledSql(ctx, "default", &sls.ScheduledSqlArgs{
			Description: pulumi.String("example-tf-scheduled-sql-0006"),
			Schedule: &sls.ScheduledSqlScheduleArgs{
				Type:           pulumi.String("Cron"),
				TimeZone:       pulumi.String("+0700"),
				Delay:          pulumi.Int(20),
				CronExpression: pulumi.String("0 0/1 * * *"),
			},
			DisplayName: pulumi.String("example-tf-scheduled-sql-0006"),
			ScheduledSqlConfiguration: &sls.ScheduledSqlScheduledSqlConfigurationArgs{
				Script:              pulumi.String("* | select * from log"),
				SqlType:             pulumi.String("searchQuery"),
				DestEndpoint:        pulumi.String("ap-northeast-1.log.aliyuncs.com"),
				DestProject:         pulumi.String("job-e2e-project-jj78kur-ap-southeast-1"),
				SourceLogstore:      default1LI9we.LogstoreName,
				DestLogstore:        pulumi.String("example-open-api02"),
				RoleArn:             pulumi.String("acs:ram::1395894005868720:role/aliyunlogetlrole"),
				DestRoleArn:         pulumi.String("acs:ram::1395894005868720:role/aliyunlogetlrole"),
				FromTimeExpr:        pulumi.String("@m-1m"),
				ToTimeExpr:          pulumi.String("@m"),
				MaxRunTimeInSeconds: pulumi.Int(1800),
				ResourcePool:        pulumi.String("enhanced"),
				MaxRetries:          pulumi.Int(5),
				FromTime:            pulumi.Int(1713196800),
				ToTime:              pulumi.Int(0),
				DataFormat:          pulumi.String("log2log"),
			},
			ScheduledSqlName: pulumi.String(name),
			Project:          defaultKIe4KV.ProjectName,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var name = config.Get("name") ?? "terraform-example";
    var @default = new Random.Index.Integer("default", new()
    {
        Min = 10000,
        Max = 99999,
    });

    var defaultKIe4KV = new AliCloud.Log.Project("defaultKIe4KV", new()
    {
        Description = $"{name}-{@default.Result}",
        ProjectName = $"{name}-{@default.Result}",
    });

    var default1LI9we = new AliCloud.Log.Store("default1LI9we", new()
    {
        HotTtl = 8,
        RetentionPeriod = 30,
        ShardCount = 2,
        ProjectName = defaultKIe4KV.ProjectName,
        LogstoreName = $"{name}-{@default.Result}",
    });

    var defaultScheduledSql = new AliCloud.Sls.ScheduledSql("default", new()
    {
        Description = "example-tf-scheduled-sql-0006",
        Schedule = new AliCloud.Sls.Inputs.ScheduledSqlScheduleArgs
        {
            Type = "Cron",
            TimeZone = "+0700",
            Delay = 20,
            CronExpression = "0 0/1 * * *",
        },
        DisplayName = "example-tf-scheduled-sql-0006",
        ScheduledSqlConfiguration = new AliCloud.Sls.Inputs.ScheduledSqlScheduledSqlConfigurationArgs
        {
            Script = "* | select * from log",
            SqlType = "searchQuery",
            DestEndpoint = "ap-northeast-1.log.aliyuncs.com",
            DestProject = "job-e2e-project-jj78kur-ap-southeast-1",
            SourceLogstore = default1LI9we.LogstoreName,
            DestLogstore = "example-open-api02",
            RoleArn = "acs:ram::1395894005868720:role/aliyunlogetlrole",
            DestRoleArn = "acs:ram::1395894005868720:role/aliyunlogetlrole",
            FromTimeExpr = "@m-1m",
            ToTimeExpr = "@m",
            MaxRunTimeInSeconds = 1800,
            ResourcePool = "enhanced",
            MaxRetries = 5,
            FromTime = 1713196800,
            ToTime = 0,
            DataFormat = "log2log",
        },
        ScheduledSqlName = name,
        Project = defaultKIe4KV.ProjectName,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.integer;
import com.pulumi.random.IntegerArgs;
import com.pulumi.alicloud.log.Project;
import com.pulumi.alicloud.log.ProjectArgs;
import com.pulumi.alicloud.log.Store;
import com.pulumi.alicloud.log.StoreArgs;
import com.pulumi.alicloud.sls.ScheduledSql;
import com.pulumi.alicloud.sls.ScheduledSqlArgs;
import com.pulumi.alicloud.sls.inputs.ScheduledSqlScheduleArgs;
import com.pulumi.alicloud.sls.inputs.ScheduledSqlScheduledSqlConfigurationArgs;
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) {
        final var config = ctx.config();
        final var name = config.get("name").orElse("terraform-example");
        var default_ = new Integer("default", IntegerArgs.builder()
            .min(10000)
            .max(99999)
            .build());

        var defaultKIe4KV = new Project("defaultKIe4KV", ProjectArgs.builder()
            .description(String.format("%s-%s", name,default_.result()))
            .projectName(String.format("%s-%s", name,default_.result()))
            .build());

        var default1LI9we = new Store("default1LI9we", StoreArgs.builder()
            .hotTtl("8")
            .retentionPeriod("30")
            .shardCount("2")
            .projectName(defaultKIe4KV.projectName())
            .logstoreName(String.format("%s-%s", name,default_.result()))
            .build());

        var defaultScheduledSql = new ScheduledSql("defaultScheduledSql", ScheduledSqlArgs.builder()
            .description("example-tf-scheduled-sql-0006")
            .schedule(ScheduledSqlScheduleArgs.builder()
                .type("Cron")
                .timeZone("+0700")
                .delay("20")
                .cronExpression("0 0/1 * * *")
                .build())
            .displayName("example-tf-scheduled-sql-0006")
            .scheduledSqlConfiguration(ScheduledSqlScheduledSqlConfigurationArgs.builder()
                .script("* | select * from log")
                .sqlType("searchQuery")
                .destEndpoint("ap-northeast-1.log.aliyuncs.com")
                .destProject("job-e2e-project-jj78kur-ap-southeast-1")
                .sourceLogstore(default1LI9we.logstoreName())
                .destLogstore("example-open-api02")
                .roleArn("acs:ram::1395894005868720:role/aliyunlogetlrole")
                .destRoleArn("acs:ram::1395894005868720:role/aliyunlogetlrole")
                .fromTimeExpr("@m-1m")
                .toTimeExpr("@m")
                .maxRunTimeInSeconds("1800")
                .resourcePool("enhanced")
                .maxRetries("5")
                .fromTime("1713196800")
                .toTime("0")
                .dataFormat("log2log")
                .build())
            .scheduledSqlName(name)
            .project(defaultKIe4KV.projectName())
            .build());

    }
}
Copy
configuration:
  name:
    type: string
    default: terraform-example
resources:
  default:
    type: random:integer
    properties:
      min: 10000
      max: 99999
  defaultKIe4KV:
    type: alicloud:log:Project
    properties:
      description: ${name}-${default.result}
      projectName: ${name}-${default.result}
  default1LI9we:
    type: alicloud:log:Store
    properties:
      hotTtl: '8'
      retentionPeriod: '30'
      shardCount: '2'
      projectName: ${defaultKIe4KV.projectName}
      logstoreName: ${name}-${default.result}
  defaultScheduledSql:
    type: alicloud:sls:ScheduledSql
    name: default
    properties:
      description: example-tf-scheduled-sql-0006
      schedule:
        type: Cron
        timeZone: '+0700'
        delay: '20'
        cronExpression: 0 0/1 * * *
      displayName: example-tf-scheduled-sql-0006
      scheduledSqlConfiguration:
        script: '* | select * from log'
        sqlType: searchQuery
        destEndpoint: ap-northeast-1.log.aliyuncs.com
        destProject: job-e2e-project-jj78kur-ap-southeast-1
        sourceLogstore: ${default1LI9we.logstoreName}
        destLogstore: example-open-api02
        roleArn: acs:ram::1395894005868720:role/aliyunlogetlrole
        destRoleArn: acs:ram::1395894005868720:role/aliyunlogetlrole
        fromTimeExpr: '@m-1m'
        toTimeExpr: '@m'
        maxRunTimeInSeconds: '1800'
        resourcePool: enhanced
        maxRetries: '5'
        fromTime: '1713196800'
        toTime: '0'
        dataFormat: log2log
      scheduledSqlName: ${name}
      project: ${defaultKIe4KV.projectName}
Copy

Create ScheduledSql Resource

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

Constructor syntax

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

@overload
def ScheduledSql(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 display_name: Optional[str] = None,
                 project: Optional[str] = None,
                 schedule: Optional[ScheduledSqlScheduleArgs] = None,
                 scheduled_sql_configuration: Optional[ScheduledSqlScheduledSqlConfigurationArgs] = None,
                 scheduled_sql_name: Optional[str] = None,
                 description: Optional[str] = None)
func NewScheduledSql(ctx *Context, name string, args ScheduledSqlArgs, opts ...ResourceOption) (*ScheduledSql, error)
public ScheduledSql(string name, ScheduledSqlArgs args, CustomResourceOptions? opts = null)
public ScheduledSql(String name, ScheduledSqlArgs args)
public ScheduledSql(String name, ScheduledSqlArgs args, CustomResourceOptions options)
type: alicloud:sls:ScheduledSql
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. ScheduledSqlArgs
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. ScheduledSqlArgs
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. ScheduledSqlArgs
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. ScheduledSqlArgs
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. ScheduledSqlArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var scheduledSqlResource = new AliCloud.Sls.ScheduledSql("scheduledSqlResource", new()
{
    DisplayName = "string",
    Project = "string",
    Schedule = new AliCloud.Sls.Inputs.ScheduledSqlScheduleArgs
    {
        CronExpression = "string",
        Delay = 0,
        Interval = "string",
        RunImmediately = false,
        TimeZone = "string",
        Type = "string",
    },
    ScheduledSqlConfiguration = new AliCloud.Sls.Inputs.ScheduledSqlScheduledSqlConfigurationArgs
    {
        DataFormat = "string",
        DestEndpoint = "string",
        DestLogstore = "string",
        DestProject = "string",
        DestRoleArn = "string",
        FromTime = 0,
        FromTimeExpr = "string",
        MaxRetries = 0,
        MaxRunTimeInSeconds = 0,
        Parameters = 
        {
            { "string", "string" },
        },
        ResourcePool = "string",
        RoleArn = "string",
        Script = "string",
        SourceLogstore = "string",
        SqlType = "string",
        ToTime = 0,
        ToTimeExpr = "string",
    },
    ScheduledSqlName = "string",
    Description = "string",
});
Copy
example, err := sls.NewScheduledSql(ctx, "scheduledSqlResource", &sls.ScheduledSqlArgs{
	DisplayName: pulumi.String("string"),
	Project:     pulumi.String("string"),
	Schedule: &sls.ScheduledSqlScheduleArgs{
		CronExpression: pulumi.String("string"),
		Delay:          pulumi.Int(0),
		Interval:       pulumi.String("string"),
		RunImmediately: pulumi.Bool(false),
		TimeZone:       pulumi.String("string"),
		Type:           pulumi.String("string"),
	},
	ScheduledSqlConfiguration: &sls.ScheduledSqlScheduledSqlConfigurationArgs{
		DataFormat:          pulumi.String("string"),
		DestEndpoint:        pulumi.String("string"),
		DestLogstore:        pulumi.String("string"),
		DestProject:         pulumi.String("string"),
		DestRoleArn:         pulumi.String("string"),
		FromTime:            pulumi.Int(0),
		FromTimeExpr:        pulumi.String("string"),
		MaxRetries:          pulumi.Int(0),
		MaxRunTimeInSeconds: pulumi.Int(0),
		Parameters: pulumi.StringMap{
			"string": pulumi.String("string"),
		},
		ResourcePool:   pulumi.String("string"),
		RoleArn:        pulumi.String("string"),
		Script:         pulumi.String("string"),
		SourceLogstore: pulumi.String("string"),
		SqlType:        pulumi.String("string"),
		ToTime:         pulumi.Int(0),
		ToTimeExpr:     pulumi.String("string"),
	},
	ScheduledSqlName: pulumi.String("string"),
	Description:      pulumi.String("string"),
})
Copy
var scheduledSqlResource = new ScheduledSql("scheduledSqlResource", ScheduledSqlArgs.builder()
    .displayName("string")
    .project("string")
    .schedule(ScheduledSqlScheduleArgs.builder()
        .cronExpression("string")
        .delay(0)
        .interval("string")
        .runImmediately(false)
        .timeZone("string")
        .type("string")
        .build())
    .scheduledSqlConfiguration(ScheduledSqlScheduledSqlConfigurationArgs.builder()
        .dataFormat("string")
        .destEndpoint("string")
        .destLogstore("string")
        .destProject("string")
        .destRoleArn("string")
        .fromTime(0)
        .fromTimeExpr("string")
        .maxRetries(0)
        .maxRunTimeInSeconds(0)
        .parameters(Map.of("string", "string"))
        .resourcePool("string")
        .roleArn("string")
        .script("string")
        .sourceLogstore("string")
        .sqlType("string")
        .toTime(0)
        .toTimeExpr("string")
        .build())
    .scheduledSqlName("string")
    .description("string")
    .build());
Copy
scheduled_sql_resource = alicloud.sls.ScheduledSql("scheduledSqlResource",
    display_name="string",
    project="string",
    schedule={
        "cron_expression": "string",
        "delay": 0,
        "interval": "string",
        "run_immediately": False,
        "time_zone": "string",
        "type": "string",
    },
    scheduled_sql_configuration={
        "data_format": "string",
        "dest_endpoint": "string",
        "dest_logstore": "string",
        "dest_project": "string",
        "dest_role_arn": "string",
        "from_time": 0,
        "from_time_expr": "string",
        "max_retries": 0,
        "max_run_time_in_seconds": 0,
        "parameters": {
            "string": "string",
        },
        "resource_pool": "string",
        "role_arn": "string",
        "script": "string",
        "source_logstore": "string",
        "sql_type": "string",
        "to_time": 0,
        "to_time_expr": "string",
    },
    scheduled_sql_name="string",
    description="string")
Copy
const scheduledSqlResource = new alicloud.sls.ScheduledSql("scheduledSqlResource", {
    displayName: "string",
    project: "string",
    schedule: {
        cronExpression: "string",
        delay: 0,
        interval: "string",
        runImmediately: false,
        timeZone: "string",
        type: "string",
    },
    scheduledSqlConfiguration: {
        dataFormat: "string",
        destEndpoint: "string",
        destLogstore: "string",
        destProject: "string",
        destRoleArn: "string",
        fromTime: 0,
        fromTimeExpr: "string",
        maxRetries: 0,
        maxRunTimeInSeconds: 0,
        parameters: {
            string: "string",
        },
        resourcePool: "string",
        roleArn: "string",
        script: "string",
        sourceLogstore: "string",
        sqlType: "string",
        toTime: 0,
        toTimeExpr: "string",
    },
    scheduledSqlName: "string",
    description: "string",
});
Copy
type: alicloud:sls:ScheduledSql
properties:
    description: string
    displayName: string
    project: string
    schedule:
        cronExpression: string
        delay: 0
        interval: string
        runImmediately: false
        timeZone: string
        type: string
    scheduledSqlConfiguration:
        dataFormat: string
        destEndpoint: string
        destLogstore: string
        destProject: string
        destRoleArn: string
        fromTime: 0
        fromTimeExpr: string
        maxRetries: 0
        maxRunTimeInSeconds: 0
        parameters:
            string: string
        resourcePool: string
        roleArn: string
        script: string
        sourceLogstore: string
        sqlType: string
        toTime: 0
        toTimeExpr: string
    scheduledSqlName: string
Copy

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

DisplayName This property is required. string
Task Display Name.
Project
This property is required.
Changes to this property will trigger replacement.
string
Log project.
Schedule
This property is required.
Changes to this property will trigger replacement.
Pulumi.AliCloud.Sls.Inputs.ScheduledSqlSchedule
The scheduling type is generally not required by default. If there is a strong timing requirement, if it must be imported every Monday at 8 o'clock, cron can be used. See schedule below.
ScheduledSqlConfiguration
This property is required.
Changes to this property will trigger replacement.
Pulumi.AliCloud.Sls.Inputs.ScheduledSqlScheduledSqlConfiguration
Task Configuration. See scheduled_sql_configuration below.
ScheduledSqlName
This property is required.
Changes to this property will trigger replacement.
string
Timed SQL name.
Description string
Task Description.
DisplayName This property is required. string
Task Display Name.
Project
This property is required.
Changes to this property will trigger replacement.
string
Log project.
Schedule
This property is required.
Changes to this property will trigger replacement.
ScheduledSqlScheduleArgs
The scheduling type is generally not required by default. If there is a strong timing requirement, if it must be imported every Monday at 8 o'clock, cron can be used. See schedule below.
ScheduledSqlConfiguration
This property is required.
Changes to this property will trigger replacement.
ScheduledSqlScheduledSqlConfigurationArgs
Task Configuration. See scheduled_sql_configuration below.
ScheduledSqlName
This property is required.
Changes to this property will trigger replacement.
string
Timed SQL name.
Description string
Task Description.
displayName This property is required. String
Task Display Name.
project
This property is required.
Changes to this property will trigger replacement.
String
Log project.
schedule
This property is required.
Changes to this property will trigger replacement.
ScheduledSqlSchedule
The scheduling type is generally not required by default. If there is a strong timing requirement, if it must be imported every Monday at 8 o'clock, cron can be used. See schedule below.
scheduledSqlConfiguration
This property is required.
Changes to this property will trigger replacement.
ScheduledSqlScheduledSqlConfiguration
Task Configuration. See scheduled_sql_configuration below.
scheduledSqlName
This property is required.
Changes to this property will trigger replacement.
String
Timed SQL name.
description String
Task Description.
displayName This property is required. string
Task Display Name.
project
This property is required.
Changes to this property will trigger replacement.
string
Log project.
schedule
This property is required.
Changes to this property will trigger replacement.
ScheduledSqlSchedule
The scheduling type is generally not required by default. If there is a strong timing requirement, if it must be imported every Monday at 8 o'clock, cron can be used. See schedule below.
scheduledSqlConfiguration
This property is required.
Changes to this property will trigger replacement.
ScheduledSqlScheduledSqlConfiguration
Task Configuration. See scheduled_sql_configuration below.
scheduledSqlName
This property is required.
Changes to this property will trigger replacement.
string
Timed SQL name.
description string
Task Description.
display_name This property is required. str
Task Display Name.
project
This property is required.
Changes to this property will trigger replacement.
str
Log project.
schedule
This property is required.
Changes to this property will trigger replacement.
ScheduledSqlScheduleArgs
The scheduling type is generally not required by default. If there is a strong timing requirement, if it must be imported every Monday at 8 o'clock, cron can be used. See schedule below.
scheduled_sql_configuration
This property is required.
Changes to this property will trigger replacement.
ScheduledSqlScheduledSqlConfigurationArgs
Task Configuration. See scheduled_sql_configuration below.
scheduled_sql_name
This property is required.
Changes to this property will trigger replacement.
str
Timed SQL name.
description str
Task Description.
displayName This property is required. String
Task Display Name.
project
This property is required.
Changes to this property will trigger replacement.
String
Log project.
schedule
This property is required.
Changes to this property will trigger replacement.
Property Map
The scheduling type is generally not required by default. If there is a strong timing requirement, if it must be imported every Monday at 8 o'clock, cron can be used. See schedule below.
scheduledSqlConfiguration
This property is required.
Changes to this property will trigger replacement.
Property Map
Task Configuration. See scheduled_sql_configuration below.
scheduledSqlName
This property is required.
Changes to this property will trigger replacement.
String
Timed SQL name.
description String
Task Description.

Outputs

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

Get an existing ScheduledSql 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?: ScheduledSqlState, opts?: CustomResourceOptions): ScheduledSql
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        display_name: Optional[str] = None,
        project: Optional[str] = None,
        schedule: Optional[ScheduledSqlScheduleArgs] = None,
        scheduled_sql_configuration: Optional[ScheduledSqlScheduledSqlConfigurationArgs] = None,
        scheduled_sql_name: Optional[str] = None) -> ScheduledSql
func GetScheduledSql(ctx *Context, name string, id IDInput, state *ScheduledSqlState, opts ...ResourceOption) (*ScheduledSql, error)
public static ScheduledSql Get(string name, Input<string> id, ScheduledSqlState? state, CustomResourceOptions? opts = null)
public static ScheduledSql get(String name, Output<String> id, ScheduledSqlState state, CustomResourceOptions options)
resources:  _:    type: alicloud:sls:ScheduledSql    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:
Description string
Task Description.
DisplayName string
Task Display Name.
Project Changes to this property will trigger replacement. string
Log project.
Schedule Changes to this property will trigger replacement. Pulumi.AliCloud.Sls.Inputs.ScheduledSqlSchedule
The scheduling type is generally not required by default. If there is a strong timing requirement, if it must be imported every Monday at 8 o'clock, cron can be used. See schedule below.
ScheduledSqlConfiguration Changes to this property will trigger replacement. Pulumi.AliCloud.Sls.Inputs.ScheduledSqlScheduledSqlConfiguration
Task Configuration. See scheduled_sql_configuration below.
ScheduledSqlName Changes to this property will trigger replacement. string
Timed SQL name.
Description string
Task Description.
DisplayName string
Task Display Name.
Project Changes to this property will trigger replacement. string
Log project.
Schedule Changes to this property will trigger replacement. ScheduledSqlScheduleArgs
The scheduling type is generally not required by default. If there is a strong timing requirement, if it must be imported every Monday at 8 o'clock, cron can be used. See schedule below.
ScheduledSqlConfiguration Changes to this property will trigger replacement. ScheduledSqlScheduledSqlConfigurationArgs
Task Configuration. See scheduled_sql_configuration below.
ScheduledSqlName Changes to this property will trigger replacement. string
Timed SQL name.
description String
Task Description.
displayName String
Task Display Name.
project Changes to this property will trigger replacement. String
Log project.
schedule Changes to this property will trigger replacement. ScheduledSqlSchedule
The scheduling type is generally not required by default. If there is a strong timing requirement, if it must be imported every Monday at 8 o'clock, cron can be used. See schedule below.
scheduledSqlConfiguration Changes to this property will trigger replacement. ScheduledSqlScheduledSqlConfiguration
Task Configuration. See scheduled_sql_configuration below.
scheduledSqlName Changes to this property will trigger replacement. String
Timed SQL name.
description string
Task Description.
displayName string
Task Display Name.
project Changes to this property will trigger replacement. string
Log project.
schedule Changes to this property will trigger replacement. ScheduledSqlSchedule
The scheduling type is generally not required by default. If there is a strong timing requirement, if it must be imported every Monday at 8 o'clock, cron can be used. See schedule below.
scheduledSqlConfiguration Changes to this property will trigger replacement. ScheduledSqlScheduledSqlConfiguration
Task Configuration. See scheduled_sql_configuration below.
scheduledSqlName Changes to this property will trigger replacement. string
Timed SQL name.
description str
Task Description.
display_name str
Task Display Name.
project Changes to this property will trigger replacement. str
Log project.
schedule Changes to this property will trigger replacement. ScheduledSqlScheduleArgs
The scheduling type is generally not required by default. If there is a strong timing requirement, if it must be imported every Monday at 8 o'clock, cron can be used. See schedule below.
scheduled_sql_configuration Changes to this property will trigger replacement. ScheduledSqlScheduledSqlConfigurationArgs
Task Configuration. See scheduled_sql_configuration below.
scheduled_sql_name Changes to this property will trigger replacement. str
Timed SQL name.
description String
Task Description.
displayName String
Task Display Name.
project Changes to this property will trigger replacement. String
Log project.
schedule Changes to this property will trigger replacement. Property Map
The scheduling type is generally not required by default. If there is a strong timing requirement, if it must be imported every Monday at 8 o'clock, cron can be used. See schedule below.
scheduledSqlConfiguration Changes to this property will trigger replacement. Property Map
Task Configuration. See scheduled_sql_configuration below.
scheduledSqlName Changes to this property will trigger replacement. String
Timed SQL name.

Supporting Types

ScheduledSqlSchedule
, ScheduledSqlScheduleArgs

CronExpression string
Cron expression, minimum precision is minutes, 24-hour clock. For example, 0 0/1 **indicates that the check is performed every one hour from 00:00. When type is set to Cron, cronExpression must be set.
Delay int
Delay time.
Interval string
Time interval, such as 5m, 1H.
RunImmediately bool
Whether to execute the OSS import task immediately after it is created.
TimeZone string
Time Zone.
Type string
Check the frequency type. Log Service checks the query and analysis results based on the frequency you configured. The value is as follows: FixedRate: checks the query and analysis results at fixed intervals. Cron: specifies a time interval through a Cron expression, and checks the query and analysis results at the specified time interval. Weekly: Check the query and analysis results at a fixed point in time on the day of the week. Daily: checks the query and analysis results at a fixed time point every day. Hourly: Check query and analysis results every hour.
CronExpression string
Cron expression, minimum precision is minutes, 24-hour clock. For example, 0 0/1 **indicates that the check is performed every one hour from 00:00. When type is set to Cron, cronExpression must be set.
Delay int
Delay time.
Interval string
Time interval, such as 5m, 1H.
RunImmediately bool
Whether to execute the OSS import task immediately after it is created.
TimeZone string
Time Zone.
Type string
Check the frequency type. Log Service checks the query and analysis results based on the frequency you configured. The value is as follows: FixedRate: checks the query and analysis results at fixed intervals. Cron: specifies a time interval through a Cron expression, and checks the query and analysis results at the specified time interval. Weekly: Check the query and analysis results at a fixed point in time on the day of the week. Daily: checks the query and analysis results at a fixed time point every day. Hourly: Check query and analysis results every hour.
cronExpression String
Cron expression, minimum precision is minutes, 24-hour clock. For example, 0 0/1 **indicates that the check is performed every one hour from 00:00. When type is set to Cron, cronExpression must be set.
delay Integer
Delay time.
interval String
Time interval, such as 5m, 1H.
runImmediately Boolean
Whether to execute the OSS import task immediately after it is created.
timeZone String
Time Zone.
type String
Check the frequency type. Log Service checks the query and analysis results based on the frequency you configured. The value is as follows: FixedRate: checks the query and analysis results at fixed intervals. Cron: specifies a time interval through a Cron expression, and checks the query and analysis results at the specified time interval. Weekly: Check the query and analysis results at a fixed point in time on the day of the week. Daily: checks the query and analysis results at a fixed time point every day. Hourly: Check query and analysis results every hour.
cronExpression string
Cron expression, minimum precision is minutes, 24-hour clock. For example, 0 0/1 **indicates that the check is performed every one hour from 00:00. When type is set to Cron, cronExpression must be set.
delay number
Delay time.
interval string
Time interval, such as 5m, 1H.
runImmediately boolean
Whether to execute the OSS import task immediately after it is created.
timeZone string
Time Zone.
type string
Check the frequency type. Log Service checks the query and analysis results based on the frequency you configured. The value is as follows: FixedRate: checks the query and analysis results at fixed intervals. Cron: specifies a time interval through a Cron expression, and checks the query and analysis results at the specified time interval. Weekly: Check the query and analysis results at a fixed point in time on the day of the week. Daily: checks the query and analysis results at a fixed time point every day. Hourly: Check query and analysis results every hour.
cron_expression str
Cron expression, minimum precision is minutes, 24-hour clock. For example, 0 0/1 **indicates that the check is performed every one hour from 00:00. When type is set to Cron, cronExpression must be set.
delay int
Delay time.
interval str
Time interval, such as 5m, 1H.
run_immediately bool
Whether to execute the OSS import task immediately after it is created.
time_zone str
Time Zone.
type str
Check the frequency type. Log Service checks the query and analysis results based on the frequency you configured. The value is as follows: FixedRate: checks the query and analysis results at fixed intervals. Cron: specifies a time interval through a Cron expression, and checks the query and analysis results at the specified time interval. Weekly: Check the query and analysis results at a fixed point in time on the day of the week. Daily: checks the query and analysis results at a fixed time point every day. Hourly: Check query and analysis results every hour.
cronExpression String
Cron expression, minimum precision is minutes, 24-hour clock. For example, 0 0/1 **indicates that the check is performed every one hour from 00:00. When type is set to Cron, cronExpression must be set.
delay Number
Delay time.
interval String
Time interval, such as 5m, 1H.
runImmediately Boolean
Whether to execute the OSS import task immediately after it is created.
timeZone String
Time Zone.
type String
Check the frequency type. Log Service checks the query and analysis results based on the frequency you configured. The value is as follows: FixedRate: checks the query and analysis results at fixed intervals. Cron: specifies a time interval through a Cron expression, and checks the query and analysis results at the specified time interval. Weekly: Check the query and analysis results at a fixed point in time on the day of the week. Daily: checks the query and analysis results at a fixed time point every day. Hourly: Check query and analysis results every hour.

ScheduledSqlScheduledSqlConfiguration
, ScheduledSqlScheduledSqlConfigurationArgs

DataFormat Changes to this property will trigger replacement. string
Write Mode.
DestEndpoint string
Target Endpoint.
DestLogstore string
Target Logstore.
DestProject string
Target Project.
DestRoleArn string
Write target role ARN.
FromTime Changes to this property will trigger replacement. int
Schedule Start Time.
FromTimeExpr string
SQL time window-start.
MaxRetries int
Maximum retries.
MaxRunTimeInSeconds int
SQL timeout.
Parameters Dictionary<string, string>
Parameter configuration.
ResourcePool string
Resource Pool.
RoleArn string
Read role ARN.
Script string
SQL statement.
SourceLogstore Changes to this property will trigger replacement. string
Source Logstore.
SqlType string
SQL type.
ToTime Changes to this property will trigger replacement. int
Time at end of schedule.
ToTimeExpr string
SQL time window-end.
DataFormat Changes to this property will trigger replacement. string
Write Mode.
DestEndpoint string
Target Endpoint.
DestLogstore string
Target Logstore.
DestProject string
Target Project.
DestRoleArn string
Write target role ARN.
FromTime Changes to this property will trigger replacement. int
Schedule Start Time.
FromTimeExpr string
SQL time window-start.
MaxRetries int
Maximum retries.
MaxRunTimeInSeconds int
SQL timeout.
Parameters map[string]string
Parameter configuration.
ResourcePool string
Resource Pool.
RoleArn string
Read role ARN.
Script string
SQL statement.
SourceLogstore Changes to this property will trigger replacement. string
Source Logstore.
SqlType string
SQL type.
ToTime Changes to this property will trigger replacement. int
Time at end of schedule.
ToTimeExpr string
SQL time window-end.
dataFormat Changes to this property will trigger replacement. String
Write Mode.
destEndpoint String
Target Endpoint.
destLogstore String
Target Logstore.
destProject String
Target Project.
destRoleArn String
Write target role ARN.
fromTime Changes to this property will trigger replacement. Integer
Schedule Start Time.
fromTimeExpr String
SQL time window-start.
maxRetries Integer
Maximum retries.
maxRunTimeInSeconds Integer
SQL timeout.
parameters Map<String,String>
Parameter configuration.
resourcePool String
Resource Pool.
roleArn String
Read role ARN.
script String
SQL statement.
sourceLogstore Changes to this property will trigger replacement. String
Source Logstore.
sqlType String
SQL type.
toTime Changes to this property will trigger replacement. Integer
Time at end of schedule.
toTimeExpr String
SQL time window-end.
dataFormat Changes to this property will trigger replacement. string
Write Mode.
destEndpoint string
Target Endpoint.
destLogstore string
Target Logstore.
destProject string
Target Project.
destRoleArn string
Write target role ARN.
fromTime Changes to this property will trigger replacement. number
Schedule Start Time.
fromTimeExpr string
SQL time window-start.
maxRetries number
Maximum retries.
maxRunTimeInSeconds number
SQL timeout.
parameters {[key: string]: string}
Parameter configuration.
resourcePool string
Resource Pool.
roleArn string
Read role ARN.
script string
SQL statement.
sourceLogstore Changes to this property will trigger replacement. string
Source Logstore.
sqlType string
SQL type.
toTime Changes to this property will trigger replacement. number
Time at end of schedule.
toTimeExpr string
SQL time window-end.
data_format Changes to this property will trigger replacement. str
Write Mode.
dest_endpoint str
Target Endpoint.
dest_logstore str
Target Logstore.
dest_project str
Target Project.
dest_role_arn str
Write target role ARN.
from_time Changes to this property will trigger replacement. int
Schedule Start Time.
from_time_expr str
SQL time window-start.
max_retries int
Maximum retries.
max_run_time_in_seconds int
SQL timeout.
parameters Mapping[str, str]
Parameter configuration.
resource_pool str
Resource Pool.
role_arn str
Read role ARN.
script str
SQL statement.
source_logstore Changes to this property will trigger replacement. str
Source Logstore.
sql_type str
SQL type.
to_time Changes to this property will trigger replacement. int
Time at end of schedule.
to_time_expr str
SQL time window-end.
dataFormat Changes to this property will trigger replacement. String
Write Mode.
destEndpoint String
Target Endpoint.
destLogstore String
Target Logstore.
destProject String
Target Project.
destRoleArn String
Write target role ARN.
fromTime Changes to this property will trigger replacement. Number
Schedule Start Time.
fromTimeExpr String
SQL time window-start.
maxRetries Number
Maximum retries.
maxRunTimeInSeconds Number
SQL timeout.
parameters Map<String>
Parameter configuration.
resourcePool String
Resource Pool.
roleArn String
Read role ARN.
script String
SQL statement.
sourceLogstore Changes to this property will trigger replacement. String
Source Logstore.
sqlType String
SQL type.
toTime Changes to this property will trigger replacement. Number
Time at end of schedule.
toTimeExpr String
SQL time window-end.

Import

SLS Scheduled SQL can be imported using the id, e.g.

$ pulumi import alicloud:sls/scheduledSql:ScheduledSql example <project>:<scheduled_sql_name>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.