1. Docs
  2. Pulumi Cloud
  3. Pulumi Cloud REST API
  4. Schedules

Schedules

    Schedules allow you to automate recurring operations on your Pulumi stacks. The Schedules API provides endpoints for creating and managing drift detection, time-to-live (TTL), and custom scheduled operations.

    Schedule Operations

    The API provides endpoints for the following categories of operations:

    • Creating and managing drift detection schedules
    • Creating and managing TTL (time-to-live) schedules
    • Creating and managing custom deployment schedules
    • Getting, listing, pausing, resuming, and deleting schedules
    • Viewing schedule execution history

    Drift Detection Schedules

    Create Drift Schedule

    Create a schedule for automatic drift detection with optional remediation.

    POST /api/stacks/{organization}/{project}/{stack}/deployments/drift/schedules
    

    Parameters

    ParameterTypeInDescription
    organizationstringpathorganization name
    projectstringpathproject name
    stackstringpathstack name
    scheduleCronstringbodycron expression for when to run drift detection
    autoRemediateboolbodytrue if detected drift should be remediated automatically

    Example

    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      --request POST \
      --data '{"scheduleCron":"0 0 * * 0", "autoRemediate":true}' \
      https://api.pulumi.com/api/stacks/{organization}/{project}/{stack}/deployments/drift/schedules
    

    Update Drift Schedule

    Update an existing drift detection schedule.

    POST /api/stacks/{organization}/{project}/{stack}/deployments/drift/schedules/{scheduleID}
    
    ParameterTypeInDescription
    organizationstringpathorganization name
    projectstringpathproject name
    stackstringpathstack name
    scheduleIDstringpathschedule ID that you want to update
    scheduleCronstringbodycron expression for when to run drift detection
    autoRemediateboolbodytrue if detected drift should be remediated automatically

    TTL Schedules

    Create TTL Schedule

    Create a schedule that automatically destroys resources at a specific time.

    POST /api/stacks/{organization}/{project}/{stack}/deployments/ttl/schedules
    

    Parameters

    ParameterTypeInDescription
    organizationstringpathorganization name
    projectstringpathproject name
    stackstringpathstack name
    timestampstringbodyISO 8601 timestamp specifying when to destroy the stack. Example: 2024-04-20T00:00:00.000Z
    deleteAfterDestroyboolbodytrue if the stack should be deleted after resources are destroyed

    Example

    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      --request POST \
      --data '{"timestamp":"2024-04-20T00:00:00.000Z","deleteAfterDestroy":true}' \
      https://api.pulumi.com/api/stacks/{organization}/{project}/{stack}/deployments/ttl/schedules
    

    Update TTL Schedule

    Update an existing TTL schedule.

    POST /api/stacks/{organization}/{project}/{stack}/deployments/ttl/schedules/{scheduleID}
    
    ParameterTypeInDescription
    organizationstringpathorganization name
    projectstringpathproject name
    stackstringpathstack name
    scheduleIDstringpathschedule ID that you want to update
    timestampstringbodyISO 8601 timestamp specifying when to destroy the stack. Example: 2024-04-20T00:00:00.000Z
    deleteAfterDestroyboolbodytrue if the stack should be deleted after resources are destroyed

    Custom Deployment Schedules

    Create Raw Deployment Schedule

    Create a custom scheduled deployment.

    POST /api/stacks/{organization}/{project}/{stack}/deployments/schedules
    

    Parameters

    ParameterTypeInDescription
    organizationstringpathorganization name
    projectstringpathproject name
    stackstringpathstack name
    scheduleCronstringbodycron expression for when to run the pulumi operation
    scheduleOncestringbodyISO 8601 timestamp specifying when to run the pulumi operation. Example: 2024-04-20T00:00:00.000Z
    requestCreateDeploymentRequestbodyThe create deployment request object that will be executed on every invocation

    Note: Exactly one of scheduleCron and scheduleOnce must be set.

    Update Raw Deployment Schedule

    Update a custom deployment schedule.

    POST /api/stacks/{organization}/{project}/{stack}/deployments/schedules/{scheduleID}
    

    Parameters

    ParameterTypeInDescription
    organizationstringpathorganization name
    projectstringpathproject name
    stackstringpathstack name
    scheduleIDstringpathschedule ID that you want to update
    scheduleCronstringbodycron expression for when to run the pulumi operation
    scheduleOncestringbodyISO 8601 timestamp specifying when to run the pulumi operation. Example: 2024-04-20T00:00:00.000Z
    requestCreateDeploymentRequestbodyThe create deployment request object that will be executed on every invocation

    Schedule Management

    Get Schedule

    Get details of a specific schedule.

    GET /api/stacks/{organization}/{project}/{stack}/deployments/schedules/{scheduleID}
    

    Delete Schedule

    Delete a schedule.

    DELETE /api/stacks/{organization}/{project}/{stack}/deployments/schedules/{scheduleID}
    

    Pause Schedule

    Pause a schedule temporarily without deleting it.

    POST /api/stacks/{organization}/{project}/{stack}/deployments/schedules/{scheduleID}/pause
    

    Resume Schedule

    Resume a paused schedule.

    POST /api/stacks/{organization}/{project}/{stack}/deployments/schedules/{scheduleID}/resume
    

    List Schedules of a Stack

    List all schedules for a specific stack.

    GET /api/stacks/{organization}/{project}/{stack}/deployments/schedules
    

    List Scheduled Deployment History

    Get the execution history for a specific schedule.

    GET /api/stacks/{organization}/{project}/{stack}/deployments/schedules/{scheduleID}/history