@lbrlabs/pulumi-scaleway
Version:
A Pulumi package for creating and managing scaleway cloud resources.
324 lines (323 loc) • 12.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Creates and manages Scaleway Functions.
* For more information see [the documentation](https://developers.scaleway.com/en/products/functions/api/).
*
* ## Examples
*
* ### Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@lbrlabs/pulumi-scaleway";
*
* const mainFunctionNamespace = new scaleway.FunctionNamespace("mainFunctionNamespace", {description: "Main function namespace"});
* const mainFunction = new scaleway.Function("mainFunction", {
* namespaceId: mainFunctionNamespace.id,
* runtime: "go118",
* handler: "Handle",
* privacy: "private",
* });
* ```
*
* ## Import
*
* Functions can be imported using the `{region}/{id}`, e.g. bash
*
* ```sh
* $ pulumi import scaleway:index/function:Function main fr-par/11111111-1111-1111-1111-111111111111
* ```
*/
export declare class Function extends pulumi.CustomResource {
/**
* Get an existing Function 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<pulumi.ID>, state?: FunctionState, opts?: pulumi.CustomResourceOptions): Function;
/**
* Returns true if the given object is an instance of Function. 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 Function;
/**
* The CPU limit in mCPU for your function. More infos on resources [here](https://developers.scaleway.com/en/products/functions/api/#functions)
*/
readonly cpuLimit: pulumi.Output<number>;
/**
* Define if the function should be deployed, terraform will wait for function to be deployed
*/
readonly deploy: pulumi.Output<boolean | undefined>;
/**
* The description of the function.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The native domain name of the function
*/
readonly domainName: pulumi.Output<string>;
/**
* The environment variables of the function.
*/
readonly environmentVariables: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Handler of the function. Depends on the runtime ([function guide](https://developers.scaleway.com/en/products/functions/api/#create-a-function))
*/
readonly handler: pulumi.Output<string>;
/**
* HTTP traffic configuration
*/
readonly httpOption: pulumi.Output<string | undefined>;
/**
* Maximum replicas for your function (defaults to 20), our system will scale your functions automatically based on incoming workload, but will never scale the number of replicas above the configured max_scale.
*/
readonly maxScale: pulumi.Output<number | undefined>;
/**
* Memory limit in MB for your function, defaults to 128MB
*/
readonly memoryLimit: pulumi.Output<number | undefined>;
/**
* Minimum replicas for your function, defaults to 0, Note that a function is billed when it gets executed, and using a minScale greater than 0 will cause your function container to run constantly.
*/
readonly minScale: pulumi.Output<number | undefined>;
/**
* The unique name of the function.
*
* > **Important** Updates to `name` will recreate the function.
*/
readonly name: pulumi.Output<string>;
/**
* The namespace ID associated with this function
*/
readonly namespaceId: pulumi.Output<string>;
/**
* The organization ID the function is associated with.
*/
readonly organizationId: pulumi.Output<string>;
/**
* Privacy of the function. Can be either `private` or `public`. Read more on [authentication](https://developers.scaleway.com/en/products/functions/api/#authentication)
*/
readonly privacy: pulumi.Output<string>;
/**
* `projectId`) The ID of the project the namespace is associated with.
*/
readonly projectId: pulumi.Output<string>;
/**
* `region`). The region in which the namespace should be created.
*/
readonly region: pulumi.Output<string>;
/**
* Runtime of the function. Runtimes can be fetched using [specific route](https://developers.scaleway.com/en/products/functions/api/#get-f7de6a)
*/
readonly runtime: pulumi.Output<string>;
/**
* The [secret environment](https://www.scaleway.com/en/docs/compute/functions/concepts/#secrets) variables of the function.
*/
readonly secretEnvironmentVariables: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Holds the max duration (in seconds) the function is allowed for responding to a request
*/
readonly timeout: pulumi.Output<number>;
/**
* Location of the zip file to upload containing your function sources
*/
readonly zipFile: pulumi.Output<string | undefined>;
/**
* The hash of your source zip file, changing it will re-apply function. Can be any string
*/
readonly zipHash: pulumi.Output<string | undefined>;
/**
* Create a Function 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: FunctionArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Function resources.
*/
export interface FunctionState {
/**
* The CPU limit in mCPU for your function. More infos on resources [here](https://developers.scaleway.com/en/products/functions/api/#functions)
*/
cpuLimit?: pulumi.Input<number>;
/**
* Define if the function should be deployed, terraform will wait for function to be deployed
*/
deploy?: pulumi.Input<boolean>;
/**
* The description of the function.
*/
description?: pulumi.Input<string>;
/**
* The native domain name of the function
*/
domainName?: pulumi.Input<string>;
/**
* The environment variables of the function.
*/
environmentVariables?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Handler of the function. Depends on the runtime ([function guide](https://developers.scaleway.com/en/products/functions/api/#create-a-function))
*/
handler?: pulumi.Input<string>;
/**
* HTTP traffic configuration
*/
httpOption?: pulumi.Input<string>;
/**
* Maximum replicas for your function (defaults to 20), our system will scale your functions automatically based on incoming workload, but will never scale the number of replicas above the configured max_scale.
*/
maxScale?: pulumi.Input<number>;
/**
* Memory limit in MB for your function, defaults to 128MB
*/
memoryLimit?: pulumi.Input<number>;
/**
* Minimum replicas for your function, defaults to 0, Note that a function is billed when it gets executed, and using a minScale greater than 0 will cause your function container to run constantly.
*/
minScale?: pulumi.Input<number>;
/**
* The unique name of the function.
*
* > **Important** Updates to `name` will recreate the function.
*/
name?: pulumi.Input<string>;
/**
* The namespace ID associated with this function
*/
namespaceId?: pulumi.Input<string>;
/**
* The organization ID the function is associated with.
*/
organizationId?: pulumi.Input<string>;
/**
* Privacy of the function. Can be either `private` or `public`. Read more on [authentication](https://developers.scaleway.com/en/products/functions/api/#authentication)
*/
privacy?: pulumi.Input<string>;
/**
* `projectId`) The ID of the project the namespace is associated with.
*/
projectId?: pulumi.Input<string>;
/**
* `region`). The region in which the namespace should be created.
*/
region?: pulumi.Input<string>;
/**
* Runtime of the function. Runtimes can be fetched using [specific route](https://developers.scaleway.com/en/products/functions/api/#get-f7de6a)
*/
runtime?: pulumi.Input<string>;
/**
* The [secret environment](https://www.scaleway.com/en/docs/compute/functions/concepts/#secrets) variables of the function.
*/
secretEnvironmentVariables?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Holds the max duration (in seconds) the function is allowed for responding to a request
*/
timeout?: pulumi.Input<number>;
/**
* Location of the zip file to upload containing your function sources
*/
zipFile?: pulumi.Input<string>;
/**
* The hash of your source zip file, changing it will re-apply function. Can be any string
*/
zipHash?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Function resource.
*/
export interface FunctionArgs {
/**
* Define if the function should be deployed, terraform will wait for function to be deployed
*/
deploy?: pulumi.Input<boolean>;
/**
* The description of the function.
*/
description?: pulumi.Input<string>;
/**
* The environment variables of the function.
*/
environmentVariables?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Handler of the function. Depends on the runtime ([function guide](https://developers.scaleway.com/en/products/functions/api/#create-a-function))
*/
handler: pulumi.Input<string>;
/**
* HTTP traffic configuration
*/
httpOption?: pulumi.Input<string>;
/**
* Maximum replicas for your function (defaults to 20), our system will scale your functions automatically based on incoming workload, but will never scale the number of replicas above the configured max_scale.
*/
maxScale?: pulumi.Input<number>;
/**
* Memory limit in MB for your function, defaults to 128MB
*/
memoryLimit?: pulumi.Input<number>;
/**
* Minimum replicas for your function, defaults to 0, Note that a function is billed when it gets executed, and using a minScale greater than 0 will cause your function container to run constantly.
*/
minScale?: pulumi.Input<number>;
/**
* The unique name of the function.
*
* > **Important** Updates to `name` will recreate the function.
*/
name?: pulumi.Input<string>;
/**
* The namespace ID associated with this function
*/
namespaceId: pulumi.Input<string>;
/**
* Privacy of the function. Can be either `private` or `public`. Read more on [authentication](https://developers.scaleway.com/en/products/functions/api/#authentication)
*/
privacy: pulumi.Input<string>;
/**
* `projectId`) The ID of the project the namespace is associated with.
*/
projectId?: pulumi.Input<string>;
/**
* `region`). The region in which the namespace should be created.
*/
region?: pulumi.Input<string>;
/**
* Runtime of the function. Runtimes can be fetched using [specific route](https://developers.scaleway.com/en/products/functions/api/#get-f7de6a)
*/
runtime: pulumi.Input<string>;
/**
* The [secret environment](https://www.scaleway.com/en/docs/compute/functions/concepts/#secrets) variables of the function.
*/
secretEnvironmentVariables?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Holds the max duration (in seconds) the function is allowed for responding to a request
*/
timeout?: pulumi.Input<number>;
/**
* Location of the zip file to upload containing your function sources
*/
zipFile?: pulumi.Input<string>;
/**
* The hash of your source zip file, changing it will re-apply function. Can be any string
*/
zipHash?: pulumi.Input<string>;
}