1. Packages
  2. Scaleway
  3. API Docs
  4. ContainerCron
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

scaleway.ContainerCron

Explore with Pulumi AI

Deprecated: scaleway.index/containercron.ContainerCron has been deprecated in favor of scaleway.containers/cron.Cron

The scaleway.containers.Cron resource allows you to create and manage CRON triggers for Scaleway Serverless Containers.

Refer to the Containers CRON triggers documentation and API documentation for more information.

Example Usage

The following command allows you to add a CRON trigger to a Serverless Container.

import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";

const main = new scaleway.containers.Namespace("main", {});
const mainContainer = new scaleway.containers.Container("main", {
    name: "my-container-with-cron-tf",
    namespaceId: main.id,
});
const mainCron = new scaleway.containers.Cron("main", {
    containerId: mainContainer.id,
    name: "my-cron-name",
    schedule: "5 4 1 * *",
    args: JSON.stringify({
        address: {
            city: "Paris",
            country: "FR",
        },
        age: 23,
        firstName: "John",
        isAlive: true,
        lastName: "Smith",
    }),
});
Copy
import pulumi
import json
import pulumiverse_scaleway as scaleway

main = scaleway.containers.Namespace("main")
main_container = scaleway.containers.Container("main",
    name="my-container-with-cron-tf",
    namespace_id=main.id)
main_cron = scaleway.containers.Cron("main",
    container_id=main_container.id,
    name="my-cron-name",
    schedule="5 4 1 * *",
    args=json.dumps({
        "address": {
            "city": "Paris",
            "country": "FR",
        },
        "age": 23,
        "firstName": "John",
        "isAlive": True,
        "lastName": "Smith",
    }))
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/containers"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		main, err := containers.NewNamespace(ctx, "main", nil)
		if err != nil {
			return err
		}
		mainContainer, err := containers.NewContainer(ctx, "main", &containers.ContainerArgs{
			Name:        pulumi.String("my-container-with-cron-tf"),
			NamespaceId: main.ID(),
		})
		if err != nil {
			return err
		}
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"address": map[string]interface{}{
				"city":    "Paris",
				"country": "FR",
			},
			"age":       23,
			"firstName": "John",
			"isAlive":   true,
			"lastName":  "Smith",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = containers.NewCron(ctx, "main", &containers.CronArgs{
			ContainerId: mainContainer.ID(),
			Name:        pulumi.String("my-cron-name"),
			Schedule:    pulumi.String("5 4 1 * *"),
			Args:        pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;

return await Deployment.RunAsync(() => 
{
    var main = new Scaleway.Containers.Namespace("main");

    var mainContainer = new Scaleway.Containers.Container("main", new()
    {
        Name = "my-container-with-cron-tf",
        NamespaceId = main.Id,
    });

    var mainCron = new Scaleway.Containers.Cron("main", new()
    {
        ContainerId = mainContainer.Id,
        Name = "my-cron-name",
        Schedule = "5 4 1 * *",
        Args = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["address"] = new Dictionary<string, object?>
            {
                ["city"] = "Paris",
                ["country"] = "FR",
            },
            ["age"] = 23,
            ["firstName"] = "John",
            ["isAlive"] = true,
            ["lastName"] = "Smith",
        }),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.containers.Namespace;
import com.pulumi.scaleway.containers.Container;
import com.pulumi.scaleway.containers.ContainerArgs;
import com.pulumi.scaleway.containers.Cron;
import com.pulumi.scaleway.containers.CronArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 main = new Namespace("main");

        var mainContainer = new Container("mainContainer", ContainerArgs.builder()
            .name("my-container-with-cron-tf")
            .namespaceId(main.id())
            .build());

        var mainCron = new Cron("mainCron", CronArgs.builder()
            .containerId(mainContainer.id())
            .name("my-cron-name")
            .schedule("5 4 1 * *")
            .args(serializeJson(
                jsonObject(
                    jsonProperty("address", jsonObject(
                        jsonProperty("city", "Paris"),
                        jsonProperty("country", "FR")
                    )),
                    jsonProperty("age", 23),
                    jsonProperty("firstName", "John"),
                    jsonProperty("isAlive", true),
                    jsonProperty("lastName", "Smith")
                )))
            .build());

    }
}
Copy
resources:
  main:
    type: scaleway:containers:Namespace
  mainContainer:
    type: scaleway:containers:Container
    name: main
    properties:
      name: my-container-with-cron-tf
      namespaceId: ${main.id}
  mainCron:
    type: scaleway:containers:Cron
    name: main
    properties:
      containerId: ${mainContainer.id}
      name: my-cron-name
      schedule: 5 4 1 * *
      args:
        fn::toJSON:
          address:
            city: Paris
            country: FR
          age: 23
          firstName: John
          isAlive: true
          lastName: Smith
Copy

Create ContainerCron Resource

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

Constructor syntax

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

@overload
def ContainerCron(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  args: Optional[str] = None,
                  container_id: Optional[str] = None,
                  name: Optional[str] = None,
                  region: Optional[str] = None,
                  schedule: Optional[str] = None)
func NewContainerCron(ctx *Context, name string, args ContainerCronArgs, opts ...ResourceOption) (*ContainerCron, error)
public ContainerCron(string name, ContainerCronArgs args, CustomResourceOptions? opts = null)
public ContainerCron(String name, ContainerCronArgs args)
public ContainerCron(String name, ContainerCronArgs args, CustomResourceOptions options)
type: scaleway:ContainerCron
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ContainerCronArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ContainerCronArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ContainerCronArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ContainerCronArgs
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. ContainerCronArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

Args This property is required. string
The key-value mapping to define arguments that will be passed to your container’s event object
ContainerId This property is required. string
The unique identifier of the container to link to your CRON trigger.
Schedule This property is required. string
CRON format string (refer to the CRON schedule reference for more information).
Name string
The name of the container CRON trigger. If not provided, a random name is generated.
Region Changes to this property will trigger replacement. string
(Defaults to provider region) The region in which the CRON trigger is created.
Args This property is required. string
The key-value mapping to define arguments that will be passed to your container’s event object
ContainerId This property is required. string
The unique identifier of the container to link to your CRON trigger.
Schedule This property is required. string
CRON format string (refer to the CRON schedule reference for more information).
Name string
The name of the container CRON trigger. If not provided, a random name is generated.
Region Changes to this property will trigger replacement. string
(Defaults to provider region) The region in which the CRON trigger is created.
args This property is required. String
The key-value mapping to define arguments that will be passed to your container’s event object
containerId This property is required. String
The unique identifier of the container to link to your CRON trigger.
schedule This property is required. String
CRON format string (refer to the CRON schedule reference for more information).
name String
The name of the container CRON trigger. If not provided, a random name is generated.
region Changes to this property will trigger replacement. String
(Defaults to provider region) The region in which the CRON trigger is created.
args This property is required. string
The key-value mapping to define arguments that will be passed to your container’s event object
containerId This property is required. string
The unique identifier of the container to link to your CRON trigger.
schedule This property is required. string
CRON format string (refer to the CRON schedule reference for more information).
name string
The name of the container CRON trigger. If not provided, a random name is generated.
region Changes to this property will trigger replacement. string
(Defaults to provider region) The region in which the CRON trigger is created.
args This property is required. str
The key-value mapping to define arguments that will be passed to your container’s event object
container_id This property is required. str
The unique identifier of the container to link to your CRON trigger.
schedule This property is required. str
CRON format string (refer to the CRON schedule reference for more information).
name str
The name of the container CRON trigger. If not provided, a random name is generated.
region Changes to this property will trigger replacement. str
(Defaults to provider region) The region in which the CRON trigger is created.
args This property is required. String
The key-value mapping to define arguments that will be passed to your container’s event object
containerId This property is required. String
The unique identifier of the container to link to your CRON trigger.
schedule This property is required. String
CRON format string (refer to the CRON schedule reference for more information).
name String
The name of the container CRON trigger. If not provided, a random name is generated.
region Changes to this property will trigger replacement. String
(Defaults to provider region) The region in which the CRON trigger is created.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Status string
The CRON status.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The CRON status.
id String
The provider-assigned unique ID for this managed resource.
status String
The CRON status.
id string
The provider-assigned unique ID for this managed resource.
status string
The CRON status.
id str
The provider-assigned unique ID for this managed resource.
status str
The CRON status.
id String
The provider-assigned unique ID for this managed resource.
status String
The CRON status.

Look up Existing ContainerCron Resource

Get an existing ContainerCron 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?: ContainerCronState, opts?: CustomResourceOptions): ContainerCron
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        args: Optional[str] = None,
        container_id: Optional[str] = None,
        name: Optional[str] = None,
        region: Optional[str] = None,
        schedule: Optional[str] = None,
        status: Optional[str] = None) -> ContainerCron
func GetContainerCron(ctx *Context, name string, id IDInput, state *ContainerCronState, opts ...ResourceOption) (*ContainerCron, error)
public static ContainerCron Get(string name, Input<string> id, ContainerCronState? state, CustomResourceOptions? opts = null)
public static ContainerCron get(String name, Output<String> id, ContainerCronState state, CustomResourceOptions options)
resources:  _:    type: scaleway:ContainerCron    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:
Args string
The key-value mapping to define arguments that will be passed to your container’s event object
ContainerId string
The unique identifier of the container to link to your CRON trigger.
Name string
The name of the container CRON trigger. If not provided, a random name is generated.
Region Changes to this property will trigger replacement. string
(Defaults to provider region) The region in which the CRON trigger is created.
Schedule string
CRON format string (refer to the CRON schedule reference for more information).
Status string
The CRON status.
Args string
The key-value mapping to define arguments that will be passed to your container’s event object
ContainerId string
The unique identifier of the container to link to your CRON trigger.
Name string
The name of the container CRON trigger. If not provided, a random name is generated.
Region Changes to this property will trigger replacement. string
(Defaults to provider region) The region in which the CRON trigger is created.
Schedule string
CRON format string (refer to the CRON schedule reference for more information).
Status string
The CRON status.
args String
The key-value mapping to define arguments that will be passed to your container’s event object
containerId String
The unique identifier of the container to link to your CRON trigger.
name String
The name of the container CRON trigger. If not provided, a random name is generated.
region Changes to this property will trigger replacement. String
(Defaults to provider region) The region in which the CRON trigger is created.
schedule String
CRON format string (refer to the CRON schedule reference for more information).
status String
The CRON status.
args string
The key-value mapping to define arguments that will be passed to your container’s event object
containerId string
The unique identifier of the container to link to your CRON trigger.
name string
The name of the container CRON trigger. If not provided, a random name is generated.
region Changes to this property will trigger replacement. string
(Defaults to provider region) The region in which the CRON trigger is created.
schedule string
CRON format string (refer to the CRON schedule reference for more information).
status string
The CRON status.
args str
The key-value mapping to define arguments that will be passed to your container’s event object
container_id str
The unique identifier of the container to link to your CRON trigger.
name str
The name of the container CRON trigger. If not provided, a random name is generated.
region Changes to this property will trigger replacement. str
(Defaults to provider region) The region in which the CRON trigger is created.
schedule str
CRON format string (refer to the CRON schedule reference for more information).
status str
The CRON status.
args String
The key-value mapping to define arguments that will be passed to your container’s event object
containerId String
The unique identifier of the container to link to your CRON trigger.
name String
The name of the container CRON trigger. If not provided, a random name is generated.
region Changes to this property will trigger replacement. String
(Defaults to provider region) The region in which the CRON trigger is created.
schedule String
CRON format string (refer to the CRON schedule reference for more information).
status String
The CRON status.

Import

Container Cron can be imported using {region}/{id}, as shown below:

bash

$ pulumi import scaleway:index/containerCron:ContainerCron main fr-par/11111111-1111-1111-1111-111111111111
Copy

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

Package Details

Repository
scaleway pulumiverse/pulumi-scaleway
License
Apache-2.0
Notes
This Pulumi package is based on the scaleway Terraform Provider.