1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. cloudscheduler
  5. Job
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

gcp.cloudscheduler.Job

Explore with Pulumi AI

A scheduled job that can publish a PubSub message or an HTTP request every X interval of time, using a 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";
import * as std from "@pulumi/std";

const topic = new gcp.pubsub.Topic("topic", {name: "job-topic"});
const job = new gcp.cloudscheduler.Job("job", {
    name: "test-job",
    description: "test job",
    schedule: "*/2 * * * *",
    pubsubTarget: {
        topicName: topic.id,
        data: std.base64encode({
            input: "test",
        }).then(invoke => invoke.result),
    },
});
Copy
import pulumi
import pulumi_gcp as gcp
import pulumi_std as std

topic = gcp.pubsub.Topic("topic", name="job-topic")
job = gcp.cloudscheduler.Job("job",
    name="test-job",
    description="test job",
    schedule="*/2 * * * *",
    pubsub_target={
        "topic_name": topic.id,
        "data": std.base64encode(input="test").result,
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/cloudscheduler"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
	"github.com/pulumi/pulumi-std/sdk/go/std"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		topic, err := pubsub.NewTopic(ctx, "topic", &pubsub.TopicArgs{
			Name: pulumi.String("job-topic"),
		})
		if err != nil {
			return err
		}
		invokeBase64encode, err := std.Base64encode(ctx, &std.Base64encodeArgs{
			Input: "test",
		}, nil)
		if err != nil {
			return err
		}
		_, err = cloudscheduler.NewJob(ctx, "job", &cloudscheduler.JobArgs{
			Name:        pulumi.String("test-job"),
			Description: pulumi.String("test job"),
			Schedule:    pulumi.String("*/2 * * * *"),
			PubsubTarget: &cloudscheduler.JobPubsubTargetArgs{
				TopicName: topic.ID(),
				Data:      pulumi.String(invokeBase64encode.Result),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Std = Pulumi.Std;

return await Deployment.RunAsync(() => 
{
    var topic = new Gcp.PubSub.Topic("topic", new()
    {
        Name = "job-topic",
    });

    var job = new Gcp.CloudScheduler.Job("job", new()
    {
        Name = "test-job",
        Description = "test job",
        Schedule = "*/2 * * * *",
        PubsubTarget = new Gcp.CloudScheduler.Inputs.JobPubsubTargetArgs
        {
            TopicName = topic.Id,
            Data = Std.Base64encode.Invoke(new()
            {
                Input = "test",
            }).Apply(invoke => invoke.Result),
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.pubsub.Topic;
import com.pulumi.gcp.pubsub.TopicArgs;
import com.pulumi.gcp.cloudscheduler.Job;
import com.pulumi.gcp.cloudscheduler.JobArgs;
import com.pulumi.gcp.cloudscheduler.inputs.JobPubsubTargetArgs;
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 topic = new Topic("topic", TopicArgs.builder()
            .name("job-topic")
            .build());

        var job = new Job("job", JobArgs.builder()
            .name("test-job")
            .description("test job")
            .schedule("*/2 * * * *")
            .pubsubTarget(JobPubsubTargetArgs.builder()
                .topicName(topic.id())
                .data(StdFunctions.base64encode(Base64encodeArgs.builder()
                    .input("test")
                    .build()).result())
                .build())
            .build());

    }
}
Copy
resources:
  topic:
    type: gcp:pubsub:Topic
    properties:
      name: job-topic
  job:
    type: gcp:cloudscheduler:Job
    properties:
      name: test-job
      description: test job
      schedule: '*/2 * * * *'
      pubsubTarget:
        topicName: ${topic.id}
        data:
          fn::invoke:
            function: std:base64encode
            arguments:
              input: test
            return: result
Copy

Scheduler Job Http

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

const job = new gcp.cloudscheduler.Job("job", {
    name: "test-job",
    description: "test http job",
    schedule: "*/8 * * * *",
    timeZone: "America/New_York",
    attemptDeadline: "320s",
    retryConfig: {
        retryCount: 1,
    },
    httpTarget: {
        httpMethod: "POST",
        uri: "https://example.com/",
        body: std.base64encode({
            input: "{\"foo\":\"bar\"}",
        }).then(invoke => invoke.result),
        headers: {
            "Content-Type": "application/json",
        },
    },
});
Copy
import pulumi
import pulumi_gcp as gcp
import pulumi_std as std

job = gcp.cloudscheduler.Job("job",
    name="test-job",
    description="test http job",
    schedule="*/8 * * * *",
    time_zone="America/New_York",
    attempt_deadline="320s",
    retry_config={
        "retry_count": 1,
    },
    http_target={
        "http_method": "POST",
        "uri": "https://example.com/",
        "body": std.base64encode(input="{\"foo\":\"bar\"}").result,
        "headers": {
            "Content-Type": "application/json",
        },
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/cloudscheduler"
	"github.com/pulumi/pulumi-std/sdk/go/std"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		invokeBase64encode, err := std.Base64encode(ctx, &std.Base64encodeArgs{
			Input: "{\"foo\":\"bar\"}",
		}, nil)
		if err != nil {
			return err
		}
		_, err = cloudscheduler.NewJob(ctx, "job", &cloudscheduler.JobArgs{
			Name:            pulumi.String("test-job"),
			Description:     pulumi.String("test http job"),
			Schedule:        pulumi.String("*/8 * * * *"),
			TimeZone:        pulumi.String("America/New_York"),
			AttemptDeadline: pulumi.String("320s"),
			RetryConfig: &cloudscheduler.JobRetryConfigArgs{
				RetryCount: pulumi.Int(1),
			},
			HttpTarget: &cloudscheduler.JobHttpTargetArgs{
				HttpMethod: pulumi.String("POST"),
				Uri:        pulumi.String("https://example.com/"),
				Body:       pulumi.String(invokeBase64encode.Result),
				Headers: pulumi.StringMap{
					"Content-Type": pulumi.String("application/json"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Std = Pulumi.Std;

return await Deployment.RunAsync(() => 
{
    var job = new Gcp.CloudScheduler.Job("job", new()
    {
        Name = "test-job",
        Description = "test http job",
        Schedule = "*/8 * * * *",
        TimeZone = "America/New_York",
        AttemptDeadline = "320s",
        RetryConfig = new Gcp.CloudScheduler.Inputs.JobRetryConfigArgs
        {
            RetryCount = 1,
        },
        HttpTarget = new Gcp.CloudScheduler.Inputs.JobHttpTargetArgs
        {
            HttpMethod = "POST",
            Uri = "https://example.com/",
            Body = Std.Base64encode.Invoke(new()
            {
                Input = "{\"foo\":\"bar\"}",
            }).Apply(invoke => invoke.Result),
            Headers = 
            {
                { "Content-Type", "application/json" },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.cloudscheduler.Job;
import com.pulumi.gcp.cloudscheduler.JobArgs;
import com.pulumi.gcp.cloudscheduler.inputs.JobRetryConfigArgs;
import com.pulumi.gcp.cloudscheduler.inputs.JobHttpTargetArgs;
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 job = new Job("job", JobArgs.builder()
            .name("test-job")
            .description("test http job")
            .schedule("*/8 * * * *")
            .timeZone("America/New_York")
            .attemptDeadline("320s")
            .retryConfig(JobRetryConfigArgs.builder()
                .retryCount(1)
                .build())
            .httpTarget(JobHttpTargetArgs.builder()
                .httpMethod("POST")
                .uri("https://example.com/")
                .body(StdFunctions.base64encode(Base64encodeArgs.builder()
                    .input("{\"foo\":\"bar\"}")
                    .build()).result())
                .headers(Map.of("Content-Type", "application/json"))
                .build())
            .build());

    }
}
Copy
resources:
  job:
    type: gcp:cloudscheduler:Job
    properties:
      name: test-job
      description: test http job
      schedule: '*/8 * * * *'
      timeZone: America/New_York
      attemptDeadline: 320s
      retryConfig:
        retryCount: 1
      httpTarget:
        httpMethod: POST
        uri: https://example.com/
        body:
          fn::invoke:
            function: std:base64encode
            arguments:
              input: '{"foo":"bar"}'
            return: result
        headers:
          Content-Type: application/json
Copy

Scheduler Job Paused

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

const job = new gcp.cloudscheduler.Job("job", {
    paused: true,
    name: "test-job",
    description: "test http job with updated fields",
    schedule: "*/8 * * * *",
    timeZone: "America/New_York",
    attemptDeadline: "320s",
    retryConfig: {
        retryCount: 1,
    },
    httpTarget: {
        httpMethod: "POST",
        uri: "https://example.com/ping",
        body: std.base64encode({
            input: "{\"foo\":\"bar\"}",
        }).then(invoke => invoke.result),
        headers: {
            "Content-Type": "application/json",
        },
    },
});
Copy
import pulumi
import pulumi_gcp as gcp
import pulumi_std as std

job = gcp.cloudscheduler.Job("job",
    paused=True,
    name="test-job",
    description="test http job with updated fields",
    schedule="*/8 * * * *",
    time_zone="America/New_York",
    attempt_deadline="320s",
    retry_config={
        "retry_count": 1,
    },
    http_target={
        "http_method": "POST",
        "uri": "https://example.com/ping",
        "body": std.base64encode(input="{\"foo\":\"bar\"}").result,
        "headers": {
            "Content-Type": "application/json",
        },
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/cloudscheduler"
	"github.com/pulumi/pulumi-std/sdk/go/std"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		invokeBase64encode, err := std.Base64encode(ctx, &std.Base64encodeArgs{
			Input: "{\"foo\":\"bar\"}",
		}, nil)
		if err != nil {
			return err
		}
		_, err = cloudscheduler.NewJob(ctx, "job", &cloudscheduler.JobArgs{
			Paused:          pulumi.Bool(true),
			Name:            pulumi.String("test-job"),
			Description:     pulumi.String("test http job with updated fields"),
			Schedule:        pulumi.String("*/8 * * * *"),
			TimeZone:        pulumi.String("America/New_York"),
			AttemptDeadline: pulumi.String("320s"),
			RetryConfig: &cloudscheduler.JobRetryConfigArgs{
				RetryCount: pulumi.Int(1),
			},
			HttpTarget: &cloudscheduler.JobHttpTargetArgs{
				HttpMethod: pulumi.String("POST"),
				Uri:        pulumi.String("https://example.com/ping"),
				Body:       pulumi.String(invokeBase64encode.Result),
				Headers: pulumi.StringMap{
					"Content-Type": pulumi.String("application/json"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Std = Pulumi.Std;

return await Deployment.RunAsync(() => 
{
    var job = new Gcp.CloudScheduler.Job("job", new()
    {
        Paused = true,
        Name = "test-job",
        Description = "test http job with updated fields",
        Schedule = "*/8 * * * *",
        TimeZone = "America/New_York",
        AttemptDeadline = "320s",
        RetryConfig = new Gcp.CloudScheduler.Inputs.JobRetryConfigArgs
        {
            RetryCount = 1,
        },
        HttpTarget = new Gcp.CloudScheduler.Inputs.JobHttpTargetArgs
        {
            HttpMethod = "POST",
            Uri = "https://example.com/ping",
            Body = Std.Base64encode.Invoke(new()
            {
                Input = "{\"foo\":\"bar\"}",
            }).Apply(invoke => invoke.Result),
            Headers = 
            {
                { "Content-Type", "application/json" },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.cloudscheduler.Job;
import com.pulumi.gcp.cloudscheduler.JobArgs;
import com.pulumi.gcp.cloudscheduler.inputs.JobRetryConfigArgs;
import com.pulumi.gcp.cloudscheduler.inputs.JobHttpTargetArgs;
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 job = new Job("job", JobArgs.builder()
            .paused(true)
            .name("test-job")
            .description("test http job with updated fields")
            .schedule("*/8 * * * *")
            .timeZone("America/New_York")
            .attemptDeadline("320s")
            .retryConfig(JobRetryConfigArgs.builder()
                .retryCount(1)
                .build())
            .httpTarget(JobHttpTargetArgs.builder()
                .httpMethod("POST")
                .uri("https://example.com/ping")
                .body(StdFunctions.base64encode(Base64encodeArgs.builder()
                    .input("{\"foo\":\"bar\"}")
                    .build()).result())
                .headers(Map.of("Content-Type", "application/json"))
                .build())
            .build());

    }
}
Copy
resources:
  job:
    type: gcp:cloudscheduler:Job
    properties:
      paused: true
      name: test-job
      description: test http job with updated fields
      schedule: '*/8 * * * *'
      timeZone: America/New_York
      attemptDeadline: 320s
      retryConfig:
        retryCount: 1
      httpTarget:
        httpMethod: POST
        uri: https://example.com/ping
        body:
          fn::invoke:
            function: std:base64encode
            arguments:
              input: '{"foo":"bar"}'
            return: result
        headers:
          Content-Type: application/json
Copy

Scheduler Job App Engine

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

const job = new gcp.cloudscheduler.Job("job", {
    name: "test-job",
    schedule: "*/4 * * * *",
    description: "test app engine job",
    timeZone: "Europe/London",
    attemptDeadline: "320s",
    retryConfig: {
        minBackoffDuration: "1s",
        maxRetryDuration: "10s",
        maxDoublings: 2,
        retryCount: 3,
    },
    appEngineHttpTarget: {
        httpMethod: "POST",
        appEngineRouting: {
            service: "web",
            version: "prod",
            instance: "my-instance-001",
        },
        relativeUri: "/ping",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

job = gcp.cloudscheduler.Job("job",
    name="test-job",
    schedule="*/4 * * * *",
    description="test app engine job",
    time_zone="Europe/London",
    attempt_deadline="320s",
    retry_config={
        "min_backoff_duration": "1s",
        "max_retry_duration": "10s",
        "max_doublings": 2,
        "retry_count": 3,
    },
    app_engine_http_target={
        "http_method": "POST",
        "app_engine_routing": {
            "service": "web",
            "version": "prod",
            "instance": "my-instance-001",
        },
        "relative_uri": "/ping",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/cloudscheduler"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudscheduler.NewJob(ctx, "job", &cloudscheduler.JobArgs{
			Name:            pulumi.String("test-job"),
			Schedule:        pulumi.String("*/4 * * * *"),
			Description:     pulumi.String("test app engine job"),
			TimeZone:        pulumi.String("Europe/London"),
			AttemptDeadline: pulumi.String("320s"),
			RetryConfig: &cloudscheduler.JobRetryConfigArgs{
				MinBackoffDuration: pulumi.String("1s"),
				MaxRetryDuration:   pulumi.String("10s"),
				MaxDoublings:       pulumi.Int(2),
				RetryCount:         pulumi.Int(3),
			},
			AppEngineHttpTarget: &cloudscheduler.JobAppEngineHttpTargetArgs{
				HttpMethod: pulumi.String("POST"),
				AppEngineRouting: &cloudscheduler.JobAppEngineHttpTargetAppEngineRoutingArgs{
					Service:  pulumi.String("web"),
					Version:  pulumi.String("prod"),
					Instance: pulumi.String("my-instance-001"),
				},
				RelativeUri: pulumi.String("/ping"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var job = new Gcp.CloudScheduler.Job("job", new()
    {
        Name = "test-job",
        Schedule = "*/4 * * * *",
        Description = "test app engine job",
        TimeZone = "Europe/London",
        AttemptDeadline = "320s",
        RetryConfig = new Gcp.CloudScheduler.Inputs.JobRetryConfigArgs
        {
            MinBackoffDuration = "1s",
            MaxRetryDuration = "10s",
            MaxDoublings = 2,
            RetryCount = 3,
        },
        AppEngineHttpTarget = new Gcp.CloudScheduler.Inputs.JobAppEngineHttpTargetArgs
        {
            HttpMethod = "POST",
            AppEngineRouting = new Gcp.CloudScheduler.Inputs.JobAppEngineHttpTargetAppEngineRoutingArgs
            {
                Service = "web",
                Version = "prod",
                Instance = "my-instance-001",
            },
            RelativeUri = "/ping",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.cloudscheduler.Job;
import com.pulumi.gcp.cloudscheduler.JobArgs;
import com.pulumi.gcp.cloudscheduler.inputs.JobRetryConfigArgs;
import com.pulumi.gcp.cloudscheduler.inputs.JobAppEngineHttpTargetArgs;
import com.pulumi.gcp.cloudscheduler.inputs.JobAppEngineHttpTargetAppEngineRoutingArgs;
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 job = new Job("job", JobArgs.builder()
            .name("test-job")
            .schedule("*/4 * * * *")
            .description("test app engine job")
            .timeZone("Europe/London")
            .attemptDeadline("320s")
            .retryConfig(JobRetryConfigArgs.builder()
                .minBackoffDuration("1s")
                .maxRetryDuration("10s")
                .maxDoublings(2)
                .retryCount(3)
                .build())
            .appEngineHttpTarget(JobAppEngineHttpTargetArgs.builder()
                .httpMethod("POST")
                .appEngineRouting(JobAppEngineHttpTargetAppEngineRoutingArgs.builder()
                    .service("web")
                    .version("prod")
                    .instance("my-instance-001")
                    .build())
                .relativeUri("/ping")
                .build())
            .build());

    }
}
Copy
resources:
  job:
    type: gcp:cloudscheduler:Job
    properties:
      name: test-job
      schedule: '*/4 * * * *'
      description: test app engine job
      timeZone: Europe/London
      attemptDeadline: 320s
      retryConfig:
        minBackoffDuration: 1s
        maxRetryDuration: 10s
        maxDoublings: 2
        retryCount: 3
      appEngineHttpTarget:
        httpMethod: POST
        appEngineRouting:
          service: web
          version: prod
          instance: my-instance-001
        relativeUri: /ping
Copy

Scheduler Job Oauth

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

const _default = gcp.compute.getDefaultServiceAccount({});
const job = new gcp.cloudscheduler.Job("job", {
    name: "test-job",
    description: "test http job",
    schedule: "*/8 * * * *",
    timeZone: "America/New_York",
    attemptDeadline: "320s",
    httpTarget: {
        httpMethod: "GET",
        uri: "https://cloudscheduler.googleapis.com/v1/projects/my-project-name/locations/us-west1/jobs",
        oauthToken: {
            serviceAccountEmail: _default.then(_default => _default.email),
        },
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

default = gcp.compute.get_default_service_account()
job = gcp.cloudscheduler.Job("job",
    name="test-job",
    description="test http job",
    schedule="*/8 * * * *",
    time_zone="America/New_York",
    attempt_deadline="320s",
    http_target={
        "http_method": "GET",
        "uri": "https://cloudscheduler.googleapis.com/v1/projects/my-project-name/locations/us-west1/jobs",
        "oauth_token": {
            "service_account_email": default.email,
        },
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/cloudscheduler"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_default, err := compute.GetDefaultServiceAccount(ctx, &compute.GetDefaultServiceAccountArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = cloudscheduler.NewJob(ctx, "job", &cloudscheduler.JobArgs{
			Name:            pulumi.String("test-job"),
			Description:     pulumi.String("test http job"),
			Schedule:        pulumi.String("*/8 * * * *"),
			TimeZone:        pulumi.String("America/New_York"),
			AttemptDeadline: pulumi.String("320s"),
			HttpTarget: &cloudscheduler.JobHttpTargetArgs{
				HttpMethod: pulumi.String("GET"),
				Uri:        pulumi.String("https://cloudscheduler.googleapis.com/v1/projects/my-project-name/locations/us-west1/jobs"),
				OauthToken: &cloudscheduler.JobHttpTargetOauthTokenArgs{
					ServiceAccountEmail: pulumi.String(_default.Email),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var @default = Gcp.Compute.GetDefaultServiceAccount.Invoke();

    var job = new Gcp.CloudScheduler.Job("job", new()
    {
        Name = "test-job",
        Description = "test http job",
        Schedule = "*/8 * * * *",
        TimeZone = "America/New_York",
        AttemptDeadline = "320s",
        HttpTarget = new Gcp.CloudScheduler.Inputs.JobHttpTargetArgs
        {
            HttpMethod = "GET",
            Uri = "https://cloudscheduler.googleapis.com/v1/projects/my-project-name/locations/us-west1/jobs",
            OauthToken = new Gcp.CloudScheduler.Inputs.JobHttpTargetOauthTokenArgs
            {
                ServiceAccountEmail = @default.Apply(@default => @default.Apply(getDefaultServiceAccountResult => getDefaultServiceAccountResult.Email)),
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetDefaultServiceAccountArgs;
import com.pulumi.gcp.cloudscheduler.Job;
import com.pulumi.gcp.cloudscheduler.JobArgs;
import com.pulumi.gcp.cloudscheduler.inputs.JobHttpTargetArgs;
import com.pulumi.gcp.cloudscheduler.inputs.JobHttpTargetOauthTokenArgs;
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 default = ComputeFunctions.getDefaultServiceAccount();

        var job = new Job("job", JobArgs.builder()
            .name("test-job")
            .description("test http job")
            .schedule("*/8 * * * *")
            .timeZone("America/New_York")
            .attemptDeadline("320s")
            .httpTarget(JobHttpTargetArgs.builder()
                .httpMethod("GET")
                .uri("https://cloudscheduler.googleapis.com/v1/projects/my-project-name/locations/us-west1/jobs")
                .oauthToken(JobHttpTargetOauthTokenArgs.builder()
                    .serviceAccountEmail(default_.email())
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  job:
    type: gcp:cloudscheduler:Job
    properties:
      name: test-job
      description: test http job
      schedule: '*/8 * * * *'
      timeZone: America/New_York
      attemptDeadline: 320s
      httpTarget:
        httpMethod: GET
        uri: https://cloudscheduler.googleapis.com/v1/projects/my-project-name/locations/us-west1/jobs
        oauthToken:
          serviceAccountEmail: ${default.email}
variables:
  default:
    fn::invoke:
      function: gcp:compute:getDefaultServiceAccount
      arguments: {}
Copy

Scheduler Job Oidc

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

const _default = gcp.compute.getDefaultServiceAccount({});
const job = new gcp.cloudscheduler.Job("job", {
    name: "test-job",
    description: "test http job",
    schedule: "*/8 * * * *",
    timeZone: "America/New_York",
    attemptDeadline: "320s",
    httpTarget: {
        httpMethod: "GET",
        uri: "https://example.com/ping",
        oidcToken: {
            serviceAccountEmail: _default.then(_default => _default.email),
        },
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

default = gcp.compute.get_default_service_account()
job = gcp.cloudscheduler.Job("job",
    name="test-job",
    description="test http job",
    schedule="*/8 * * * *",
    time_zone="America/New_York",
    attempt_deadline="320s",
    http_target={
        "http_method": "GET",
        "uri": "https://example.com/ping",
        "oidc_token": {
            "service_account_email": default.email,
        },
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/cloudscheduler"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_default, err := compute.GetDefaultServiceAccount(ctx, &compute.GetDefaultServiceAccountArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = cloudscheduler.NewJob(ctx, "job", &cloudscheduler.JobArgs{
			Name:            pulumi.String("test-job"),
			Description:     pulumi.String("test http job"),
			Schedule:        pulumi.String("*/8 * * * *"),
			TimeZone:        pulumi.String("America/New_York"),
			AttemptDeadline: pulumi.String("320s"),
			HttpTarget: &cloudscheduler.JobHttpTargetArgs{
				HttpMethod: pulumi.String("GET"),
				Uri:        pulumi.String("https://example.com/ping"),
				OidcToken: &cloudscheduler.JobHttpTargetOidcTokenArgs{
					ServiceAccountEmail: pulumi.String(_default.Email),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var @default = Gcp.Compute.GetDefaultServiceAccount.Invoke();

    var job = new Gcp.CloudScheduler.Job("job", new()
    {
        Name = "test-job",
        Description = "test http job",
        Schedule = "*/8 * * * *",
        TimeZone = "America/New_York",
        AttemptDeadline = "320s",
        HttpTarget = new Gcp.CloudScheduler.Inputs.JobHttpTargetArgs
        {
            HttpMethod = "GET",
            Uri = "https://example.com/ping",
            OidcToken = new Gcp.CloudScheduler.Inputs.JobHttpTargetOidcTokenArgs
            {
                ServiceAccountEmail = @default.Apply(@default => @default.Apply(getDefaultServiceAccountResult => getDefaultServiceAccountResult.Email)),
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetDefaultServiceAccountArgs;
import com.pulumi.gcp.cloudscheduler.Job;
import com.pulumi.gcp.cloudscheduler.JobArgs;
import com.pulumi.gcp.cloudscheduler.inputs.JobHttpTargetArgs;
import com.pulumi.gcp.cloudscheduler.inputs.JobHttpTargetOidcTokenArgs;
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 default = ComputeFunctions.getDefaultServiceAccount();

        var job = new Job("job", JobArgs.builder()
            .name("test-job")
            .description("test http job")
            .schedule("*/8 * * * *")
            .timeZone("America/New_York")
            .attemptDeadline("320s")
            .httpTarget(JobHttpTargetArgs.builder()
                .httpMethod("GET")
                .uri("https://example.com/ping")
                .oidcToken(JobHttpTargetOidcTokenArgs.builder()
                    .serviceAccountEmail(default_.email())
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  job:
    type: gcp:cloudscheduler:Job
    properties:
      name: test-job
      description: test http job
      schedule: '*/8 * * * *'
      timeZone: America/New_York
      attemptDeadline: 320s
      httpTarget:
        httpMethod: GET
        uri: https://example.com/ping
        oidcToken:
          serviceAccountEmail: ${default.email}
variables:
  default:
    fn::invoke:
      function: gcp:compute:getDefaultServiceAccount
      arguments: {}
Copy

Create Job Resource

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

Constructor syntax

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

@overload
def Job(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        app_engine_http_target: Optional[JobAppEngineHttpTargetArgs] = None,
        attempt_deadline: Optional[str] = None,
        description: Optional[str] = None,
        http_target: Optional[JobHttpTargetArgs] = None,
        name: Optional[str] = None,
        paused: Optional[bool] = None,
        project: Optional[str] = None,
        pubsub_target: Optional[JobPubsubTargetArgs] = None,
        region: Optional[str] = None,
        retry_config: Optional[JobRetryConfigArgs] = None,
        schedule: Optional[str] = None,
        time_zone: Optional[str] = None)
func NewJob(ctx *Context, name string, args *JobArgs, opts ...ResourceOption) (*Job, error)
public Job(string name, JobArgs? args = null, CustomResourceOptions? opts = null)
public Job(String name, JobArgs args)
public Job(String name, JobArgs args, CustomResourceOptions options)
type: gcp:cloudscheduler:Job
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 JobArgs
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 JobArgs
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 JobArgs
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 JobArgs
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. JobArgs
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 examplejobResourceResourceFromCloudschedulerjob = new Gcp.CloudScheduler.Job("examplejobResourceResourceFromCloudschedulerjob", new()
{
    AppEngineHttpTarget = new Gcp.CloudScheduler.Inputs.JobAppEngineHttpTargetArgs
    {
        RelativeUri = "string",
        AppEngineRouting = new Gcp.CloudScheduler.Inputs.JobAppEngineHttpTargetAppEngineRoutingArgs
        {
            Instance = "string",
            Service = "string",
            Version = "string",
        },
        Body = "string",
        Headers = 
        {
            { "string", "string" },
        },
        HttpMethod = "string",
    },
    AttemptDeadline = "string",
    Description = "string",
    HttpTarget = new Gcp.CloudScheduler.Inputs.JobHttpTargetArgs
    {
        Uri = "string",
        Body = "string",
        Headers = 
        {
            { "string", "string" },
        },
        HttpMethod = "string",
        OauthToken = new Gcp.CloudScheduler.Inputs.JobHttpTargetOauthTokenArgs
        {
            ServiceAccountEmail = "string",
            Scope = "string",
        },
        OidcToken = new Gcp.CloudScheduler.Inputs.JobHttpTargetOidcTokenArgs
        {
            ServiceAccountEmail = "string",
            Audience = "string",
        },
    },
    Name = "string",
    Paused = false,
    Project = "string",
    PubsubTarget = new Gcp.CloudScheduler.Inputs.JobPubsubTargetArgs
    {
        TopicName = "string",
        Attributes = 
        {
            { "string", "string" },
        },
        Data = "string",
    },
    Region = "string",
    RetryConfig = new Gcp.CloudScheduler.Inputs.JobRetryConfigArgs
    {
        MaxBackoffDuration = "string",
        MaxDoublings = 0,
        MaxRetryDuration = "string",
        MinBackoffDuration = "string",
        RetryCount = 0,
    },
    Schedule = "string",
    TimeZone = "string",
});
Copy
example, err := cloudscheduler.NewJob(ctx, "examplejobResourceResourceFromCloudschedulerjob", &cloudscheduler.JobArgs{
	AppEngineHttpTarget: &cloudscheduler.JobAppEngineHttpTargetArgs{
		RelativeUri: pulumi.String("string"),
		AppEngineRouting: &cloudscheduler.JobAppEngineHttpTargetAppEngineRoutingArgs{
			Instance: pulumi.String("string"),
			Service:  pulumi.String("string"),
			Version:  pulumi.String("string"),
		},
		Body: pulumi.String("string"),
		Headers: pulumi.StringMap{
			"string": pulumi.String("string"),
		},
		HttpMethod: pulumi.String("string"),
	},
	AttemptDeadline: pulumi.String("string"),
	Description:     pulumi.String("string"),
	HttpTarget: &cloudscheduler.JobHttpTargetArgs{
		Uri:  pulumi.String("string"),
		Body: pulumi.String("string"),
		Headers: pulumi.StringMap{
			"string": pulumi.String("string"),
		},
		HttpMethod: pulumi.String("string"),
		OauthToken: &cloudscheduler.JobHttpTargetOauthTokenArgs{
			ServiceAccountEmail: pulumi.String("string"),
			Scope:               pulumi.String("string"),
		},
		OidcToken: &cloudscheduler.JobHttpTargetOidcTokenArgs{
			ServiceAccountEmail: pulumi.String("string"),
			Audience:            pulumi.String("string"),
		},
	},
	Name:    pulumi.String("string"),
	Paused:  pulumi.Bool(false),
	Project: pulumi.String("string"),
	PubsubTarget: &cloudscheduler.JobPubsubTargetArgs{
		TopicName: pulumi.String("string"),
		Attributes: pulumi.StringMap{
			"string": pulumi.String("string"),
		},
		Data: pulumi.String("string"),
	},
	Region: pulumi.String("string"),
	RetryConfig: &cloudscheduler.JobRetryConfigArgs{
		MaxBackoffDuration: pulumi.String("string"),
		MaxDoublings:       pulumi.Int(0),
		MaxRetryDuration:   pulumi.String("string"),
		MinBackoffDuration: pulumi.String("string"),
		RetryCount:         pulumi.Int(0),
	},
	Schedule: pulumi.String("string"),
	TimeZone: pulumi.String("string"),
})
Copy
var examplejobResourceResourceFromCloudschedulerjob = new Job("examplejobResourceResourceFromCloudschedulerjob", JobArgs.builder()
    .appEngineHttpTarget(JobAppEngineHttpTargetArgs.builder()
        .relativeUri("string")
        .appEngineRouting(JobAppEngineHttpTargetAppEngineRoutingArgs.builder()
            .instance("string")
            .service("string")
            .version("string")
            .build())
        .body("string")
        .headers(Map.of("string", "string"))
        .httpMethod("string")
        .build())
    .attemptDeadline("string")
    .description("string")
    .httpTarget(JobHttpTargetArgs.builder()
        .uri("string")
        .body("string")
        .headers(Map.of("string", "string"))
        .httpMethod("string")
        .oauthToken(JobHttpTargetOauthTokenArgs.builder()
            .serviceAccountEmail("string")
            .scope("string")
            .build())
        .oidcToken(JobHttpTargetOidcTokenArgs.builder()
            .serviceAccountEmail("string")
            .audience("string")
            .build())
        .build())
    .name("string")
    .paused(false)
    .project("string")
    .pubsubTarget(JobPubsubTargetArgs.builder()
        .topicName("string")
        .attributes(Map.of("string", "string"))
        .data("string")
        .build())
    .region("string")
    .retryConfig(JobRetryConfigArgs.builder()
        .maxBackoffDuration("string")
        .maxDoublings(0)
        .maxRetryDuration("string")
        .minBackoffDuration("string")
        .retryCount(0)
        .build())
    .schedule("string")
    .timeZone("string")
    .build());
Copy
examplejob_resource_resource_from_cloudschedulerjob = gcp.cloudscheduler.Job("examplejobResourceResourceFromCloudschedulerjob",
    app_engine_http_target={
        "relative_uri": "string",
        "app_engine_routing": {
            "instance": "string",
            "service": "string",
            "version": "string",
        },
        "body": "string",
        "headers": {
            "string": "string",
        },
        "http_method": "string",
    },
    attempt_deadline="string",
    description="string",
    http_target={
        "uri": "string",
        "body": "string",
        "headers": {
            "string": "string",
        },
        "http_method": "string",
        "oauth_token": {
            "service_account_email": "string",
            "scope": "string",
        },
        "oidc_token": {
            "service_account_email": "string",
            "audience": "string",
        },
    },
    name="string",
    paused=False,
    project="string",
    pubsub_target={
        "topic_name": "string",
        "attributes": {
            "string": "string",
        },
        "data": "string",
    },
    region="string",
    retry_config={
        "max_backoff_duration": "string",
        "max_doublings": 0,
        "max_retry_duration": "string",
        "min_backoff_duration": "string",
        "retry_count": 0,
    },
    schedule="string",
    time_zone="string")
Copy
const examplejobResourceResourceFromCloudschedulerjob = new gcp.cloudscheduler.Job("examplejobResourceResourceFromCloudschedulerjob", {
    appEngineHttpTarget: {
        relativeUri: "string",
        appEngineRouting: {
            instance: "string",
            service: "string",
            version: "string",
        },
        body: "string",
        headers: {
            string: "string",
        },
        httpMethod: "string",
    },
    attemptDeadline: "string",
    description: "string",
    httpTarget: {
        uri: "string",
        body: "string",
        headers: {
            string: "string",
        },
        httpMethod: "string",
        oauthToken: {
            serviceAccountEmail: "string",
            scope: "string",
        },
        oidcToken: {
            serviceAccountEmail: "string",
            audience: "string",
        },
    },
    name: "string",
    paused: false,
    project: "string",
    pubsubTarget: {
        topicName: "string",
        attributes: {
            string: "string",
        },
        data: "string",
    },
    region: "string",
    retryConfig: {
        maxBackoffDuration: "string",
        maxDoublings: 0,
        maxRetryDuration: "string",
        minBackoffDuration: "string",
        retryCount: 0,
    },
    schedule: "string",
    timeZone: "string",
});
Copy
type: gcp:cloudscheduler:Job
properties:
    appEngineHttpTarget:
        appEngineRouting:
            instance: string
            service: string
            version: string
        body: string
        headers:
            string: string
        httpMethod: string
        relativeUri: string
    attemptDeadline: string
    description: string
    httpTarget:
        body: string
        headers:
            string: string
        httpMethod: string
        oauthToken:
            scope: string
            serviceAccountEmail: string
        oidcToken:
            audience: string
            serviceAccountEmail: string
        uri: string
    name: string
    paused: false
    project: string
    pubsubTarget:
        attributes:
            string: string
        data: string
        topicName: string
    region: string
    retryConfig:
        maxBackoffDuration: string
        maxDoublings: 0
        maxRetryDuration: string
        minBackoffDuration: string
        retryCount: 0
    schedule: string
    timeZone: string
Copy

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

AppEngineHttpTarget JobAppEngineHttpTarget
App Engine HTTP target. If the job providers a App Engine HTTP target the cron will send a request to the service instance Structure is documented below.
AttemptDeadline string
The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The allowed duration for this deadline is:

  • For HTTP targets, between 15 seconds and 30 minutes.
  • For App Engine HTTP targets, between 15 seconds and 24 hours.
  • Note: For PubSub targets, this field is ignored - setting it will introduce an unresolvable diff. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s"
Description string
A human-readable description for the job. This string must not contain more than 500 characters.
HttpTarget JobHttpTarget
HTTP target. If the job providers a http_target the cron will send a request to the targeted url Structure is documented below.
Name Changes to this property will trigger replacement. string
The name of the job.


Paused bool
Sets the job to a paused state. Jobs default to being enabled when this property is not set.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PubsubTarget JobPubsubTarget
Pub/Sub target If the job providers a Pub/Sub target the cron will publish a message to the provided topic Structure is documented below.
Region Changes to this property will trigger replacement. string
Region where the scheduler job resides. If it is not provided, this provider will use the provider default.
RetryConfig JobRetryConfig
By default, if a job does not complete successfully, meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings Structure is documented below.
Schedule string
Describes the schedule on which the job will be executed.
TimeZone string
Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the tz database.
AppEngineHttpTarget JobAppEngineHttpTargetArgs
App Engine HTTP target. If the job providers a App Engine HTTP target the cron will send a request to the service instance Structure is documented below.
AttemptDeadline string
The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The allowed duration for this deadline is:

  • For HTTP targets, between 15 seconds and 30 minutes.
  • For App Engine HTTP targets, between 15 seconds and 24 hours.
  • Note: For PubSub targets, this field is ignored - setting it will introduce an unresolvable diff. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s"
Description string
A human-readable description for the job. This string must not contain more than 500 characters.
HttpTarget JobHttpTargetArgs
HTTP target. If the job providers a http_target the cron will send a request to the targeted url Structure is documented below.
Name Changes to this property will trigger replacement. string
The name of the job.


Paused bool
Sets the job to a paused state. Jobs default to being enabled when this property is not set.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PubsubTarget JobPubsubTargetArgs
Pub/Sub target If the job providers a Pub/Sub target the cron will publish a message to the provided topic Structure is documented below.
Region Changes to this property will trigger replacement. string
Region where the scheduler job resides. If it is not provided, this provider will use the provider default.
RetryConfig JobRetryConfigArgs
By default, if a job does not complete successfully, meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings Structure is documented below.
Schedule string
Describes the schedule on which the job will be executed.
TimeZone string
Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the tz database.
appEngineHttpTarget JobAppEngineHttpTarget
App Engine HTTP target. If the job providers a App Engine HTTP target the cron will send a request to the service instance Structure is documented below.
attemptDeadline String
The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The allowed duration for this deadline is:

  • For HTTP targets, between 15 seconds and 30 minutes.
  • For App Engine HTTP targets, between 15 seconds and 24 hours.
  • Note: For PubSub targets, this field is ignored - setting it will introduce an unresolvable diff. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s"
description String
A human-readable description for the job. This string must not contain more than 500 characters.
httpTarget JobHttpTarget
HTTP target. If the job providers a http_target the cron will send a request to the targeted url Structure is documented below.
name Changes to this property will trigger replacement. String
The name of the job.


paused Boolean
Sets the job to a paused state. Jobs default to being enabled when this property is not set.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pubsubTarget JobPubsubTarget
Pub/Sub target If the job providers a Pub/Sub target the cron will publish a message to the provided topic Structure is documented below.
region Changes to this property will trigger replacement. String
Region where the scheduler job resides. If it is not provided, this provider will use the provider default.
retryConfig JobRetryConfig
By default, if a job does not complete successfully, meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings Structure is documented below.
schedule String
Describes the schedule on which the job will be executed.
timeZone String
Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the tz database.
appEngineHttpTarget JobAppEngineHttpTarget
App Engine HTTP target. If the job providers a App Engine HTTP target the cron will send a request to the service instance Structure is documented below.
attemptDeadline string
The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The allowed duration for this deadline is:

  • For HTTP targets, between 15 seconds and 30 minutes.
  • For App Engine HTTP targets, between 15 seconds and 24 hours.
  • Note: For PubSub targets, this field is ignored - setting it will introduce an unresolvable diff. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s"
description string
A human-readable description for the job. This string must not contain more than 500 characters.
httpTarget JobHttpTarget
HTTP target. If the job providers a http_target the cron will send a request to the targeted url Structure is documented below.
name Changes to this property will trigger replacement. string
The name of the job.


paused boolean
Sets the job to a paused state. Jobs default to being enabled when this property is not set.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pubsubTarget JobPubsubTarget
Pub/Sub target If the job providers a Pub/Sub target the cron will publish a message to the provided topic Structure is documented below.
region Changes to this property will trigger replacement. string
Region where the scheduler job resides. If it is not provided, this provider will use the provider default.
retryConfig JobRetryConfig
By default, if a job does not complete successfully, meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings Structure is documented below.
schedule string
Describes the schedule on which the job will be executed.
timeZone string
Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the tz database.
app_engine_http_target JobAppEngineHttpTargetArgs
App Engine HTTP target. If the job providers a App Engine HTTP target the cron will send a request to the service instance Structure is documented below.
attempt_deadline str
The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The allowed duration for this deadline is:

  • For HTTP targets, between 15 seconds and 30 minutes.
  • For App Engine HTTP targets, between 15 seconds and 24 hours.
  • Note: For PubSub targets, this field is ignored - setting it will introduce an unresolvable diff. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s"
description str
A human-readable description for the job. This string must not contain more than 500 characters.
http_target JobHttpTargetArgs
HTTP target. If the job providers a http_target the cron will send a request to the targeted url Structure is documented below.
name Changes to this property will trigger replacement. str
The name of the job.


paused bool
Sets the job to a paused state. Jobs default to being enabled when this property is not set.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pubsub_target JobPubsubTargetArgs
Pub/Sub target If the job providers a Pub/Sub target the cron will publish a message to the provided topic Structure is documented below.
region Changes to this property will trigger replacement. str
Region where the scheduler job resides. If it is not provided, this provider will use the provider default.
retry_config JobRetryConfigArgs
By default, if a job does not complete successfully, meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings Structure is documented below.
schedule str
Describes the schedule on which the job will be executed.
time_zone str
Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the tz database.
appEngineHttpTarget Property Map
App Engine HTTP target. If the job providers a App Engine HTTP target the cron will send a request to the service instance Structure is documented below.
attemptDeadline String
The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The allowed duration for this deadline is:

  • For HTTP targets, between 15 seconds and 30 minutes.
  • For App Engine HTTP targets, between 15 seconds and 24 hours.
  • Note: For PubSub targets, this field is ignored - setting it will introduce an unresolvable diff. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s"
description String
A human-readable description for the job. This string must not contain more than 500 characters.
httpTarget Property Map
HTTP target. If the job providers a http_target the cron will send a request to the targeted url Structure is documented below.
name Changes to this property will trigger replacement. String
The name of the job.


paused Boolean
Sets the job to a paused state. Jobs default to being enabled when this property is not set.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pubsubTarget Property Map
Pub/Sub target If the job providers a Pub/Sub target the cron will publish a message to the provided topic Structure is documented below.
region Changes to this property will trigger replacement. String
Region where the scheduler job resides. If it is not provided, this provider will use the provider default.
retryConfig Property Map
By default, if a job does not complete successfully, meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings Structure is documented below.
schedule String
Describes the schedule on which the job will be executed.
timeZone String
Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the tz database.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
State string
State of the job.
Id string
The provider-assigned unique ID for this managed resource.
State string
State of the job.
id String
The provider-assigned unique ID for this managed resource.
state String
State of the job.
id string
The provider-assigned unique ID for this managed resource.
state string
State of the job.
id str
The provider-assigned unique ID for this managed resource.
state str
State of the job.
id String
The provider-assigned unique ID for this managed resource.
state String
State of the job.

Look up Existing Job Resource

Get an existing Job 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?: JobState, opts?: CustomResourceOptions): Job
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        app_engine_http_target: Optional[JobAppEngineHttpTargetArgs] = None,
        attempt_deadline: Optional[str] = None,
        description: Optional[str] = None,
        http_target: Optional[JobHttpTargetArgs] = None,
        name: Optional[str] = None,
        paused: Optional[bool] = None,
        project: Optional[str] = None,
        pubsub_target: Optional[JobPubsubTargetArgs] = None,
        region: Optional[str] = None,
        retry_config: Optional[JobRetryConfigArgs] = None,
        schedule: Optional[str] = None,
        state: Optional[str] = None,
        time_zone: Optional[str] = None) -> Job
func GetJob(ctx *Context, name string, id IDInput, state *JobState, opts ...ResourceOption) (*Job, error)
public static Job Get(string name, Input<string> id, JobState? state, CustomResourceOptions? opts = null)
public static Job get(String name, Output<String> id, JobState state, CustomResourceOptions options)
resources:  _:    type: gcp:cloudscheduler:Job    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:
AppEngineHttpTarget JobAppEngineHttpTarget
App Engine HTTP target. If the job providers a App Engine HTTP target the cron will send a request to the service instance Structure is documented below.
AttemptDeadline string
The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The allowed duration for this deadline is:

  • For HTTP targets, between 15 seconds and 30 minutes.
  • For App Engine HTTP targets, between 15 seconds and 24 hours.
  • Note: For PubSub targets, this field is ignored - setting it will introduce an unresolvable diff. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s"
Description string
A human-readable description for the job. This string must not contain more than 500 characters.
HttpTarget JobHttpTarget
HTTP target. If the job providers a http_target the cron will send a request to the targeted url Structure is documented below.
Name Changes to this property will trigger replacement. string
The name of the job.


Paused bool
Sets the job to a paused state. Jobs default to being enabled when this property is not set.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PubsubTarget JobPubsubTarget
Pub/Sub target If the job providers a Pub/Sub target the cron will publish a message to the provided topic Structure is documented below.
Region Changes to this property will trigger replacement. string
Region where the scheduler job resides. If it is not provided, this provider will use the provider default.
RetryConfig JobRetryConfig
By default, if a job does not complete successfully, meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings Structure is documented below.
Schedule string
Describes the schedule on which the job will be executed.
State string
State of the job.
TimeZone string
Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the tz database.
AppEngineHttpTarget JobAppEngineHttpTargetArgs
App Engine HTTP target. If the job providers a App Engine HTTP target the cron will send a request to the service instance Structure is documented below.
AttemptDeadline string
The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The allowed duration for this deadline is:

  • For HTTP targets, between 15 seconds and 30 minutes.
  • For App Engine HTTP targets, between 15 seconds and 24 hours.
  • Note: For PubSub targets, this field is ignored - setting it will introduce an unresolvable diff. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s"
Description string
A human-readable description for the job. This string must not contain more than 500 characters.
HttpTarget JobHttpTargetArgs
HTTP target. If the job providers a http_target the cron will send a request to the targeted url Structure is documented below.
Name Changes to this property will trigger replacement. string
The name of the job.


Paused bool
Sets the job to a paused state. Jobs default to being enabled when this property is not set.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PubsubTarget JobPubsubTargetArgs
Pub/Sub target If the job providers a Pub/Sub target the cron will publish a message to the provided topic Structure is documented below.
Region Changes to this property will trigger replacement. string
Region where the scheduler job resides. If it is not provided, this provider will use the provider default.
RetryConfig JobRetryConfigArgs
By default, if a job does not complete successfully, meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings Structure is documented below.
Schedule string
Describes the schedule on which the job will be executed.
State string
State of the job.
TimeZone string
Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the tz database.
appEngineHttpTarget JobAppEngineHttpTarget
App Engine HTTP target. If the job providers a App Engine HTTP target the cron will send a request to the service instance Structure is documented below.
attemptDeadline String
The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The allowed duration for this deadline is:

  • For HTTP targets, between 15 seconds and 30 minutes.
  • For App Engine HTTP targets, between 15 seconds and 24 hours.
  • Note: For PubSub targets, this field is ignored - setting it will introduce an unresolvable diff. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s"
description String
A human-readable description for the job. This string must not contain more than 500 characters.
httpTarget JobHttpTarget
HTTP target. If the job providers a http_target the cron will send a request to the targeted url Structure is documented below.
name Changes to this property will trigger replacement. String
The name of the job.


paused Boolean
Sets the job to a paused state. Jobs default to being enabled when this property is not set.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pubsubTarget JobPubsubTarget
Pub/Sub target If the job providers a Pub/Sub target the cron will publish a message to the provided topic Structure is documented below.
region Changes to this property will trigger replacement. String
Region where the scheduler job resides. If it is not provided, this provider will use the provider default.
retryConfig JobRetryConfig
By default, if a job does not complete successfully, meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings Structure is documented below.
schedule String
Describes the schedule on which the job will be executed.
state String
State of the job.
timeZone String
Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the tz database.
appEngineHttpTarget JobAppEngineHttpTarget
App Engine HTTP target. If the job providers a App Engine HTTP target the cron will send a request to the service instance Structure is documented below.
attemptDeadline string
The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The allowed duration for this deadline is:

  • For HTTP targets, between 15 seconds and 30 minutes.
  • For App Engine HTTP targets, between 15 seconds and 24 hours.
  • Note: For PubSub targets, this field is ignored - setting it will introduce an unresolvable diff. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s"
description string
A human-readable description for the job. This string must not contain more than 500 characters.
httpTarget JobHttpTarget
HTTP target. If the job providers a http_target the cron will send a request to the targeted url Structure is documented below.
name Changes to this property will trigger replacement. string
The name of the job.


paused boolean
Sets the job to a paused state. Jobs default to being enabled when this property is not set.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pubsubTarget JobPubsubTarget
Pub/Sub target If the job providers a Pub/Sub target the cron will publish a message to the provided topic Structure is documented below.
region Changes to this property will trigger replacement. string
Region where the scheduler job resides. If it is not provided, this provider will use the provider default.
retryConfig JobRetryConfig
By default, if a job does not complete successfully, meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings Structure is documented below.
schedule string
Describes the schedule on which the job will be executed.
state string
State of the job.
timeZone string
Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the tz database.
app_engine_http_target JobAppEngineHttpTargetArgs
App Engine HTTP target. If the job providers a App Engine HTTP target the cron will send a request to the service instance Structure is documented below.
attempt_deadline str
The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The allowed duration for this deadline is:

  • For HTTP targets, between 15 seconds and 30 minutes.
  • For App Engine HTTP targets, between 15 seconds and 24 hours.
  • Note: For PubSub targets, this field is ignored - setting it will introduce an unresolvable diff. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s"
description str
A human-readable description for the job. This string must not contain more than 500 characters.
http_target JobHttpTargetArgs
HTTP target. If the job providers a http_target the cron will send a request to the targeted url Structure is documented below.
name Changes to this property will trigger replacement. str
The name of the job.


paused bool
Sets the job to a paused state. Jobs default to being enabled when this property is not set.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pubsub_target JobPubsubTargetArgs
Pub/Sub target If the job providers a Pub/Sub target the cron will publish a message to the provided topic Structure is documented below.
region Changes to this property will trigger replacement. str
Region where the scheduler job resides. If it is not provided, this provider will use the provider default.
retry_config JobRetryConfigArgs
By default, if a job does not complete successfully, meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings Structure is documented below.
schedule str
Describes the schedule on which the job will be executed.
state str
State of the job.
time_zone str
Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the tz database.
appEngineHttpTarget Property Map
App Engine HTTP target. If the job providers a App Engine HTTP target the cron will send a request to the service instance Structure is documented below.
attemptDeadline String
The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The allowed duration for this deadline is:

  • For HTTP targets, between 15 seconds and 30 minutes.
  • For App Engine HTTP targets, between 15 seconds and 24 hours.
  • Note: For PubSub targets, this field is ignored - setting it will introduce an unresolvable diff. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s"
description String
A human-readable description for the job. This string must not contain more than 500 characters.
httpTarget Property Map
HTTP target. If the job providers a http_target the cron will send a request to the targeted url Structure is documented below.
name Changes to this property will trigger replacement. String
The name of the job.


paused Boolean
Sets the job to a paused state. Jobs default to being enabled when this property is not set.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pubsubTarget Property Map
Pub/Sub target If the job providers a Pub/Sub target the cron will publish a message to the provided topic Structure is documented below.
region Changes to this property will trigger replacement. String
Region where the scheduler job resides. If it is not provided, this provider will use the provider default.
retryConfig Property Map
By default, if a job does not complete successfully, meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings Structure is documented below.
schedule String
Describes the schedule on which the job will be executed.
state String
State of the job.
timeZone String
Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the tz database.

Supporting Types

JobAppEngineHttpTarget
, JobAppEngineHttpTargetArgs

RelativeUri This property is required. string
The relative URI. The relative URL must begin with "/" and must be a valid HTTP relative URL. It can contain a path, query string arguments, and # fragments. If the relative URL is empty, then the root path "/" will be used. No spaces are allowed, and the maximum length allowed is 2083 characters
AppEngineRouting JobAppEngineHttpTargetAppEngineRouting
App Engine Routing setting for the job. Structure is documented below.
Body string
HTTP request body. A request body is allowed only if the HTTP method is POST or PUT. It will result in invalid argument error to set a body on a job with an incompatible HttpMethod. A base64-encoded string.
Headers Dictionary<string, string>
HTTP request headers. This map contains the header field names and values. Headers can be set when the job is created.
HttpMethod string
Which HTTP method to use for the request.
RelativeUri This property is required. string
The relative URI. The relative URL must begin with "/" and must be a valid HTTP relative URL. It can contain a path, query string arguments, and # fragments. If the relative URL is empty, then the root path "/" will be used. No spaces are allowed, and the maximum length allowed is 2083 characters
AppEngineRouting JobAppEngineHttpTargetAppEngineRouting
App Engine Routing setting for the job. Structure is documented below.
Body string
HTTP request body. A request body is allowed only if the HTTP method is POST or PUT. It will result in invalid argument error to set a body on a job with an incompatible HttpMethod. A base64-encoded string.
Headers map[string]string
HTTP request headers. This map contains the header field names and values. Headers can be set when the job is created.
HttpMethod string
Which HTTP method to use for the request.
relativeUri This property is required. String
The relative URI. The relative URL must begin with "/" and must be a valid HTTP relative URL. It can contain a path, query string arguments, and # fragments. If the relative URL is empty, then the root path "/" will be used. No spaces are allowed, and the maximum length allowed is 2083 characters
appEngineRouting JobAppEngineHttpTargetAppEngineRouting
App Engine Routing setting for the job. Structure is documented below.
body String
HTTP request body. A request body is allowed only if the HTTP method is POST or PUT. It will result in invalid argument error to set a body on a job with an incompatible HttpMethod. A base64-encoded string.
headers Map<String,String>
HTTP request headers. This map contains the header field names and values. Headers can be set when the job is created.
httpMethod String
Which HTTP method to use for the request.
relativeUri This property is required. string
The relative URI. The relative URL must begin with "/" and must be a valid HTTP relative URL. It can contain a path, query string arguments, and # fragments. If the relative URL is empty, then the root path "/" will be used. No spaces are allowed, and the maximum length allowed is 2083 characters
appEngineRouting JobAppEngineHttpTargetAppEngineRouting
App Engine Routing setting for the job. Structure is documented below.
body string
HTTP request body. A request body is allowed only if the HTTP method is POST or PUT. It will result in invalid argument error to set a body on a job with an incompatible HttpMethod. A base64-encoded string.
headers {[key: string]: string}
HTTP request headers. This map contains the header field names and values. Headers can be set when the job is created.
httpMethod string
Which HTTP method to use for the request.
relative_uri This property is required. str
The relative URI. The relative URL must begin with "/" and must be a valid HTTP relative URL. It can contain a path, query string arguments, and # fragments. If the relative URL is empty, then the root path "/" will be used. No spaces are allowed, and the maximum length allowed is 2083 characters
app_engine_routing JobAppEngineHttpTargetAppEngineRouting
App Engine Routing setting for the job. Structure is documented below.
body str
HTTP request body. A request body is allowed only if the HTTP method is POST or PUT. It will result in invalid argument error to set a body on a job with an incompatible HttpMethod. A base64-encoded string.
headers Mapping[str, str]
HTTP request headers. This map contains the header field names and values. Headers can be set when the job is created.
http_method str
Which HTTP method to use for the request.
relativeUri This property is required. String
The relative URI. The relative URL must begin with "/" and must be a valid HTTP relative URL. It can contain a path, query string arguments, and # fragments. If the relative URL is empty, then the root path "/" will be used. No spaces are allowed, and the maximum length allowed is 2083 characters
appEngineRouting Property Map
App Engine Routing setting for the job. Structure is documented below.
body String
HTTP request body. A request body is allowed only if the HTTP method is POST or PUT. It will result in invalid argument error to set a body on a job with an incompatible HttpMethod. A base64-encoded string.
headers Map<String>
HTTP request headers. This map contains the header field names and values. Headers can be set when the job is created.
httpMethod String
Which HTTP method to use for the request.

JobAppEngineHttpTargetAppEngineRouting
, JobAppEngineHttpTargetAppEngineRoutingArgs

Instance string
App instance. By default, the job is sent to an instance which is available when the job is attempted.
Service string
App service. By default, the job is sent to the service which is the default service when the job is attempted.
Version string
App version. By default, the job is sent to the version which is the default version when the job is attempted.
Instance string
App instance. By default, the job is sent to an instance which is available when the job is attempted.
Service string
App service. By default, the job is sent to the service which is the default service when the job is attempted.
Version string
App version. By default, the job is sent to the version which is the default version when the job is attempted.
instance String
App instance. By default, the job is sent to an instance which is available when the job is attempted.
service String
App service. By default, the job is sent to the service which is the default service when the job is attempted.
version String
App version. By default, the job is sent to the version which is the default version when the job is attempted.
instance string
App instance. By default, the job is sent to an instance which is available when the job is attempted.
service string
App service. By default, the job is sent to the service which is the default service when the job is attempted.
version string
App version. By default, the job is sent to the version which is the default version when the job is attempted.
instance str
App instance. By default, the job is sent to an instance which is available when the job is attempted.
service str
App service. By default, the job is sent to the service which is the default service when the job is attempted.
version str
App version. By default, the job is sent to the version which is the default version when the job is attempted.
instance String
App instance. By default, the job is sent to an instance which is available when the job is attempted.
service String
App service. By default, the job is sent to the service which is the default service when the job is attempted.
version String
App version. By default, the job is sent to the version which is the default version when the job is attempted.

JobHttpTarget
, JobHttpTargetArgs

Uri This property is required. string
The full URI path that the request will be sent to.
Body string
HTTP request body. A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set body on a job with an incompatible HttpMethod. A base64-encoded string.
Headers Dictionary<string, string>
This map contains the header field names and values. Repeated headers are not supported, but a header value can contain commas.
HttpMethod string
Which HTTP method to use for the request.
OauthToken JobHttpTargetOauthToken
Contains information needed for generating an OAuth token. This type of authorization should be used when sending requests to a GCP endpoint. Structure is documented below.
OidcToken JobHttpTargetOidcToken
Contains information needed for generating an OpenID Connect token. This type of authorization should be used when sending requests to third party endpoints or Cloud Run. Structure is documented below.
Uri This property is required. string
The full URI path that the request will be sent to.
Body string
HTTP request body. A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set body on a job with an incompatible HttpMethod. A base64-encoded string.
Headers map[string]string
This map contains the header field names and values. Repeated headers are not supported, but a header value can contain commas.
HttpMethod string
Which HTTP method to use for the request.
OauthToken JobHttpTargetOauthToken
Contains information needed for generating an OAuth token. This type of authorization should be used when sending requests to a GCP endpoint. Structure is documented below.
OidcToken JobHttpTargetOidcToken
Contains information needed for generating an OpenID Connect token. This type of authorization should be used when sending requests to third party endpoints or Cloud Run. Structure is documented below.
uri This property is required. String
The full URI path that the request will be sent to.
body String
HTTP request body. A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set body on a job with an incompatible HttpMethod. A base64-encoded string.
headers Map<String,String>
This map contains the header field names and values. Repeated headers are not supported, but a header value can contain commas.
httpMethod String
Which HTTP method to use for the request.
oauthToken JobHttpTargetOauthToken
Contains information needed for generating an OAuth token. This type of authorization should be used when sending requests to a GCP endpoint. Structure is documented below.
oidcToken JobHttpTargetOidcToken
Contains information needed for generating an OpenID Connect token. This type of authorization should be used when sending requests to third party endpoints or Cloud Run. Structure is documented below.
uri This property is required. string
The full URI path that the request will be sent to.
body string
HTTP request body. A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set body on a job with an incompatible HttpMethod. A base64-encoded string.
headers {[key: string]: string}
This map contains the header field names and values. Repeated headers are not supported, but a header value can contain commas.
httpMethod string
Which HTTP method to use for the request.
oauthToken JobHttpTargetOauthToken
Contains information needed for generating an OAuth token. This type of authorization should be used when sending requests to a GCP endpoint. Structure is documented below.
oidcToken JobHttpTargetOidcToken
Contains information needed for generating an OpenID Connect token. This type of authorization should be used when sending requests to third party endpoints or Cloud Run. Structure is documented below.
uri This property is required. str
The full URI path that the request will be sent to.
body str
HTTP request body. A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set body on a job with an incompatible HttpMethod. A base64-encoded string.
headers Mapping[str, str]
This map contains the header field names and values. Repeated headers are not supported, but a header value can contain commas.
http_method str
Which HTTP method to use for the request.
oauth_token JobHttpTargetOauthToken
Contains information needed for generating an OAuth token. This type of authorization should be used when sending requests to a GCP endpoint. Structure is documented below.
oidc_token JobHttpTargetOidcToken
Contains information needed for generating an OpenID Connect token. This type of authorization should be used when sending requests to third party endpoints or Cloud Run. Structure is documented below.
uri This property is required. String
The full URI path that the request will be sent to.
body String
HTTP request body. A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set body on a job with an incompatible HttpMethod. A base64-encoded string.
headers Map<String>
This map contains the header field names and values. Repeated headers are not supported, but a header value can contain commas.
httpMethod String
Which HTTP method to use for the request.
oauthToken Property Map
Contains information needed for generating an OAuth token. This type of authorization should be used when sending requests to a GCP endpoint. Structure is documented below.
oidcToken Property Map
Contains information needed for generating an OpenID Connect token. This type of authorization should be used when sending requests to third party endpoints or Cloud Run. Structure is documented below.

JobHttpTargetOauthToken
, JobHttpTargetOauthTokenArgs

ServiceAccountEmail This property is required. string
Service account email to be used for generating OAuth token. The service account must be within the same project as the job.
Scope string
OAuth scope to be used for generating OAuth access token. If not specified, "https://www.googleapis.com/auth/cloud-platform" will be used.
ServiceAccountEmail This property is required. string
Service account email to be used for generating OAuth token. The service account must be within the same project as the job.
Scope string
OAuth scope to be used for generating OAuth access token. If not specified, "https://www.googleapis.com/auth/cloud-platform" will be used.
serviceAccountEmail This property is required. String
Service account email to be used for generating OAuth token. The service account must be within the same project as the job.
scope String
OAuth scope to be used for generating OAuth access token. If not specified, "https://www.googleapis.com/auth/cloud-platform" will be used.
serviceAccountEmail This property is required. string
Service account email to be used for generating OAuth token. The service account must be within the same project as the job.
scope string
OAuth scope to be used for generating OAuth access token. If not specified, "https://www.googleapis.com/auth/cloud-platform" will be used.
service_account_email This property is required. str
Service account email to be used for generating OAuth token. The service account must be within the same project as the job.
scope str
OAuth scope to be used for generating OAuth access token. If not specified, "https://www.googleapis.com/auth/cloud-platform" will be used.
serviceAccountEmail This property is required. String
Service account email to be used for generating OAuth token. The service account must be within the same project as the job.
scope String
OAuth scope to be used for generating OAuth access token. If not specified, "https://www.googleapis.com/auth/cloud-platform" will be used.

JobHttpTargetOidcToken
, JobHttpTargetOidcTokenArgs

ServiceAccountEmail This property is required. string
Service account email to be used for generating OAuth token. The service account must be within the same project as the job.
Audience string
Audience to be used when generating OIDC token. If not specified, the URI specified in target will be used.
ServiceAccountEmail This property is required. string
Service account email to be used for generating OAuth token. The service account must be within the same project as the job.
Audience string
Audience to be used when generating OIDC token. If not specified, the URI specified in target will be used.
serviceAccountEmail This property is required. String
Service account email to be used for generating OAuth token. The service account must be within the same project as the job.
audience String
Audience to be used when generating OIDC token. If not specified, the URI specified in target will be used.
serviceAccountEmail This property is required. string
Service account email to be used for generating OAuth token. The service account must be within the same project as the job.
audience string
Audience to be used when generating OIDC token. If not specified, the URI specified in target will be used.
service_account_email This property is required. str
Service account email to be used for generating OAuth token. The service account must be within the same project as the job.
audience str
Audience to be used when generating OIDC token. If not specified, the URI specified in target will be used.
serviceAccountEmail This property is required. String
Service account email to be used for generating OAuth token. The service account must be within the same project as the job.
audience String
Audience to be used when generating OIDC token. If not specified, the URI specified in target will be used.

JobPubsubTarget
, JobPubsubTargetArgs

TopicName This property is required. string
The full resource name for the Cloud Pub/Sub topic to which messages will be published when a job is delivered. ~>NOTE: The topic name must be in the same format as required by PubSub's PublishRequest.name, e.g. projects/my-project/topics/my-topic.
Attributes Dictionary<string, string>
Attributes for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute.
Data string
The message payload for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute. A base64-encoded string.
TopicName This property is required. string
The full resource name for the Cloud Pub/Sub topic to which messages will be published when a job is delivered. ~>NOTE: The topic name must be in the same format as required by PubSub's PublishRequest.name, e.g. projects/my-project/topics/my-topic.
Attributes map[string]string
Attributes for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute.
Data string
The message payload for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute. A base64-encoded string.
topicName This property is required. String
The full resource name for the Cloud Pub/Sub topic to which messages will be published when a job is delivered. ~>NOTE: The topic name must be in the same format as required by PubSub's PublishRequest.name, e.g. projects/my-project/topics/my-topic.
attributes Map<String,String>
Attributes for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute.
data String
The message payload for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute. A base64-encoded string.
topicName This property is required. string
The full resource name for the Cloud Pub/Sub topic to which messages will be published when a job is delivered. ~>NOTE: The topic name must be in the same format as required by PubSub's PublishRequest.name, e.g. projects/my-project/topics/my-topic.
attributes {[key: string]: string}
Attributes for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute.
data string
The message payload for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute. A base64-encoded string.
topic_name This property is required. str
The full resource name for the Cloud Pub/Sub topic to which messages will be published when a job is delivered. ~>NOTE: The topic name must be in the same format as required by PubSub's PublishRequest.name, e.g. projects/my-project/topics/my-topic.
attributes Mapping[str, str]
Attributes for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute.
data str
The message payload for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute. A base64-encoded string.
topicName This property is required. String
The full resource name for the Cloud Pub/Sub topic to which messages will be published when a job is delivered. ~>NOTE: The topic name must be in the same format as required by PubSub's PublishRequest.name, e.g. projects/my-project/topics/my-topic.
attributes Map<String>
Attributes for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute.
data String
The message payload for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute. A base64-encoded string.

JobRetryConfig
, JobRetryConfigArgs

MaxBackoffDuration string
The maximum amount of time to wait before retrying a job after it fails. A duration in seconds with up to nine fractional digits, terminated by 's'.
MaxDoublings int
The time between retries will double maxDoublings times. A job's retry interval starts at minBackoffDuration, then doubles maxDoublings times, then increases linearly, and finally retries retries at intervals of maxBackoffDuration up to retryCount times.
MaxRetryDuration string
The time limit for retrying a failed job, measured from time when an execution was first attempted. If specified with retryCount, the job will be retried until both limits are reached. A duration in seconds with up to nine fractional digits, terminated by 's'.
MinBackoffDuration string
The minimum amount of time to wait before retrying a job after it fails. A duration in seconds with up to nine fractional digits, terminated by 's'.
RetryCount int
The number of attempts that the system will make to run a job using the exponential backoff procedure described by maxDoublings. Values greater than 5 and negative values are not allowed.
MaxBackoffDuration string
The maximum amount of time to wait before retrying a job after it fails. A duration in seconds with up to nine fractional digits, terminated by 's'.
MaxDoublings int
The time between retries will double maxDoublings times. A job's retry interval starts at minBackoffDuration, then doubles maxDoublings times, then increases linearly, and finally retries retries at intervals of maxBackoffDuration up to retryCount times.
MaxRetryDuration string
The time limit for retrying a failed job, measured from time when an execution was first attempted. If specified with retryCount, the job will be retried until both limits are reached. A duration in seconds with up to nine fractional digits, terminated by 's'.
MinBackoffDuration string
The minimum amount of time to wait before retrying a job after it fails. A duration in seconds with up to nine fractional digits, terminated by 's'.
RetryCount int
The number of attempts that the system will make to run a job using the exponential backoff procedure described by maxDoublings. Values greater than 5 and negative values are not allowed.
maxBackoffDuration String
The maximum amount of time to wait before retrying a job after it fails. A duration in seconds with up to nine fractional digits, terminated by 's'.
maxDoublings Integer
The time between retries will double maxDoublings times. A job's retry interval starts at minBackoffDuration, then doubles maxDoublings times, then increases linearly, and finally retries retries at intervals of maxBackoffDuration up to retryCount times.
maxRetryDuration String
The time limit for retrying a failed job, measured from time when an execution was first attempted. If specified with retryCount, the job will be retried until both limits are reached. A duration in seconds with up to nine fractional digits, terminated by 's'.
minBackoffDuration String
The minimum amount of time to wait before retrying a job after it fails. A duration in seconds with up to nine fractional digits, terminated by 's'.
retryCount Integer
The number of attempts that the system will make to run a job using the exponential backoff procedure described by maxDoublings. Values greater than 5 and negative values are not allowed.
maxBackoffDuration string
The maximum amount of time to wait before retrying a job after it fails. A duration in seconds with up to nine fractional digits, terminated by 's'.
maxDoublings number
The time between retries will double maxDoublings times. A job's retry interval starts at minBackoffDuration, then doubles maxDoublings times, then increases linearly, and finally retries retries at intervals of maxBackoffDuration up to retryCount times.
maxRetryDuration string
The time limit for retrying a failed job, measured from time when an execution was first attempted. If specified with retryCount, the job will be retried until both limits are reached. A duration in seconds with up to nine fractional digits, terminated by 's'.
minBackoffDuration string
The minimum amount of time to wait before retrying a job after it fails. A duration in seconds with up to nine fractional digits, terminated by 's'.
retryCount number
The number of attempts that the system will make to run a job using the exponential backoff procedure described by maxDoublings. Values greater than 5 and negative values are not allowed.
max_backoff_duration str
The maximum amount of time to wait before retrying a job after it fails. A duration in seconds with up to nine fractional digits, terminated by 's'.
max_doublings int
The time between retries will double maxDoublings times. A job's retry interval starts at minBackoffDuration, then doubles maxDoublings times, then increases linearly, and finally retries retries at intervals of maxBackoffDuration up to retryCount times.
max_retry_duration str
The time limit for retrying a failed job, measured from time when an execution was first attempted. If specified with retryCount, the job will be retried until both limits are reached. A duration in seconds with up to nine fractional digits, terminated by 's'.
min_backoff_duration str
The minimum amount of time to wait before retrying a job after it fails. A duration in seconds with up to nine fractional digits, terminated by 's'.
retry_count int
The number of attempts that the system will make to run a job using the exponential backoff procedure described by maxDoublings. Values greater than 5 and negative values are not allowed.
maxBackoffDuration String
The maximum amount of time to wait before retrying a job after it fails. A duration in seconds with up to nine fractional digits, terminated by 's'.
maxDoublings Number
The time between retries will double maxDoublings times. A job's retry interval starts at minBackoffDuration, then doubles maxDoublings times, then increases linearly, and finally retries retries at intervals of maxBackoffDuration up to retryCount times.
maxRetryDuration String
The time limit for retrying a failed job, measured from time when an execution was first attempted. If specified with retryCount, the job will be retried until both limits are reached. A duration in seconds with up to nine fractional digits, terminated by 's'.
minBackoffDuration String
The minimum amount of time to wait before retrying a job after it fails. A duration in seconds with up to nine fractional digits, terminated by 's'.
retryCount Number
The number of attempts that the system will make to run a job using the exponential backoff procedure described by maxDoublings. Values greater than 5 and negative values are not allowed.

Import

Job can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{region}}/jobs/{{name}}

  • {{project}}/{{region}}/{{name}}

  • {{region}}/{{name}}

  • {{name}}

When using the pulumi import command, Job can be imported using one of the formats above. For example:

$ pulumi import gcp:cloudscheduler/job:Job default projects/{{project}}/locations/{{region}}/jobs/{{name}}
Copy
$ pulumi import gcp:cloudscheduler/job:Job default {{project}}/{{region}}/{{name}}
Copy
$ pulumi import gcp:cloudscheduler/job:Job default {{region}}/{{name}}
Copy
$ pulumi import gcp:cloudscheduler/job:Job default {{name}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.