Module cloudscheduler

@pulumi/gcp > cloudscheduler

class Job

extends CustomResource

A scheduled job that can publish a pubsub message or a http request every X interval of time, using crontab format string

To get more information about Job, see:

Example Usage - Scheduler Job Pubsub

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

const topic = new gcp.pubsub.Topic("topic", {});
const job = new gcp.cloudscheduler.Job("job", {
    description: "test job",
    pubsubTarget: {
        data: Buffer.from("test").toString("base64"),
        topicName: topic.id,
    },
    schedule: "*/2 * * * *",
});

Example Usage - Scheduler Job Http

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

const job = new gcp.cloudscheduler.Job("job", {
    description: "test http job",
    httpTarget: {
        httpMethod: "POST",
        uri: "https://example.com/ping",
    },
    schedule: "*/8 * * * *",
    timeZone: "America/New_York",
});

Example Usage - Scheduler Job App Engine

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

const job = new gcp.cloudscheduler.Job("job", {
    appEngineHttpTarget: {
        appEngineRouting: {
            instance: "my-instance-001",
            service: "web",
            version: "prod",
        },
        httpMethod: "POST",
        relativeUri: "/ping",
    },
    description: "test app engine job",
    schedule: "*/4 * * * *",
    timeZone: "Europe/London",
});

constructor

new Job(name: string, args?: JobArgs, opts?: pulumi.CustomResourceOptions)

Create a Job resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: JobState, opts?: pulumi.CustomResourceOptions): Job

Get an existing Job resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property appEngineHttpTarget

public appEngineHttpTarget: pulumi.Output<{
    appEngineRouting: undefined | {
        instance: undefined | string;
        service: undefined | string;
        version: undefined | string;
    };
    body: undefined | string;
    headers: undefined | {[key: string]: string};
    httpMethod: undefined | string;
    relativeUri: string;
} | undefined>;

property description

public description: pulumi.Output<string | undefined>;

property httpTarget

public httpTarget: pulumi.Output<{
    body: undefined | string;
    headers: undefined | {[key: string]: string};
    httpMethod: undefined | string;
    uri: string;
} | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property pubsubTarget

public pubsubTarget: pulumi.Output<{
    attributes: undefined | {[key: string]: string};
    data: undefined | string;
    topicName: string;
} | undefined>;

property region

public region: pulumi.Output<string>;

property retryConfig

public retryConfig: pulumi.Output<{
    maxBackoffDuration: undefined | string;
    maxDoublings: undefined | number;
    maxRetryDuration: undefined | string;
    minBackoffDuration: undefined | string;
    retryCount: undefined | number;
} | undefined>;

property schedule

public schedule: pulumi.Output<string | undefined>;

property timeZone

public timeZone: pulumi.Output<string | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

interface JobArgs

The set of arguments for constructing a Job resource.

property appEngineHttpTarget

appEngineHttpTarget?: pulumi.Input<{
    appEngineRouting: pulumi.Input<{
        instance: pulumi.Input<string>;
        service: pulumi.Input<string>;
        version: pulumi.Input<string>;
    }>;
    body: pulumi.Input<string>;
    headers: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    httpMethod: pulumi.Input<string>;
    relativeUri: pulumi.Input<string>;
}>;

property description

description?: pulumi.Input<string>;

property httpTarget

httpTarget?: pulumi.Input<{
    body: pulumi.Input<string>;
    headers: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    httpMethod: pulumi.Input<string>;
    uri: pulumi.Input<string>;
}>;

property name

name?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property pubsubTarget

pubsubTarget?: pulumi.Input<{
    attributes: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    data: pulumi.Input<string>;
    topicName: pulumi.Input<string>;
}>;

property region

region?: pulumi.Input<string>;

property retryConfig

retryConfig?: pulumi.Input<{
    maxBackoffDuration: pulumi.Input<string>;
    maxDoublings: pulumi.Input<number>;
    maxRetryDuration: pulumi.Input<string>;
    minBackoffDuration: pulumi.Input<string>;
    retryCount: pulumi.Input<number>;
}>;

property schedule

schedule?: pulumi.Input<string>;

property timeZone

timeZone?: pulumi.Input<string>;

interface JobState

Input properties used for looking up and filtering Job resources.

property appEngineHttpTarget

appEngineHttpTarget?: pulumi.Input<{
    appEngineRouting: pulumi.Input<{
        instance: pulumi.Input<string>;
        service: pulumi.Input<string>;
        version: pulumi.Input<string>;
    }>;
    body: pulumi.Input<string>;
    headers: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    httpMethod: pulumi.Input<string>;
    relativeUri: pulumi.Input<string>;
}>;

property description

description?: pulumi.Input<string>;

property httpTarget

httpTarget?: pulumi.Input<{
    body: pulumi.Input<string>;
    headers: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    httpMethod: pulumi.Input<string>;
    uri: pulumi.Input<string>;
}>;

property name

name?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property pubsubTarget

pubsubTarget?: pulumi.Input<{
    attributes: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    data: pulumi.Input<string>;
    topicName: pulumi.Input<string>;
}>;

property region

region?: pulumi.Input<string>;

property retryConfig

retryConfig?: pulumi.Input<{
    maxBackoffDuration: pulumi.Input<string>;
    maxDoublings: pulumi.Input<number>;
    maxRetryDuration: pulumi.Input<string>;
    minBackoffDuration: pulumi.Input<string>;
    retryCount: pulumi.Input<number>;
}>;

property schedule

schedule?: pulumi.Input<string>;

property timeZone

timeZone?: pulumi.Input<string>;