import * as pulumi from "@pulumi/pulumi"; /** * The `scaleway.Container` resource allows you to create and manage [Serverless Containers](https://www.scaleway.com/en/docs/serverless/containers/). * * Refer to the Serverless Containers [product documentation](https://www.scaleway.com/en/docs/serverless/containers/) and [API documentation](https://www.scaleway.com/en/developers/api/serverless-containers/) for more information. * * For more information on the limitations of Serverless Containers, refer to the [dedicated documentation](https://www.scaleway.com/en/docs/compute/containers/reference-content/containers-limitations/). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@ediri/scaleway"; * * const mainContainerNamespace = new scaleway.ContainerNamespace("mainContainerNamespace", {description: "test container"}); * const mainContainer = new scaleway.Container("mainContainer", { * description: "environment variables test", * namespaceId: mainContainerNamespace.id, * registryImage: pulumi.interpolate`${mainContainerNamespace.registryEndpoint}/alpine:test`, * port: 9997, * cpuLimit: 140, * memoryLimit: 256, * minScale: 3, * maxScale: 5, * timeout: 600, * maxConcurrency: 80, * privacy: "private", * protocol: "http1", * deploy: true, * environmentVariables: { * foo: "var", * }, * secretEnvironmentVariables: { * key: "secret", * }, * }); * ``` * * ## Protocols * * The following protocols are supported: * * * `h2c`: HTTP/2 over TCP. * * `http1`: Hypertext Transfer Protocol. * * > **Important:** Refer to the official [Apache documentation](https://httpd.apache.org/docs/2.4/howto/http2.html) for more information. * * ## Privacy * * By default, creating a container will make it `public`, meaning that anybody knowing the endpoint can execute it. * * A container can be made `private` with the privacy parameter. * * Refer to the [technical information](https://www.scaleway.com/en/developers/api/serverless-containers/#protocol-9dd4c8) for more information on container authentication. * * ## Memory and vCPUs configuration * * The vCPU represents a portion of the underlying, physical CPU that is assigned to a particular virtual machine (VM). * * You can determine the computing resources to allocate to each container. * * The `memoryLimit` (in MB) must correspond with the right amount of vCPU. Refer to the table below to determine the right memory/vCPU combination. * * | Memory (in MB) | vCPU | * |----------------|------| * | 128 | 70m | * | 256 | 140m | * | 512 | 280m | * | 1024 | 560m | * | 2048 | 1120 | * | 3072 | 1680 | * | 4096 | 2240 | * * ~>**Important:** Make sure to select the right resources, as you will be billed based on compute usage over time and the number of Containers executions. * Refer to the [Serverless Containers pricing](https://www.scaleway.com/en/docs/faq/serverless-containers/#prices) for more information. * * ## Import * * Containers can be imported using, `{region}/{id}`, as shown below: * * bash * * ```sh * $ pulumi import scaleway:index/container:Container main fr-par/11111111-1111-1111-1111-111111111111 * ``` */ export declare class Container extends pulumi.CustomResource { /** * Get an existing Container resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: ContainerState, opts?: pulumi.CustomResourceOptions): Container; /** * Returns true if the given object is an instance of Container. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Container; /** * The amount of vCPU computing resources to allocate to each container. */ readonly cpuLimit: pulumi.Output; /** * The cron status of the container. */ readonly cronStatus: pulumi.Output; /** * Boolean indicating whether the container is in a production environment. * * Note that if you want to use your own configuration, you must consult our configuration [restrictions](https://www.scaleway.com/en/docs/compute/containers/reference-content/containers-limitations/#configuration-restrictions) section. */ readonly deploy: pulumi.Output; /** * The description of the container. */ readonly description: pulumi.Output; /** * The native domain name of the container */ readonly domainName: pulumi.Output; /** * The [environment variables](https://www.scaleway.com/en/docs/compute/containers/concepts/#environment-variables) of the container. */ readonly environmentVariables: pulumi.Output<{ [key: string]: string; }>; /** * The error message of the container. */ readonly errorMessage: pulumi.Output; /** * Allows both HTTP and HTTPS (`enabled`) or redirect HTTP to HTTPS (`redirected`). Defaults to `enabled`. */ readonly httpOption: pulumi.Output; /** * The maximum number of simultaneous requests your container can handle at the same time. */ readonly maxConcurrency: pulumi.Output; /** * The maximum number of instances this container can scale to. */ readonly maxScale: pulumi.Output; /** * The memory resources in MB to allocate to each container. */ readonly memoryLimit: pulumi.Output; /** * The minimum number of container instances running continuously. */ readonly minScale: pulumi.Output; /** * The unique name of the container name. */ readonly name: pulumi.Output; /** * The Containers namespace ID of the container. * * > **Important** Updating the `name` argument will recreate the container. */ readonly namespaceId: pulumi.Output; /** * The port to expose the container. */ readonly port: pulumi.Output; /** * The privacy type defines the way to authenticate to your container. Please check our dedicated [section](https://www.scaleway.com/en/developers/api/serverless-containers/#protocol-9dd4c8). */ readonly privacy: pulumi.Output; /** * The communication [protocol](https://www.scaleway.com/en/developers/api/serverless-containers/#path-containers-update-an-existing-container) `http1` or `h2c`. Defaults to `http1`. */ readonly protocol: pulumi.Output; /** * (Defaults to provider `region`) The region in which the container was created. */ readonly region: pulumi.Output; /** * The registry image address (e.g., `rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE`) */ readonly registryImage: pulumi.Output; /** * The sha256 of your source registry image, changing it will re-apply the deployment. Can be any string. */ readonly registrySha256: pulumi.Output; /** * Execution environment of the container. */ readonly sandbox: pulumi.Output; /** * The [secret environment variables](https://www.scaleway.com/en/docs/compute/containers/concepts/#secrets) of the container. */ readonly secretEnvironmentVariables: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The container status. */ readonly status: pulumi.Output; /** * The maximum amount of time your container can spend processing a request before being stopped. */ readonly timeout: pulumi.Output; /** * Create a Container resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ContainerArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Container resources. */ export interface ContainerState { /** * The amount of vCPU computing resources to allocate to each container. */ cpuLimit?: pulumi.Input; /** * The cron status of the container. */ cronStatus?: pulumi.Input; /** * Boolean indicating whether the container is in a production environment. * * Note that if you want to use your own configuration, you must consult our configuration [restrictions](https://www.scaleway.com/en/docs/compute/containers/reference-content/containers-limitations/#configuration-restrictions) section. */ deploy?: pulumi.Input; /** * The description of the container. */ description?: pulumi.Input; /** * The native domain name of the container */ domainName?: pulumi.Input; /** * The [environment variables](https://www.scaleway.com/en/docs/compute/containers/concepts/#environment-variables) of the container. */ environmentVariables?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The error message of the container. */ errorMessage?: pulumi.Input; /** * Allows both HTTP and HTTPS (`enabled`) or redirect HTTP to HTTPS (`redirected`). Defaults to `enabled`. */ httpOption?: pulumi.Input; /** * The maximum number of simultaneous requests your container can handle at the same time. */ maxConcurrency?: pulumi.Input; /** * The maximum number of instances this container can scale to. */ maxScale?: pulumi.Input; /** * The memory resources in MB to allocate to each container. */ memoryLimit?: pulumi.Input; /** * The minimum number of container instances running continuously. */ minScale?: pulumi.Input; /** * The unique name of the container name. */ name?: pulumi.Input; /** * The Containers namespace ID of the container. * * > **Important** Updating the `name` argument will recreate the container. */ namespaceId?: pulumi.Input; /** * The port to expose the container. */ port?: pulumi.Input; /** * The privacy type defines the way to authenticate to your container. Please check our dedicated [section](https://www.scaleway.com/en/developers/api/serverless-containers/#protocol-9dd4c8). */ privacy?: pulumi.Input; /** * The communication [protocol](https://www.scaleway.com/en/developers/api/serverless-containers/#path-containers-update-an-existing-container) `http1` or `h2c`. Defaults to `http1`. */ protocol?: pulumi.Input; /** * (Defaults to provider `region`) The region in which the container was created. */ region?: pulumi.Input; /** * The registry image address (e.g., `rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE`) */ registryImage?: pulumi.Input; /** * The sha256 of your source registry image, changing it will re-apply the deployment. Can be any string. */ registrySha256?: pulumi.Input; /** * Execution environment of the container. */ sandbox?: pulumi.Input; /** * The [secret environment variables](https://www.scaleway.com/en/docs/compute/containers/concepts/#secrets) of the container. */ secretEnvironmentVariables?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The container status. */ status?: pulumi.Input; /** * The maximum amount of time your container can spend processing a request before being stopped. */ timeout?: pulumi.Input; } /** * The set of arguments for constructing a Container resource. */ export interface ContainerArgs { /** * The amount of vCPU computing resources to allocate to each container. */ cpuLimit?: pulumi.Input; /** * Boolean indicating whether the container is in a production environment. * * Note that if you want to use your own configuration, you must consult our configuration [restrictions](https://www.scaleway.com/en/docs/compute/containers/reference-content/containers-limitations/#configuration-restrictions) section. */ deploy?: pulumi.Input; /** * The description of the container. */ description?: pulumi.Input; /** * The [environment variables](https://www.scaleway.com/en/docs/compute/containers/concepts/#environment-variables) of the container. */ environmentVariables?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Allows both HTTP and HTTPS (`enabled`) or redirect HTTP to HTTPS (`redirected`). Defaults to `enabled`. */ httpOption?: pulumi.Input; /** * The maximum number of simultaneous requests your container can handle at the same time. */ maxConcurrency?: pulumi.Input; /** * The maximum number of instances this container can scale to. */ maxScale?: pulumi.Input; /** * The memory resources in MB to allocate to each container. */ memoryLimit?: pulumi.Input; /** * The minimum number of container instances running continuously. */ minScale?: pulumi.Input; /** * The unique name of the container name. */ name?: pulumi.Input; /** * The Containers namespace ID of the container. * * > **Important** Updating the `name` argument will recreate the container. */ namespaceId: pulumi.Input; /** * The port to expose the container. */ port?: pulumi.Input; /** * The privacy type defines the way to authenticate to your container. Please check our dedicated [section](https://www.scaleway.com/en/developers/api/serverless-containers/#protocol-9dd4c8). */ privacy?: pulumi.Input; /** * The communication [protocol](https://www.scaleway.com/en/developers/api/serverless-containers/#path-containers-update-an-existing-container) `http1` or `h2c`. Defaults to `http1`. */ protocol?: pulumi.Input; /** * (Defaults to provider `region`) The region in which the container was created. */ region?: pulumi.Input; /** * The registry image address (e.g., `rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE`) */ registryImage?: pulumi.Input; /** * The sha256 of your source registry image, changing it will re-apply the deployment. Can be any string. */ registrySha256?: pulumi.Input; /** * Execution environment of the container. */ sandbox?: pulumi.Input; /** * The [secret environment variables](https://www.scaleway.com/en/docs/compute/containers/concepts/#secrets) of the container. */ secretEnvironmentVariables?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The container status. */ status?: pulumi.Input; /** * The maximum amount of time your container can spend processing a request before being stopped. */ timeout?: pulumi.Input; }