@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
1,071 lines (1,070 loc) • 38.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Manages the function resource within HuaweiCloud.
*
* > Since version `1.73.1`, the requests of the function resource will send these parameters:<br>
* `enableDynamicMemory`<br>
* `isStatefulFunction`<br>
* `networkController`<br>
* Since version `1.74.0`, the requests of the function resource will send these parameters:<br>
* `enableAuthInHeader`<br>
* `enableClassIsolation`<br>
* For the regions that do not support this parameter, please use the lower version to deploy this resource.
*
* ## Example Usage
* ### With text code
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const functionName = config.requireObject("functionName");
* const agencyName = config.requireObject("agencyName");
* const test = new huaweicloud.functiongraph.Function("test", {
* app: "default",
* agency: agencyName,
* handler: "test.handler",
* memorySize: 128,
* timeout: 3,
* runtime: "Python2.7",
* codeType: "inline",
* funcCode: `# -*- coding:utf-8 -*-
* import json
* def handler (event, context):
* return {
* "statusCode": 200,
* "isBase64Encoded": False,
* "body": json.dumps(event),
* "headers": {
* "Content-Type": "application/json"
* }
* }
* `,
* });
* ```
* ### Create function using SWR image
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const functionName = config.requireObject("functionName");
* const agencyName = config.requireObject("agencyName");
* const imageUrl = config.requireObject("imageUrl");
* const bySwrImage = new huaweicloud.functiongraph.Function("bySwrImage", {
* agency: agencyName,
* handler: "-",
* app: "default",
* runtime: "Custom Image",
* codeType: "Custom-Image-Swr",
* memorySize: 128,
* timeout: 3,
* customImage: {
* url: imageUrl,
* },
* });
* ```
* ### Create function with Java runtime and corresponding configuration
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const functionName = config.requireObject("functionName");
* const agencyName = config.requireObject("agencyName");
* const test = new huaweicloud.functiongraph.Function("test", {
* memorySize: 128,
* runtime: "Java11",
* timeout: 15,
* app: "default",
* handler: "com.huawei.demo.TriggerTests.apigTest",
* codeType: "zip",
* codeFilename: "java-demo.zip",
* agency: agencyName,
* enableClassIsolation: true,
* ephemeralStorage: 512,
* heartbeatHandler: "com.huawei.demo.TriggerTests.heartBeat",
* restoreHookHandler: "com.huawei.demo.TriggerTests.restoreHook",
* restoreHookTimeout: 10,
* });
* ```
*
* ## Import
*
* Functions can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:FunctionGraph/function:Function test <id>
* ```
*
* Note that the imported state may not be identical to your resource definition, due to the attribute missing from the API response. The missing attributes are`func_code`, `encrypted_user_data`, `tags`. It is generally recommended running `terraform plan` after importing a function. You can then decide if changes should be applied to the function, or the resource definition should be updated to align with the function. Also you can ignore changes as below. hcl resource "huaweicloud_fgs_function" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* app, func_code, tags,
*
* ]
*
* } }
*/
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;
/**
* Specifies the agency configuration of the function.
* This parameter is mandatory if the function needs to access other cloud services.
*/
readonly agency: pulumi.Output<string | undefined>;
/**
* Specifies the group to which the function belongs.
*/
readonly app: pulumi.Output<string | undefined>;
/**
* Specifies the execution agency enables you to obtain a token or an AK/SK for
* accessing other cloud services.
*/
readonly appAgency: pulumi.Output<string>;
/**
* Specifies the name of the function file.
* Required if the `codeType` is set to **jar** or **zip**.
*/
readonly codeFilename: pulumi.Output<string>;
/**
* Specifies the code type of the function.
* The valid values are as follows:
* + **inline**: inline code.
* + **zip**: ZIP file.
* + **jar**: JAR file or java functions.
* + **obs**: function code stored in an OBS bucket.
* + **Custom-Image-Swr**: function code comes from the SWR custom image.
*/
readonly codeType: pulumi.Output<string>;
/**
* Specifies the URL where the function code is stored in OBS.
* Required if the `codeType` is set to **obs**.
*/
readonly codeUrl: pulumi.Output<string | undefined>;
/**
* Specifies the number of concurrent requests of the function.
* The valid value is range from `1` to `1,000`, the default value is `1`.
*/
readonly concurrencyNum: pulumi.Output<number>;
/**
* Specifies the custom image configuration of the function.
* The customImage structure is documented below.
* Required if the parameter `codeType` is **Custom-Image-Swr**.
*/
readonly customImage: pulumi.Output<outputs.FunctionGraph.FunctionCustomImage>;
/**
* Specifies the list of the dependency version IDs.
*/
readonly dependLists: pulumi.Output<string[]>;
/**
* Specifies the description of the version alias.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Specifies the private DNS configuration of the function network.
* Private DNS list is associated to the function by a string in the following format:
* `[{\"id\":\"ff8080828a07ffea018a17184aa310f5\","domainName":"functiondebug.example1.com."}]`
*/
readonly dnsList: pulumi.Output<string>;
/**
* Specifies whether the authentication in the request header is enabled.
* Defaults to **false**.
*/
readonly enableAuthInHeader: pulumi.Output<boolean | undefined>;
/**
* Specifies whether the class isolation is enabled for the JAVA runtime
* functions.
* Defaults to **false**.
*/
readonly enableClassIsolation: pulumi.Output<boolean | undefined>;
/**
* Specifies whether the dynamic memory configuration is enabled.
* Defaults to **false**.
*/
readonly enableDynamicMemory: pulumi.Output<boolean | undefined>;
/**
* Specifies the key/value information defined to be encrypted for the
* function.
* The format is the same as `userData`.
*/
readonly encryptedUserData: pulumi.Output<string | undefined>;
/**
* Specifies the ID of the enterprise project to which the
* function belongs.
*/
readonly enterpriseProjectId: pulumi.Output<string>;
/**
* Specifies the size of the function ephemeral storage.
* The valid values are as follows:
* + **512**
* + **10240**
*/
readonly ephemeralStorage: pulumi.Output<number>;
/**
* Specifies the function code.
* The code value can be encoded using **Base64** or just with the text code.
* Required if the `codeType` is set to **inline**, **zip**, or **jar**.
*/
readonly funcCode: pulumi.Output<string | undefined>;
/**
* Specifies the list of function mount configurations.
* The funcMounts structure is documented below.
*/
readonly funcMounts: pulumi.Output<outputs.FunctionGraph.FunctionFuncMount[]>;
/**
* Specifies the version of the function framework.
* The valid values are as follows:
* + **v1**: Hosts event-driven functions in a serverless context.
* + **v2**: Next-generation function hosting service powered by Huawei YuanRong architecture.
*/
readonly functiongraphVersion: pulumi.Output<string>;
/**
* Specifies the GPU memory size allocated to the function, in MByte (MB).
* The valid value is range form `1,024` to `16,384`, the value must be a multiple of `1,024`.
* If not specified, the GPU function is disabled.
*/
readonly gpuMemory: pulumi.Output<number | undefined>;
/**
* Specifies the GPU type of the function.
* Currently, only **nvidia-t4** is supported.
*/
readonly gpuType: pulumi.Output<string | undefined>;
/**
* Specifies the entry point of the function.
*/
readonly handler: pulumi.Output<string>;
/**
* Specifies the heartbeat handler of the function.
* The rule is **xx.xx**, such as **com.huawei.demo.TriggerTests.heartBeat**, it must contain periods (.).
* The heartbeat function entry must be in the same file as the function execution entry.
*/
readonly heartbeatHandler: pulumi.Output<string | undefined>;
/**
* Specifies the initializer of the function.
*/
readonly initializerHandler: pulumi.Output<string>;
/**
* Specifies the maximum duration the function can be initialized, in seconds.
* The valid value is range from `1` to `300`.
*/
readonly initializerTimeout: pulumi.Output<number>;
/**
* Specifies whether the function is a stateful function.
* Defaults to **false**.
*/
readonly isStatefulFunction: pulumi.Output<boolean | undefined>;
/**
* Specifies the LTS group ID for collecting logs.
*/
readonly logGroupId: pulumi.Output<string>;
/**
* Specifies the LTS group name for collecting logs.
*/
readonly logGroupName: pulumi.Output<string>;
/**
* Specifies the LTS stream IID for collecting logs.
*/
readonly logStreamId: pulumi.Output<string>;
/**
* Specifies the LTS stream name for collecting logs.
*/
readonly logStreamName: pulumi.Output<string>;
/**
* Specifies the custom tags configuration that used to filter the LTS logs.
*/
readonly ltsCustomTag: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The script configuration value of this change is also the original value used for comparison with the new value next
* time the change is made. The corresponding parameter name is 'lts_custom_tag'.
*/
readonly ltsCustomTagOrigin: pulumi.Output<{
[key: string]: string;
}>;
/**
* Specifies the maximum number of instances of the function.
* The valid value is range from `-1` to `1,000`, defaults to `400`.
* + The minimum value is `-1` and means the number of instances is unlimited.
*/
readonly maxInstanceNum: pulumi.Output<string>;
/**
* Specifies the memory size allocated to the function, in MByte (MB).
*/
readonly memorySize: pulumi.Output<number>;
/**
* Specifies the mount user group ID.
* The valid value is range from `–1` to `65,534`, except `0`.
* Defaults to `-1`.
*/
readonly mountUserGroupId: pulumi.Output<number>;
/**
* Specifies the mount user ID.
* The valid value is range from `–1` to `65,534`, except `0`.
* Defaults to `-1`.
*/
readonly mountUserId: pulumi.Output<number>;
/**
* Specifies the name of metric policy.
* The valid length is limited from `1` to `60` characters, only letters, digits, hyphens (-), and underscores (_) are
* allowed. The name must start with a letter and ending with a letter or digit.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies the network configuration of the function.
* The networkController structure is documented below.
*/
readonly networkController: pulumi.Output<outputs.FunctionGraph.FunctionNetworkController | undefined>;
/**
* Specifies the network ID of subnet.
*/
readonly networkId: pulumi.Output<string | undefined>;
/**
* @deprecated use app instead
*/
readonly package: pulumi.Output<string | undefined>;
/**
* Specifies the VPC cidr blocks used in the function code to detect whether it
* conflicts with the VPC cidr blocks used by the service.
* The cidr blocks are separated by semicolons and cannot exceed `5`.
*/
readonly peeringCidr: pulumi.Output<string | undefined>;
/**
* The pre-stop handler of a function.
*/
readonly preStopHandler: pulumi.Output<string | undefined>;
/**
* The maximum duration that the function can be initialized.
*/
readonly preStopTimeout: pulumi.Output<number | undefined>;
/**
* Specifies the region where the function is located.
* If omitted, the provider-level region will be used. Changing this will create a new resource.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies the reserved instance policies of the function.
* The reservedInstances structure is documented below.
*/
readonly reservedInstances: pulumi.Output<outputs.FunctionGraph.FunctionReservedInstance[] | undefined>;
/**
* Specifies the restore hook handler of the function.
*/
readonly restoreHookHandler: pulumi.Output<string | undefined>;
/**
* Specifies the timeout of the function restore hook.
* The function will be forcibly stopped if the time is end.
* The valid value is range from `1` to `300`, the unit is seconds (s).
*/
readonly restoreHookTimeout: pulumi.Output<number | undefined>;
/**
* Specifies the environment for executing the function.
* The valid values are as follows:
* + **Java8**
* + **Java11**
* + **Node.js6.10**
* + **Node.js8.10**
* + **Node.js10.16**
* + **Node.js12.13**
* + **Node.js14.18**
* + **Node.js16.17**
* + **Node.js18.15**
* + **Python2.7**
* + **Python3.6**
* + **Python3.9**
* + **Go1.x**
* + **C#(.NET Core 2.1)**
* + **C#(.NET Core 3.1)**
* + **Custom**
* + **PHP7.3**
* + **http**
* + **Custom Image**
* + **Cangjie1.0**
*/
readonly runtime: pulumi.Output<string>;
/**
* Specifies the key/value pairs to associate with the function.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Specifies the timeout interval of the function, in seconds.
* The value ranges from `3` to `259,200`.
*/
readonly timeout: pulumi.Output<number>;
/**
* The URN (Uniform Resource Name) of the function.
*/
readonly urn: pulumi.Output<string>;
/**
* The key/value information defined for the function.
*/
readonly userData: pulumi.Output<string | undefined>;
/**
* The version of the function.
*/
readonly version: pulumi.Output<string>;
/**
* Specifies the versions management of the function.
* The versions structure is documented below.
*/
readonly versions: pulumi.Output<outputs.FunctionGraph.FunctionVersion[] | undefined>;
/**
* Specifies the ID of the VPC that can trigger the function.
*/
readonly vpcId: pulumi.Output<string | undefined>;
/**
* @deprecated use agency instead
*/
readonly xrole: 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 {
/**
* Specifies the agency configuration of the function.
* This parameter is mandatory if the function needs to access other cloud services.
*/
agency?: pulumi.Input<string>;
/**
* Specifies the group to which the function belongs.
*/
app?: pulumi.Input<string>;
/**
* Specifies the execution agency enables you to obtain a token or an AK/SK for
* accessing other cloud services.
*/
appAgency?: pulumi.Input<string>;
/**
* Specifies the name of the function file.
* Required if the `codeType` is set to **jar** or **zip**.
*/
codeFilename?: pulumi.Input<string>;
/**
* Specifies the code type of the function.
* The valid values are as follows:
* + **inline**: inline code.
* + **zip**: ZIP file.
* + **jar**: JAR file or java functions.
* + **obs**: function code stored in an OBS bucket.
* + **Custom-Image-Swr**: function code comes from the SWR custom image.
*/
codeType?: pulumi.Input<string>;
/**
* Specifies the URL where the function code is stored in OBS.
* Required if the `codeType` is set to **obs**.
*/
codeUrl?: pulumi.Input<string>;
/**
* Specifies the number of concurrent requests of the function.
* The valid value is range from `1` to `1,000`, the default value is `1`.
*/
concurrencyNum?: pulumi.Input<number>;
/**
* Specifies the custom image configuration of the function.
* The customImage structure is documented below.
* Required if the parameter `codeType` is **Custom-Image-Swr**.
*/
customImage?: pulumi.Input<inputs.FunctionGraph.FunctionCustomImage>;
/**
* Specifies the list of the dependency version IDs.
*/
dependLists?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the description of the version alias.
*/
description?: pulumi.Input<string>;
/**
* Specifies the private DNS configuration of the function network.
* Private DNS list is associated to the function by a string in the following format:
* `[{\"id\":\"ff8080828a07ffea018a17184aa310f5\","domainName":"functiondebug.example1.com."}]`
*/
dnsList?: pulumi.Input<string>;
/**
* Specifies whether the authentication in the request header is enabled.
* Defaults to **false**.
*/
enableAuthInHeader?: pulumi.Input<boolean>;
/**
* Specifies whether the class isolation is enabled for the JAVA runtime
* functions.
* Defaults to **false**.
*/
enableClassIsolation?: pulumi.Input<boolean>;
/**
* Specifies whether the dynamic memory configuration is enabled.
* Defaults to **false**.
*/
enableDynamicMemory?: pulumi.Input<boolean>;
/**
* Specifies the key/value information defined to be encrypted for the
* function.
* The format is the same as `userData`.
*/
encryptedUserData?: pulumi.Input<string>;
/**
* Specifies the ID of the enterprise project to which the
* function belongs.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies the size of the function ephemeral storage.
* The valid values are as follows:
* + **512**
* + **10240**
*/
ephemeralStorage?: pulumi.Input<number>;
/**
* Specifies the function code.
* The code value can be encoded using **Base64** or just with the text code.
* Required if the `codeType` is set to **inline**, **zip**, or **jar**.
*/
funcCode?: pulumi.Input<string>;
/**
* Specifies the list of function mount configurations.
* The funcMounts structure is documented below.
*/
funcMounts?: pulumi.Input<pulumi.Input<inputs.FunctionGraph.FunctionFuncMount>[]>;
/**
* Specifies the version of the function framework.
* The valid values are as follows:
* + **v1**: Hosts event-driven functions in a serverless context.
* + **v2**: Next-generation function hosting service powered by Huawei YuanRong architecture.
*/
functiongraphVersion?: pulumi.Input<string>;
/**
* Specifies the GPU memory size allocated to the function, in MByte (MB).
* The valid value is range form `1,024` to `16,384`, the value must be a multiple of `1,024`.
* If not specified, the GPU function is disabled.
*/
gpuMemory?: pulumi.Input<number>;
/**
* Specifies the GPU type of the function.
* Currently, only **nvidia-t4** is supported.
*/
gpuType?: pulumi.Input<string>;
/**
* Specifies the entry point of the function.
*/
handler?: pulumi.Input<string>;
/**
* Specifies the heartbeat handler of the function.
* The rule is **xx.xx**, such as **com.huawei.demo.TriggerTests.heartBeat**, it must contain periods (.).
* The heartbeat function entry must be in the same file as the function execution entry.
*/
heartbeatHandler?: pulumi.Input<string>;
/**
* Specifies the initializer of the function.
*/
initializerHandler?: pulumi.Input<string>;
/**
* Specifies the maximum duration the function can be initialized, in seconds.
* The valid value is range from `1` to `300`.
*/
initializerTimeout?: pulumi.Input<number>;
/**
* Specifies whether the function is a stateful function.
* Defaults to **false**.
*/
isStatefulFunction?: pulumi.Input<boolean>;
/**
* Specifies the LTS group ID for collecting logs.
*/
logGroupId?: pulumi.Input<string>;
/**
* Specifies the LTS group name for collecting logs.
*/
logGroupName?: pulumi.Input<string>;
/**
* Specifies the LTS stream IID for collecting logs.
*/
logStreamId?: pulumi.Input<string>;
/**
* Specifies the LTS stream name for collecting logs.
*/
logStreamName?: pulumi.Input<string>;
/**
* Specifies the custom tags configuration that used to filter the LTS logs.
*/
ltsCustomTag?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The script configuration value of this change is also the original value used for comparison with the new value next
* time the change is made. The corresponding parameter name is 'lts_custom_tag'.
*/
ltsCustomTagOrigin?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the maximum number of instances of the function.
* The valid value is range from `-1` to `1,000`, defaults to `400`.
* + The minimum value is `-1` and means the number of instances is unlimited.
*/
maxInstanceNum?: pulumi.Input<string>;
/**
* Specifies the memory size allocated to the function, in MByte (MB).
*/
memorySize?: pulumi.Input<number>;
/**
* Specifies the mount user group ID.
* The valid value is range from `–1` to `65,534`, except `0`.
* Defaults to `-1`.
*/
mountUserGroupId?: pulumi.Input<number>;
/**
* Specifies the mount user ID.
* The valid value is range from `–1` to `65,534`, except `0`.
* Defaults to `-1`.
*/
mountUserId?: pulumi.Input<number>;
/**
* Specifies the name of metric policy.
* The valid length is limited from `1` to `60` characters, only letters, digits, hyphens (-), and underscores (_) are
* allowed. The name must start with a letter and ending with a letter or digit.
*/
name?: pulumi.Input<string>;
/**
* Specifies the network configuration of the function.
* The networkController structure is documented below.
*/
networkController?: pulumi.Input<inputs.FunctionGraph.FunctionNetworkController>;
/**
* Specifies the network ID of subnet.
*/
networkId?: pulumi.Input<string>;
/**
* @deprecated use app instead
*/
package?: pulumi.Input<string>;
/**
* Specifies the VPC cidr blocks used in the function code to detect whether it
* conflicts with the VPC cidr blocks used by the service.
* The cidr blocks are separated by semicolons and cannot exceed `5`.
*/
peeringCidr?: pulumi.Input<string>;
/**
* The pre-stop handler of a function.
*/
preStopHandler?: pulumi.Input<string>;
/**
* The maximum duration that the function can be initialized.
*/
preStopTimeout?: pulumi.Input<number>;
/**
* Specifies the region where the function is located.
* If omitted, the provider-level region will be used. Changing this will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the reserved instance policies of the function.
* The reservedInstances structure is documented below.
*/
reservedInstances?: pulumi.Input<pulumi.Input<inputs.FunctionGraph.FunctionReservedInstance>[]>;
/**
* Specifies the restore hook handler of the function.
*/
restoreHookHandler?: pulumi.Input<string>;
/**
* Specifies the timeout of the function restore hook.
* The function will be forcibly stopped if the time is end.
* The valid value is range from `1` to `300`, the unit is seconds (s).
*/
restoreHookTimeout?: pulumi.Input<number>;
/**
* Specifies the environment for executing the function.
* The valid values are as follows:
* + **Java8**
* + **Java11**
* + **Node.js6.10**
* + **Node.js8.10**
* + **Node.js10.16**
* + **Node.js12.13**
* + **Node.js14.18**
* + **Node.js16.17**
* + **Node.js18.15**
* + **Python2.7**
* + **Python3.6**
* + **Python3.9**
* + **Go1.x**
* + **C#(.NET Core 2.1)**
* + **C#(.NET Core 3.1)**
* + **Custom**
* + **PHP7.3**
* + **http**
* + **Custom Image**
* + **Cangjie1.0**
*/
runtime?: pulumi.Input<string>;
/**
* Specifies the key/value pairs to associate with the function.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the timeout interval of the function, in seconds.
* The value ranges from `3` to `259,200`.
*/
timeout?: pulumi.Input<number>;
/**
* The URN (Uniform Resource Name) of the function.
*/
urn?: pulumi.Input<string>;
/**
* The key/value information defined for the function.
*/
userData?: pulumi.Input<string>;
/**
* The version of the function.
*/
version?: pulumi.Input<string>;
/**
* Specifies the versions management of the function.
* The versions structure is documented below.
*/
versions?: pulumi.Input<pulumi.Input<inputs.FunctionGraph.FunctionVersion>[]>;
/**
* Specifies the ID of the VPC that can trigger the function.
*/
vpcId?: pulumi.Input<string>;
/**
* @deprecated use agency instead
*/
xrole?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Function resource.
*/
export interface FunctionArgs {
/**
* Specifies the agency configuration of the function.
* This parameter is mandatory if the function needs to access other cloud services.
*/
agency?: pulumi.Input<string>;
/**
* Specifies the group to which the function belongs.
*/
app?: pulumi.Input<string>;
/**
* Specifies the execution agency enables you to obtain a token or an AK/SK for
* accessing other cloud services.
*/
appAgency?: pulumi.Input<string>;
/**
* Specifies the name of the function file.
* Required if the `codeType` is set to **jar** or **zip**.
*/
codeFilename?: pulumi.Input<string>;
/**
* Specifies the code type of the function.
* The valid values are as follows:
* + **inline**: inline code.
* + **zip**: ZIP file.
* + **jar**: JAR file or java functions.
* + **obs**: function code stored in an OBS bucket.
* + **Custom-Image-Swr**: function code comes from the SWR custom image.
*/
codeType?: pulumi.Input<string>;
/**
* Specifies the URL where the function code is stored in OBS.
* Required if the `codeType` is set to **obs**.
*/
codeUrl?: pulumi.Input<string>;
/**
* Specifies the number of concurrent requests of the function.
* The valid value is range from `1` to `1,000`, the default value is `1`.
*/
concurrencyNum?: pulumi.Input<number>;
/**
* Specifies the custom image configuration of the function.
* The customImage structure is documented below.
* Required if the parameter `codeType` is **Custom-Image-Swr**.
*/
customImage?: pulumi.Input<inputs.FunctionGraph.FunctionCustomImage>;
/**
* Specifies the list of the dependency version IDs.
*/
dependLists?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the description of the version alias.
*/
description?: pulumi.Input<string>;
/**
* Specifies the private DNS configuration of the function network.
* Private DNS list is associated to the function by a string in the following format:
* `[{\"id\":\"ff8080828a07ffea018a17184aa310f5\","domainName":"functiondebug.example1.com."}]`
*/
dnsList?: pulumi.Input<string>;
/**
* Specifies whether the authentication in the request header is enabled.
* Defaults to **false**.
*/
enableAuthInHeader?: pulumi.Input<boolean>;
/**
* Specifies whether the class isolation is enabled for the JAVA runtime
* functions.
* Defaults to **false**.
*/
enableClassIsolation?: pulumi.Input<boolean>;
/**
* Specifies whether the dynamic memory configuration is enabled.
* Defaults to **false**.
*/
enableDynamicMemory?: pulumi.Input<boolean>;
/**
* Specifies the key/value information defined to be encrypted for the
* function.
* The format is the same as `userData`.
*/
encryptedUserData?: pulumi.Input<string>;
/**
* Specifies the ID of the enterprise project to which the
* function belongs.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies the size of the function ephemeral storage.
* The valid values are as follows:
* + **512**
* + **10240**
*/
ephemeralStorage?: pulumi.Input<number>;
/**
* Specifies the function code.
* The code value can be encoded using **Base64** or just with the text code.
* Required if the `codeType` is set to **inline**, **zip**, or **jar**.
*/
funcCode?: pulumi.Input<string>;
/**
* Specifies the list of function mount configurations.
* The funcMounts structure is documented below.
*/
funcMounts?: pulumi.Input<pulumi.Input<inputs.FunctionGraph.FunctionFuncMount>[]>;
/**
* Specifies the version of the function framework.
* The valid values are as follows:
* + **v1**: Hosts event-driven functions in a serverless context.
* + **v2**: Next-generation function hosting service powered by Huawei YuanRong architecture.
*/
functiongraphVersion?: pulumi.Input<string>;
/**
* Specifies the GPU memory size allocated to the function, in MByte (MB).
* The valid value is range form `1,024` to `16,384`, the value must be a multiple of `1,024`.
* If not specified, the GPU function is disabled.
*/
gpuMemory?: pulumi.Input<number>;
/**
* Specifies the GPU type of the function.
* Currently, only **nvidia-t4** is supported.
*/
gpuType?: pulumi.Input<string>;
/**
* Specifies the entry point of the function.
*/
handler?: pulumi.Input<string>;
/**
* Specifies the heartbeat handler of the function.
* The rule is **xx.xx**, such as **com.huawei.demo.TriggerTests.heartBeat**, it must contain periods (.).
* The heartbeat function entry must be in the same file as the function execution entry.
*/
heartbeatHandler?: pulumi.Input<string>;
/**
* Specifies the initializer of the function.
*/
initializerHandler?: pulumi.Input<string>;
/**
* Specifies the maximum duration the function can be initialized, in seconds.
* The valid value is range from `1` to `300`.
*/
initializerTimeout?: pulumi.Input<number>;
/**
* Specifies whether the function is a stateful function.
* Defaults to **false**.
*/
isStatefulFunction?: pulumi.Input<boolean>;
/**
* Specifies the LTS group ID for collecting logs.
*/
logGroupId?: pulumi.Input<string>;
/**
* Specifies the LTS group name for collecting logs.
*/
logGroupName?: pulumi.Input<string>;
/**
* Specifies the LTS stream IID for collecting logs.
*/
logStreamId?: pulumi.Input<string>;
/**
* Specifies the LTS stream name for collecting logs.
*/
logStreamName?: pulumi.Input<string>;
/**
* Specifies the custom tags configuration that used to filter the LTS logs.
*/
ltsCustomTag?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the maximum number of instances of the function.
* The valid value is range from `-1` to `1,000`, defaults to `400`.
* + The minimum value is `-1` and means the number of instances is unlimited.
*/
maxInstanceNum?: pulumi.Input<string>;
/**
* Specifies the memory size allocated to the function, in MByte (MB).
*/
memorySize: pulumi.Input<number>;
/**
* Specifies the mount user group ID.
* The valid value is range from `–1` to `65,534`, except `0`.
* Defaults to `-1`.
*/
mountUserGroupId?: pulumi.Input<number>;
/**
* Specifies the mount user ID.
* The valid value is range from `–1` to `65,534`, except `0`.
* Defaults to `-1`.
*/
mountUserId?: pulumi.Input<number>;
/**
* Specifies the name of metric policy.
* The valid length is limited from `1` to `60` characters, only letters, digits, hyphens (-), and underscores (_) are
* allowed. The name must start with a letter and ending with a letter or digit.
*/
name?: pulumi.Input<string>;
/**
* Specifies the network configuration of the function.
* The networkController structure is documented below.
*/
networkController?: pulumi.Input<inputs.FunctionGraph.FunctionNetworkController>;
/**
* Specifies the network ID of subnet.
*/
networkId?: pulumi.Input<string>;
/**
* @deprecated use app instead
*/
package?: pulumi.Input<string>;
/**
* Specifies the VPC cidr blocks used in the function code to detect whether it
* conflicts with the VPC cidr blocks used by the service.
* The cidr blocks are separated by semicolons and cannot exceed `5`.
*/
peeringCidr?: pulumi.Input<string>;
/**
* The pre-stop handler of a function.
*/
preStopHandler?: pulumi.Input<string>;
/**
* The maximum duration that the function can be initialized.
*/
preStopTimeout?: pulumi.Input<number>;
/**
* Specifies the region where the function is located.
* If omitted, the provider-level region will be used. Changing this will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the reserved instance policies of the function.
* The reservedInstances structure is documented below.
*/
reservedInstances?: pulumi.Input<pulumi.Input<inputs.FunctionGraph.FunctionReservedInstance>[]>;
/**
* Specifies the restore hook handler of the function.
*/
restoreHookHandler?: pulumi.Input<string>;
/**
* Specifies the timeout of the function restore hook.
* The function will be forcibly stopped if the time is end.
* The valid value is range from `1` to `300`, the unit is seconds (s).
*/
restoreHookTimeout?: pulumi.Input<number>;
/**
* Specifies the environment for executing the function.
* The valid values are as follows:
* + **Java8**
* + **Java11**
* + **Node.js6.10**
* + **Node.js8.10**
* + **Node.js10.16**
* + **Node.js12.13**
* + **Node.js14.18**
* + **Node.js16.17**
* + **Node.js18.15**
* + **Python2.7**
* + **Python3.6**
* + **Python3.9**
* + **Go1.x**
* + **C#(.NET Core 2.1)**
* + **C#(.NET Core 3.1)**
* + **Custom**
* + **PHP7.3**
* + **http**
* + **Custom Image**
* + **Cangjie1.0**
*/
runtime: pulumi.Input<string>;
/**
* Specifies the key/value pairs to associate with the function.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the timeout interval of the function, in seconds.
* The value ranges from `3` to `259,200`.
*/
timeout: pulumi.Input<number>;
/**
* The key/value information defined for the function.
*/
userData?: pulumi.Input<string>;
/**
* Specifies the versions management of the function.
* The versions structure is documented below.
*/
versions?: pulumi.Input<pulumi.Input<inputs.FunctionGraph.FunctionVersion>[]>;
/**
* Specifies the ID of the VPC that can trigger the function.
*/
vpcId?: pulumi.Input<string>;
/**
* @deprecated use agency instead
*/
xrole?: pulumi.Input<string>;
}