1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. sls
  5. ScheduledSql
Alibaba Cloud v3.95.0 published on Thursday, Feb 12, 2026 by Pulumi
alicloud logo
Alibaba Cloud v3.95.0 published on Thursday, Feb 12, 2026 by Pulumi

    Provides a Log Service (SLS) Scheduled Sql resource.

    Scheduled SQL task.

    For information about Log Service (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,
    });
    
    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)
    
    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
    	})
    }
    
    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,
        });
    
    });
    
    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());
    
        }
    }
    
    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}
    

    📚 Need more examples? VIEW MORE EXAMPLES

    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,
                     status: 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 string
    The unique name of the resource.
    args ScheduledSqlArgs
    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 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 string
    The unique name of the resource.
    args ScheduledSqlArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ScheduledSqlArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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",
        Status = "string",
    });
    
    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"),
    	Status:           pulumi.String("string"),
    })
    
    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")
        .status("string")
        .build());
    
    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",
        status="string")
    
    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",
        status: "string",
    });
    
    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
        status: string
    

    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 string
    Task display name.
    Project string
    A short description of struct.
    Schedule Pulumi.AliCloud.Sls.Inputs.ScheduledSqlSchedule
    Schedule type. This field generally does not need to be specified. If you have strict scheduling requirements—for example, running an import job every Monday at 8:00 AM—you can use a cron expression. See schedule below.
    ScheduledSqlConfiguration Pulumi.AliCloud.Sls.Inputs.ScheduledSqlScheduledSqlConfiguration
    Task configuration. See scheduled_sql_configuration below.
    ScheduledSqlName string
    The job name. The naming rules are as follows:

    • Job names must be unique within the same project.
    • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
    • The name must start and end with a lowercase letter or digit.
    • The length must be between 2 and 64 characters.
    Description string
    Job description.
    Status string
    The status of the scheduled SQL job.
    DisplayName string
    Task display name.
    Project string
    A short description of struct.
    Schedule ScheduledSqlScheduleArgs
    Schedule type. This field generally does not need to be specified. If you have strict scheduling requirements—for example, running an import job every Monday at 8:00 AM—you can use a cron expression. See schedule below.
    ScheduledSqlConfiguration ScheduledSqlScheduledSqlConfigurationArgs
    Task configuration. See scheduled_sql_configuration below.
    ScheduledSqlName string
    The job name. The naming rules are as follows:

    • Job names must be unique within the same project.
    • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
    • The name must start and end with a lowercase letter or digit.
    • The length must be between 2 and 64 characters.
    Description string
    Job description.
    Status string
    The status of the scheduled SQL job.
    displayName String
    Task display name.
    project String
    A short description of struct.
    schedule ScheduledSqlSchedule
    Schedule type. This field generally does not need to be specified. If you have strict scheduling requirements—for example, running an import job every Monday at 8:00 AM—you can use a cron expression. See schedule below.
    scheduledSqlConfiguration ScheduledSqlScheduledSqlConfiguration
    Task configuration. See scheduled_sql_configuration below.
    scheduledSqlName String
    The job name. The naming rules are as follows:

    • Job names must be unique within the same project.
    • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
    • The name must start and end with a lowercase letter or digit.
    • The length must be between 2 and 64 characters.
    description String
    Job description.
    status String
    The status of the scheduled SQL job.
    displayName string
    Task display name.
    project string
    A short description of struct.
    schedule ScheduledSqlSchedule
    Schedule type. This field generally does not need to be specified. If you have strict scheduling requirements—for example, running an import job every Monday at 8:00 AM—you can use a cron expression. See schedule below.
    scheduledSqlConfiguration ScheduledSqlScheduledSqlConfiguration
    Task configuration. See scheduled_sql_configuration below.
    scheduledSqlName string
    The job name. The naming rules are as follows:

    • Job names must be unique within the same project.
    • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
    • The name must start and end with a lowercase letter or digit.
    • The length must be between 2 and 64 characters.
    description string
    Job description.
    status string
    The status of the scheduled SQL job.
    display_name str
    Task display name.
    project str
    A short description of struct.
    schedule ScheduledSqlScheduleArgs
    Schedule type. This field generally does not need to be specified. If you have strict scheduling requirements—for example, running an import job every Monday at 8:00 AM—you can use a cron expression. See schedule below.
    scheduled_sql_configuration ScheduledSqlScheduledSqlConfigurationArgs
    Task configuration. See scheduled_sql_configuration below.
    scheduled_sql_name str
    The job name. The naming rules are as follows:

    • Job names must be unique within the same project.
    • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
    • The name must start and end with a lowercase letter or digit.
    • The length must be between 2 and 64 characters.
    description str
    Job description.
    status str
    The status of the scheduled SQL job.
    displayName String
    Task display name.
    project String
    A short description of struct.
    schedule Property Map
    Schedule type. This field generally does not need to be specified. If you have strict scheduling requirements—for example, running an import job every Monday at 8:00 AM—you can use a cron expression. See schedule below.
    scheduledSqlConfiguration Property Map
    Task configuration. See scheduled_sql_configuration below.
    scheduledSqlName String
    The job name. The naming rules are as follows:

    • Job names must be unique within the same project.
    • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
    • The name must start and end with a lowercase letter or digit.
    • The length must be between 2 and 64 characters.
    description String
    Job description.
    status String
    The status of the scheduled SQL job.

    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,
            status: 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
    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:
    Description string
    Job description.
    DisplayName string
    Task display name.
    Project string
    A short description of struct.
    Schedule Pulumi.AliCloud.Sls.Inputs.ScheduledSqlSchedule
    Schedule type. This field generally does not need to be specified. If you have strict scheduling requirements—for example, running an import job every Monday at 8:00 AM—you can use a cron expression. See schedule below.
    ScheduledSqlConfiguration Pulumi.AliCloud.Sls.Inputs.ScheduledSqlScheduledSqlConfiguration
    Task configuration. See scheduled_sql_configuration below.
    ScheduledSqlName string
    The job name. The naming rules are as follows:

    • Job names must be unique within the same project.
    • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
    • The name must start and end with a lowercase letter or digit.
    • The length must be between 2 and 64 characters.
    Status string
    The status of the scheduled SQL job.
    Description string
    Job description.
    DisplayName string
    Task display name.
    Project string
    A short description of struct.
    Schedule ScheduledSqlScheduleArgs
    Schedule type. This field generally does not need to be specified. If you have strict scheduling requirements—for example, running an import job every Monday at 8:00 AM—you can use a cron expression. See schedule below.
    ScheduledSqlConfiguration ScheduledSqlScheduledSqlConfigurationArgs
    Task configuration. See scheduled_sql_configuration below.
    ScheduledSqlName string
    The job name. The naming rules are as follows:

    • Job names must be unique within the same project.
    • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
    • The name must start and end with a lowercase letter or digit.
    • The length must be between 2 and 64 characters.
    Status string
    The status of the scheduled SQL job.
    description String
    Job description.
    displayName String
    Task display name.
    project String
    A short description of struct.
    schedule ScheduledSqlSchedule
    Schedule type. This field generally does not need to be specified. If you have strict scheduling requirements—for example, running an import job every Monday at 8:00 AM—you can use a cron expression. See schedule below.
    scheduledSqlConfiguration ScheduledSqlScheduledSqlConfiguration
    Task configuration. See scheduled_sql_configuration below.
    scheduledSqlName String
    The job name. The naming rules are as follows:

    • Job names must be unique within the same project.
    • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
    • The name must start and end with a lowercase letter or digit.
    • The length must be between 2 and 64 characters.
    status String
    The status of the scheduled SQL job.
    description string
    Job description.
    displayName string
    Task display name.
    project string
    A short description of struct.
    schedule ScheduledSqlSchedule
    Schedule type. This field generally does not need to be specified. If you have strict scheduling requirements—for example, running an import job every Monday at 8:00 AM—you can use a cron expression. See schedule below.
    scheduledSqlConfiguration ScheduledSqlScheduledSqlConfiguration
    Task configuration. See scheduled_sql_configuration below.
    scheduledSqlName string
    The job name. The naming rules are as follows:

    • Job names must be unique within the same project.
    • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
    • The name must start and end with a lowercase letter or digit.
    • The length must be between 2 and 64 characters.
    status string
    The status of the scheduled SQL job.
    description str
    Job description.
    display_name str
    Task display name.
    project str
    A short description of struct.
    schedule ScheduledSqlScheduleArgs
    Schedule type. This field generally does not need to be specified. If you have strict scheduling requirements—for example, running an import job every Monday at 8:00 AM—you can use a cron expression. See schedule below.
    scheduled_sql_configuration ScheduledSqlScheduledSqlConfigurationArgs
    Task configuration. See scheduled_sql_configuration below.
    scheduled_sql_name str
    The job name. The naming rules are as follows:

    • Job names must be unique within the same project.
    • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
    • The name must start and end with a lowercase letter or digit.
    • The length must be between 2 and 64 characters.
    status str
    The status of the scheduled SQL job.
    description String
    Job description.
    displayName String
    Task display name.
    project String
    A short description of struct.
    schedule Property Map
    Schedule type. This field generally does not need to be specified. If you have strict scheduling requirements—for example, running an import job every Monday at 8:00 AM—you can use a cron expression. See schedule below.
    scheduledSqlConfiguration Property Map
    Task configuration. See scheduled_sql_configuration below.
    scheduledSqlName String
    The job name. The naming rules are as follows:

    • Job names must be unique within the same project.
    • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
    • The name must start and end with a lowercase letter or digit.
    • The length must be between 2 and 64 characters.
    status String
    The status of the scheduled SQL job.

    Supporting Types

    ScheduledSqlSchedule, ScheduledSqlScheduleArgs

    CronExpression string
    Cron expression with a minimum precision of minutes in 24-hour format. For example, 0 0/1 * * * means checking once every hour starting from 00:00. When type is set to Cron, cronExpression must be specified.
    Delay int
    Delay duration.
    Interval string
    Time interval, such as 5m or 1h.
    RunImmediately bool
    Specifies whether to run the OSS import job immediately after it is created.
    TimeZone string
    Time zone.
    Type string
    The check frequency type. Log Service checks query and analysis results based on the frequency you configure. Valid values: FixedRate: Checks query and analysis results at fixed intervals. Cron: Uses a cron expression to specify the interval and checks query and analysis results accordingly. Weekly: Checks query and analysis results once at a fixed time on a specific day of the week. Daily: Checks query and analysis results once at a fixed time each day. Hourly: Checks query and analysis results once every hour.
    CronExpression string
    Cron expression with a minimum precision of minutes in 24-hour format. For example, 0 0/1 * * * means checking once every hour starting from 00:00. When type is set to Cron, cronExpression must be specified.
    Delay int
    Delay duration.
    Interval string
    Time interval, such as 5m or 1h.
    RunImmediately bool
    Specifies whether to run the OSS import job immediately after it is created.
    TimeZone string
    Time zone.
    Type string
    The check frequency type. Log Service checks query and analysis results based on the frequency you configure. Valid values: FixedRate: Checks query and analysis results at fixed intervals. Cron: Uses a cron expression to specify the interval and checks query and analysis results accordingly. Weekly: Checks query and analysis results once at a fixed time on a specific day of the week. Daily: Checks query and analysis results once at a fixed time each day. Hourly: Checks query and analysis results once every hour.
    cronExpression String
    Cron expression with a minimum precision of minutes in 24-hour format. For example, 0 0/1 * * * means checking once every hour starting from 00:00. When type is set to Cron, cronExpression must be specified.
    delay Integer
    Delay duration.
    interval String
    Time interval, such as 5m or 1h.
    runImmediately Boolean
    Specifies whether to run the OSS import job immediately after it is created.
    timeZone String
    Time zone.
    type String
    The check frequency type. Log Service checks query and analysis results based on the frequency you configure. Valid values: FixedRate: Checks query and analysis results at fixed intervals. Cron: Uses a cron expression to specify the interval and checks query and analysis results accordingly. Weekly: Checks query and analysis results once at a fixed time on a specific day of the week. Daily: Checks query and analysis results once at a fixed time each day. Hourly: Checks query and analysis results once every hour.
    cronExpression string
    Cron expression with a minimum precision of minutes in 24-hour format. For example, 0 0/1 * * * means checking once every hour starting from 00:00. When type is set to Cron, cronExpression must be specified.
    delay number
    Delay duration.
    interval string
    Time interval, such as 5m or 1h.
    runImmediately boolean
    Specifies whether to run the OSS import job immediately after it is created.
    timeZone string
    Time zone.
    type string
    The check frequency type. Log Service checks query and analysis results based on the frequency you configure. Valid values: FixedRate: Checks query and analysis results at fixed intervals. Cron: Uses a cron expression to specify the interval and checks query and analysis results accordingly. Weekly: Checks query and analysis results once at a fixed time on a specific day of the week. Daily: Checks query and analysis results once at a fixed time each day. Hourly: Checks query and analysis results once every hour.
    cron_expression str
    Cron expression with a minimum precision of minutes in 24-hour format. For example, 0 0/1 * * * means checking once every hour starting from 00:00. When type is set to Cron, cronExpression must be specified.
    delay int
    Delay duration.
    interval str
    Time interval, such as 5m or 1h.
    run_immediately bool
    Specifies whether to run the OSS import job immediately after it is created.
    time_zone str
    Time zone.
    type str
    The check frequency type. Log Service checks query and analysis results based on the frequency you configure. Valid values: FixedRate: Checks query and analysis results at fixed intervals. Cron: Uses a cron expression to specify the interval and checks query and analysis results accordingly. Weekly: Checks query and analysis results once at a fixed time on a specific day of the week. Daily: Checks query and analysis results once at a fixed time each day. Hourly: Checks query and analysis results once every hour.
    cronExpression String
    Cron expression with a minimum precision of minutes in 24-hour format. For example, 0 0/1 * * * means checking once every hour starting from 00:00. When type is set to Cron, cronExpression must be specified.
    delay Number
    Delay duration.
    interval String
    Time interval, such as 5m or 1h.
    runImmediately Boolean
    Specifies whether to run the OSS import job immediately after it is created.
    timeZone String
    Time zone.
    type String
    The check frequency type. Log Service checks query and analysis results based on the frequency you configure. Valid values: FixedRate: Checks query and analysis results at fixed intervals. Cron: Uses a cron expression to specify the interval and checks query and analysis results accordingly. Weekly: Checks query and analysis results once at a fixed time on a specific day of the week. Daily: Checks query and analysis results once at a fixed time each day. Hourly: Checks query and analysis results once every hour.

    ScheduledSqlScheduledSqlConfiguration, ScheduledSqlScheduledSqlConfigurationArgs

    DataFormat string
    Write mode.
    DestEndpoint string
    The destination endpoint.
    DestLogstore string
    The destination Logstore.
    DestProject string
    The destination project.
    DestRoleArn string
    Destination write role ARN.
    FromTime int
    The start time of the schedule.
    FromTimeExpr string
    SQL time window - start.
    MaxRetries int
    Maximum number of retries.
    MaxRunTimeInSeconds int
    SQL timeout.
    Parameters Dictionary<string, string>
    Parameter configuration.
    ResourcePool string
    Resource pool.
    RoleArn string
    Source read role ARN.
    Script string
    SQL statement.
    SourceLogstore string
    The source Logstore.
    SqlType string
    SQL type.
    ToTime int
    Scheduled end time.
    ToTimeExpr string
    End of the SQL time window.
    DataFormat string
    Write mode.
    DestEndpoint string
    The destination endpoint.
    DestLogstore string
    The destination Logstore.
    DestProject string
    The destination project.
    DestRoleArn string
    Destination write role ARN.
    FromTime int
    The start time of the schedule.
    FromTimeExpr string
    SQL time window - start.
    MaxRetries int
    Maximum number of retries.
    MaxRunTimeInSeconds int
    SQL timeout.
    Parameters map[string]string
    Parameter configuration.
    ResourcePool string
    Resource pool.
    RoleArn string
    Source read role ARN.
    Script string
    SQL statement.
    SourceLogstore string
    The source Logstore.
    SqlType string
    SQL type.
    ToTime int
    Scheduled end time.
    ToTimeExpr string
    End of the SQL time window.
    dataFormat String
    Write mode.
    destEndpoint String
    The destination endpoint.
    destLogstore String
    The destination Logstore.
    destProject String
    The destination project.
    destRoleArn String
    Destination write role ARN.
    fromTime Integer
    The start time of the schedule.
    fromTimeExpr String
    SQL time window - start.
    maxRetries Integer
    Maximum number of retries.
    maxRunTimeInSeconds Integer
    SQL timeout.
    parameters Map<String,String>
    Parameter configuration.
    resourcePool String
    Resource pool.
    roleArn String
    Source read role ARN.
    script String
    SQL statement.
    sourceLogstore String
    The source Logstore.
    sqlType String
    SQL type.
    toTime Integer
    Scheduled end time.
    toTimeExpr String
    End of the SQL time window.
    dataFormat string
    Write mode.
    destEndpoint string
    The destination endpoint.
    destLogstore string
    The destination Logstore.
    destProject string
    The destination project.
    destRoleArn string
    Destination write role ARN.
    fromTime number
    The start time of the schedule.
    fromTimeExpr string
    SQL time window - start.
    maxRetries number
    Maximum number of retries.
    maxRunTimeInSeconds number
    SQL timeout.
    parameters {[key: string]: string}
    Parameter configuration.
    resourcePool string
    Resource pool.
    roleArn string
    Source read role ARN.
    script string
    SQL statement.
    sourceLogstore string
    The source Logstore.
    sqlType string
    SQL type.
    toTime number
    Scheduled end time.
    toTimeExpr string
    End of the SQL time window.
    data_format str
    Write mode.
    dest_endpoint str
    The destination endpoint.
    dest_logstore str
    The destination Logstore.
    dest_project str
    The destination project.
    dest_role_arn str
    Destination write role ARN.
    from_time int
    The start time of the schedule.
    from_time_expr str
    SQL time window - start.
    max_retries int
    Maximum number of retries.
    max_run_time_in_seconds int
    SQL timeout.
    parameters Mapping[str, str]
    Parameter configuration.
    resource_pool str
    Resource pool.
    role_arn str
    Source read role ARN.
    script str
    SQL statement.
    source_logstore str
    The source Logstore.
    sql_type str
    SQL type.
    to_time int
    Scheduled end time.
    to_time_expr str
    End of the SQL time window.
    dataFormat String
    Write mode.
    destEndpoint String
    The destination endpoint.
    destLogstore String
    The destination Logstore.
    destProject String
    The destination project.
    destRoleArn String
    Destination write role ARN.
    fromTime Number
    The start time of the schedule.
    fromTimeExpr String
    SQL time window - start.
    maxRetries Number
    Maximum number of retries.
    maxRunTimeInSeconds Number
    SQL timeout.
    parameters Map<String>
    Parameter configuration.
    resourcePool String
    Resource pool.
    roleArn String
    Source read role ARN.
    script String
    SQL statement.
    sourceLogstore String
    The source Logstore.
    sqlType String
    SQL type.
    toTime Number
    Scheduled end time.
    toTimeExpr String
    End of the SQL time window.

    Import

    Log Service (SLS) Scheduled Sql can be imported using the id, e.g.

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

    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.
    alicloud logo
    Alibaba Cloud v3.95.0 published on Thursday, Feb 12, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate