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

alicloud.fnf.Schedule

Explore with Pulumi AI

Provides a Serverless Workflow Schedule resource.

For information about Serverless Workflow Schedule and how to use it, see What is Schedule.

NOTE: Available since v1.105.0+.

Example Usage

Basic Usage

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

const example = new alicloud.fnf.Flow("example", {
    definition: `  version: v1beta1
  type: flow
  steps:
    - type: pass
      name: helloworld
`,
    description: "tf-exampleFnFFlow983041",
    name: "tf-exampleSchedule",
    type: "FDL",
});
const exampleSchedule = new alicloud.fnf.Schedule("example", {
    cronExpression: "30 9 * * * *",
    description: "tf-exampleFnFSchedule983041",
    enable: true,
    flowName: example.name,
    payload: "{\"tf-example\": \"example success\"}",
    scheduleName: "tf-exampleFnFSchedule983041",
});
Copy
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.fnf.Flow("example",
    definition="""  version: v1beta1
  type: flow
  steps:
    - type: pass
      name: helloworld
""",
    description="tf-exampleFnFFlow983041",
    name="tf-exampleSchedule",
    type="FDL")
example_schedule = alicloud.fnf.Schedule("example",
    cron_expression="30 9 * * * *",
    description="tf-exampleFnFSchedule983041",
    enable=True,
    flow_name=example.name,
    payload="{\"tf-example\": \"example success\"}",
    schedule_name="tf-exampleFnFSchedule983041")
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/fnf"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := fnf.NewFlow(ctx, "example", &fnf.FlowArgs{
			Definition: pulumi.String(`  version: v1beta1
  type: flow
  steps:
    - type: pass
      name: helloworld
`),
			Description: pulumi.String("tf-exampleFnFFlow983041"),
			Name:        pulumi.String("tf-exampleSchedule"),
			Type:        pulumi.String("FDL"),
		})
		if err != nil {
			return err
		}
		_, err = fnf.NewSchedule(ctx, "example", &fnf.ScheduleArgs{
			CronExpression: pulumi.String("30 9 * * * *"),
			Description:    pulumi.String("tf-exampleFnFSchedule983041"),
			Enable:         pulumi.Bool(true),
			FlowName:       example.Name,
			Payload:        pulumi.String("{\"tf-example\": \"example success\"}"),
			ScheduleName:   pulumi.String("tf-exampleFnFSchedule983041"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var example = new AliCloud.FNF.Flow("example", new()
    {
        Definition = @"  version: v1beta1
  type: flow
  steps:
    - type: pass
      name: helloworld
",
        Description = "tf-exampleFnFFlow983041",
        Name = "tf-exampleSchedule",
        Type = "FDL",
    });

    var exampleSchedule = new AliCloud.FNF.Schedule("example", new()
    {
        CronExpression = "30 9 * * * *",
        Description = "tf-exampleFnFSchedule983041",
        Enable = true,
        FlowName = example.Name,
        Payload = "{\"tf-example\": \"example success\"}",
        ScheduleName = "tf-exampleFnFSchedule983041",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.fnf.Flow;
import com.pulumi.alicloud.fnf.FlowArgs;
import com.pulumi.alicloud.fnf.Schedule;
import com.pulumi.alicloud.fnf.ScheduleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new Flow("example", FlowArgs.builder()
            .definition("""
  version: v1beta1
  type: flow
  steps:
    - type: pass
      name: helloworld
            """)
            .description("tf-exampleFnFFlow983041")
            .name("tf-exampleSchedule")
            .type("FDL")
            .build());

        var exampleSchedule = new Schedule("exampleSchedule", ScheduleArgs.builder()
            .cronExpression("30 9 * * * *")
            .description("tf-exampleFnFSchedule983041")
            .enable("true")
            .flowName(example.name())
            .payload("{\"tf-example\": \"example success\"}")
            .scheduleName("tf-exampleFnFSchedule983041")
            .build());

    }
}
Copy
resources:
  example:
    type: alicloud:fnf:Flow
    properties:
      definition: |2
          version: v1beta1
          type: flow
          steps:
            - type: pass
              name: helloworld
      description: tf-exampleFnFFlow983041
      name: tf-exampleSchedule
      type: FDL
  exampleSchedule:
    type: alicloud:fnf:Schedule
    name: example
    properties:
      cronExpression: 30 9 * * * *
      description: tf-exampleFnFSchedule983041
      enable: 'true'
      flowName: ${example.name}
      payload: '{"tf-example": "example success"}'
      scheduleName: tf-exampleFnFSchedule983041
Copy

Create Schedule Resource

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

Constructor syntax

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

@overload
def Schedule(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             cron_expression: Optional[str] = None,
             flow_name: Optional[str] = None,
             schedule_name: Optional[str] = None,
             description: Optional[str] = None,
             enable: Optional[bool] = None,
             payload: Optional[str] = None)
func NewSchedule(ctx *Context, name string, args ScheduleArgs, opts ...ResourceOption) (*Schedule, error)
public Schedule(string name, ScheduleArgs args, CustomResourceOptions? opts = null)
public Schedule(String name, ScheduleArgs args)
public Schedule(String name, ScheduleArgs args, CustomResourceOptions options)
type: alicloud:fnf:Schedule
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. ScheduleArgs
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. ScheduleArgs
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. ScheduleArgs
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. ScheduleArgs
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. ScheduleArgs
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 alicloudScheduleResource = new AliCloud.FNF.Schedule("alicloudScheduleResource", new()
{
    CronExpression = "string",
    FlowName = "string",
    ScheduleName = "string",
    Description = "string",
    Enable = false,
    Payload = "string",
});
Copy
example, err := fnf.NewSchedule(ctx, "alicloudScheduleResource", &fnf.ScheduleArgs{
	CronExpression: pulumi.String("string"),
	FlowName:       pulumi.String("string"),
	ScheduleName:   pulumi.String("string"),
	Description:    pulumi.String("string"),
	Enable:         pulumi.Bool(false),
	Payload:        pulumi.String("string"),
})
Copy
var alicloudScheduleResource = new com.pulumi.alicloud.fnf.Schedule("alicloudScheduleResource", com.pulumi.alicloud.fnf.ScheduleArgs.builder()
    .cronExpression("string")
    .flowName("string")
    .scheduleName("string")
    .description("string")
    .enable(false)
    .payload("string")
    .build());
Copy
alicloud_schedule_resource = alicloud.fnf.Schedule("alicloudScheduleResource",
    cron_expression="string",
    flow_name="string",
    schedule_name="string",
    description="string",
    enable=False,
    payload="string")
Copy
const alicloudScheduleResource = new alicloud.fnf.Schedule("alicloudScheduleResource", {
    cronExpression: "string",
    flowName: "string",
    scheduleName: "string",
    description: "string",
    enable: false,
    payload: "string",
});
Copy
type: alicloud:fnf:Schedule
properties:
    cronExpression: string
    description: string
    enable: false
    flowName: string
    payload: string
    scheduleName: string
Copy

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

CronExpression This property is required. string
The CRON expression of the time-based schedule to be created.
FlowName
This property is required.
Changes to this property will trigger replacement.
string
The name of the flow bound to the time-based schedule you want to create.
ScheduleName
This property is required.
Changes to this property will trigger replacement.
string
The name of the time-based schedule to be created.
Description string
The description of the time-based schedule to be created.
Enable bool
Specifies whether to enable the time-based schedule you want to create. Valid values: false, true.
Payload string
The trigger message of the time-based schedule to be created. It must be in JSON object format.
CronExpression This property is required. string
The CRON expression of the time-based schedule to be created.
FlowName
This property is required.
Changes to this property will trigger replacement.
string
The name of the flow bound to the time-based schedule you want to create.
ScheduleName
This property is required.
Changes to this property will trigger replacement.
string
The name of the time-based schedule to be created.
Description string
The description of the time-based schedule to be created.
Enable bool
Specifies whether to enable the time-based schedule you want to create. Valid values: false, true.
Payload string
The trigger message of the time-based schedule to be created. It must be in JSON object format.
cronExpression This property is required. String
The CRON expression of the time-based schedule to be created.
flowName
This property is required.
Changes to this property will trigger replacement.
String
The name of the flow bound to the time-based schedule you want to create.
scheduleName
This property is required.
Changes to this property will trigger replacement.
String
The name of the time-based schedule to be created.
description String
The description of the time-based schedule to be created.
enable Boolean
Specifies whether to enable the time-based schedule you want to create. Valid values: false, true.
payload String
The trigger message of the time-based schedule to be created. It must be in JSON object format.
cronExpression This property is required. string
The CRON expression of the time-based schedule to be created.
flowName
This property is required.
Changes to this property will trigger replacement.
string
The name of the flow bound to the time-based schedule you want to create.
scheduleName
This property is required.
Changes to this property will trigger replacement.
string
The name of the time-based schedule to be created.
description string
The description of the time-based schedule to be created.
enable boolean
Specifies whether to enable the time-based schedule you want to create. Valid values: false, true.
payload string
The trigger message of the time-based schedule to be created. It must be in JSON object format.
cron_expression This property is required. str
The CRON expression of the time-based schedule to be created.
flow_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the flow bound to the time-based schedule you want to create.
schedule_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the time-based schedule to be created.
description str
The description of the time-based schedule to be created.
enable bool
Specifies whether to enable the time-based schedule you want to create. Valid values: false, true.
payload str
The trigger message of the time-based schedule to be created. It must be in JSON object format.
cronExpression This property is required. String
The CRON expression of the time-based schedule to be created.
flowName
This property is required.
Changes to this property will trigger replacement.
String
The name of the flow bound to the time-based schedule you want to create.
scheduleName
This property is required.
Changes to this property will trigger replacement.
String
The name of the time-based schedule to be created.
description String
The description of the time-based schedule to be created.
enable Boolean
Specifies whether to enable the time-based schedule you want to create. Valid values: false, true.
payload String
The trigger message of the time-based schedule to be created. It must be in JSON object format.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
LastModifiedTime string
The time when the time-based schedule was last updated.
ScheduleId string
The ID of the time-based schedule.
Id string
The provider-assigned unique ID for this managed resource.
LastModifiedTime string
The time when the time-based schedule was last updated.
ScheduleId string
The ID of the time-based schedule.
id String
The provider-assigned unique ID for this managed resource.
lastModifiedTime String
The time when the time-based schedule was last updated.
scheduleId String
The ID of the time-based schedule.
id string
The provider-assigned unique ID for this managed resource.
lastModifiedTime string
The time when the time-based schedule was last updated.
scheduleId string
The ID of the time-based schedule.
id str
The provider-assigned unique ID for this managed resource.
last_modified_time str
The time when the time-based schedule was last updated.
schedule_id str
The ID of the time-based schedule.
id String
The provider-assigned unique ID for this managed resource.
lastModifiedTime String
The time when the time-based schedule was last updated.
scheduleId String
The ID of the time-based schedule.

Look up Existing Schedule Resource

Get an existing Schedule 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?: ScheduleState, opts?: CustomResourceOptions): Schedule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cron_expression: Optional[str] = None,
        description: Optional[str] = None,
        enable: Optional[bool] = None,
        flow_name: Optional[str] = None,
        last_modified_time: Optional[str] = None,
        payload: Optional[str] = None,
        schedule_id: Optional[str] = None,
        schedule_name: Optional[str] = None) -> Schedule
func GetSchedule(ctx *Context, name string, id IDInput, state *ScheduleState, opts ...ResourceOption) (*Schedule, error)
public static Schedule Get(string name, Input<string> id, ScheduleState? state, CustomResourceOptions? opts = null)
public static Schedule get(String name, Output<String> id, ScheduleState state, CustomResourceOptions options)
resources:  _:    type: alicloud:fnf:Schedule    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:
CronExpression string
The CRON expression of the time-based schedule to be created.
Description string
The description of the time-based schedule to be created.
Enable bool
Specifies whether to enable the time-based schedule you want to create. Valid values: false, true.
FlowName Changes to this property will trigger replacement. string
The name of the flow bound to the time-based schedule you want to create.
LastModifiedTime string
The time when the time-based schedule was last updated.
Payload string
The trigger message of the time-based schedule to be created. It must be in JSON object format.
ScheduleId string
The ID of the time-based schedule.
ScheduleName Changes to this property will trigger replacement. string
The name of the time-based schedule to be created.
CronExpression string
The CRON expression of the time-based schedule to be created.
Description string
The description of the time-based schedule to be created.
Enable bool
Specifies whether to enable the time-based schedule you want to create. Valid values: false, true.
FlowName Changes to this property will trigger replacement. string
The name of the flow bound to the time-based schedule you want to create.
LastModifiedTime string
The time when the time-based schedule was last updated.
Payload string
The trigger message of the time-based schedule to be created. It must be in JSON object format.
ScheduleId string
The ID of the time-based schedule.
ScheduleName Changes to this property will trigger replacement. string
The name of the time-based schedule to be created.
cronExpression String
The CRON expression of the time-based schedule to be created.
description String
The description of the time-based schedule to be created.
enable Boolean
Specifies whether to enable the time-based schedule you want to create. Valid values: false, true.
flowName Changes to this property will trigger replacement. String
The name of the flow bound to the time-based schedule you want to create.
lastModifiedTime String
The time when the time-based schedule was last updated.
payload String
The trigger message of the time-based schedule to be created. It must be in JSON object format.
scheduleId String
The ID of the time-based schedule.
scheduleName Changes to this property will trigger replacement. String
The name of the time-based schedule to be created.
cronExpression string
The CRON expression of the time-based schedule to be created.
description string
The description of the time-based schedule to be created.
enable boolean
Specifies whether to enable the time-based schedule you want to create. Valid values: false, true.
flowName Changes to this property will trigger replacement. string
The name of the flow bound to the time-based schedule you want to create.
lastModifiedTime string
The time when the time-based schedule was last updated.
payload string
The trigger message of the time-based schedule to be created. It must be in JSON object format.
scheduleId string
The ID of the time-based schedule.
scheduleName Changes to this property will trigger replacement. string
The name of the time-based schedule to be created.
cron_expression str
The CRON expression of the time-based schedule to be created.
description str
The description of the time-based schedule to be created.
enable bool
Specifies whether to enable the time-based schedule you want to create. Valid values: false, true.
flow_name Changes to this property will trigger replacement. str
The name of the flow bound to the time-based schedule you want to create.
last_modified_time str
The time when the time-based schedule was last updated.
payload str
The trigger message of the time-based schedule to be created. It must be in JSON object format.
schedule_id str
The ID of the time-based schedule.
schedule_name Changes to this property will trigger replacement. str
The name of the time-based schedule to be created.
cronExpression String
The CRON expression of the time-based schedule to be created.
description String
The description of the time-based schedule to be created.
enable Boolean
Specifies whether to enable the time-based schedule you want to create. Valid values: false, true.
flowName Changes to this property will trigger replacement. String
The name of the flow bound to the time-based schedule you want to create.
lastModifiedTime String
The time when the time-based schedule was last updated.
payload String
The trigger message of the time-based schedule to be created. It must be in JSON object format.
scheduleId String
The ID of the time-based schedule.
scheduleName Changes to this property will trigger replacement. String
The name of the time-based schedule to be created.

Import

Serverless Workflow Schedule can be imported using the id, e.g.

$ pulumi import alicloud:fnf/schedule:Schedule example <schedule_name>:<flow_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.