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",
});
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")
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
	})
}
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",
    });
});
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());
    }
}
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
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 string
- The unique name of the resource.
- args ScheduleArgs
- 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 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 string
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
var alicloudScheduleResource = new Schedule("alicloudScheduleResource", ScheduleArgs.builder()
    .cronExpression("string")
    .flowName("string")
    .scheduleName("string")
    .description("string")
    .enable(false)
    .payload("string")
    .build());
alicloud_schedule_resource = alicloud.fnf.Schedule("alicloudScheduleResource",
    cron_expression="string",
    flow_name="string",
    schedule_name="string",
    description="string",
    enable=False,
    payload="string")
const alicloudScheduleResource = new alicloud.fnf.Schedule("alicloudScheduleResource", {
    cronExpression: "string",
    flowName: "string",
    scheduleName: "string",
    description: "string",
    enable: false,
    payload: "string",
});
type: alicloud:fnf:Schedule
properties:
    cronExpression: string
    description: string
    enable: false
    flowName: string
    payload: string
    scheduleName: string
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 string
- The CRON expression of the time-based schedule to be created.
- FlowName string
- The name of the flow bound to the time-based schedule you want to create.
- ScheduleName 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 string
- The CRON expression of the time-based schedule to be created.
- FlowName string
- The name of the flow bound to the time-based schedule you want to create.
- ScheduleName 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 String
- The CRON expression of the time-based schedule to be created.
- flowName String
- The name of the flow bound to the time-based schedule you want to create.
- scheduleName 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 string
- The CRON expression of the time-based schedule to be created.
- flowName string
- The name of the flow bound to the time-based schedule you want to create.
- scheduleName 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 str
- The CRON expression of the time-based schedule to be created.
- flow_name str
- The name of the flow bound to the time-based schedule you want to create.
- schedule_name 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 String
- The CRON expression of the time-based schedule to be created.
- flowName String
- The name of the flow bound to the time-based schedule you want to create.
- scheduleName 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.
- LastModified stringTime 
- 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.
- LastModified stringTime 
- 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.
- lastModified StringTime 
- 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.
- lastModified stringTime 
- 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_ strtime 
- 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.
- lastModified StringTime 
- 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) -> Schedulefunc 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
- 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.
- 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 string
- The name of the flow bound to the time-based schedule you want to create.
- LastModified stringTime 
- 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 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 string
- The name of the flow bound to the time-based schedule you want to create.
- LastModified stringTime 
- 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 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 String
- The name of the flow bound to the time-based schedule you want to create.
- lastModified StringTime 
- 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 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 string
- The name of the flow bound to the time-based schedule you want to create.
- lastModified stringTime 
- 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 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 str
- The name of the flow bound to the time-based schedule you want to create.
- last_modified_ strtime 
- 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 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 String
- The name of the flow bound to the time-based schedule you want to create.
- lastModified StringTime 
- 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 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>
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 alicloudTerraform Provider.