import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages the scaling configuration for an AWS Lambda function. The scaling configuration defines the minimum and maximum number of execution environments that can be provisioned for the function, allowing you to control scaling behavior and resource allocation. * * > **NOTE:** This resource only works with Lambda functions that have a capacity provider configuration. * * > **NOTE:** Per common practice, this resource waits for the scaling configuration to converge before apply completes. It determines the min and max execution environments have settled using Requested and Applied scaling configs returned by Lambda. The [API documentation](https://docs.aws.amazon.com/lambda/latest/api/API_GetFunctionScalingConfig.html) is ambiguous about how these behave. From observation, Requested is only returned prior to settlement whereas Applied may be partially returned until settlement when it is fully returned. Should the observed behavior change, this resource will need to be updated to match. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.lambda.CapacityProvider("example", { * vpcConfig: { * subnetIds: exampleAwsSubnet.map(__item => __item.id), * securityGroupIds: [exampleAwsSecurityGroup.id], * }, * permissionsConfig: { * capacityProviderOperatorRoleArn: exampleAwsIamRole.arn, * }, * name: "example", * }); * const exampleFunction = new aws.lambda.Function("example", { * capacityProviderConfig: { * lambdaManagedInstancesCapacityProviderConfig: { * capacityProviderArn: example.arn, * }, * }, * code: new pulumi.asset.FileArchive("lambda_function.zip"), * name: "example", * role: exampleAwsIamRole.arn, * handler: "index.handler", * runtime: aws.lambda.Runtime.Python3d14, * memorySize: 32768, * publish: true, * publishTo: "LATEST_PUBLISHED", * }); * const exampleFunctionScalingConfig = new aws.lambda.FunctionScalingConfig("example", { * functionScalingConfig: { * minExecutionEnvironments: 3, * maxExecutionEnvironments: 100, * }, * functionName: exampleFunction.name, * qualifier: "$LATEST.PUBLISHED", * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * * `functionName` (String) Name or ARN of the Lambda function. * * `qualifier` (String) Qualifier for the scaling configuration. * * #### Optional * * * `accountId` (String) AWS Account where this resource is managed. * * `region` (String) Region where this resource is managed. * * Using `pulumi import`, import Lambda Function Scaling Config using the `functionName` and `qualifier` separated by a comma (`,`). For example: * * ```sh * $ pulumi import aws:lambda/functionScalingConfig:FunctionScalingConfig example my-function,$LATEST.PUBLISHED * ``` */ export declare class FunctionScalingConfig extends pulumi.CustomResource { /** * Get an existing FunctionScalingConfig 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?: FunctionScalingConfigState, opts?: pulumi.CustomResourceOptions): FunctionScalingConfig; /** * Returns true if the given object is an instance of FunctionScalingConfig. 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 FunctionScalingConfig; /** * ARN of the Lambda function. */ readonly functionArn: pulumi.Output; /** * Name or ARN of the Lambda function. Changing this forces a new resource. */ readonly functionName: pulumi.Output; /** * Scaling configuration block. See `functionScalingConfig` Block below. */ readonly functionScalingConfig: pulumi.Output; /** * State of the function after the scaling configuration was applied. This reflects the state reported by the most recent create or update and is not refreshed on read. */ readonly functionState: pulumi.Output; /** * Qualifier for the scaling configuration. Valid values: `$LATEST.PUBLISHED` to target the latest published version, or a specific numeric version number (e.g., `1`). Changing this forces a new resource. * * The following arguments are optional: */ readonly qualifier: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; readonly timeouts: pulumi.Output; /** * Create a FunctionScalingConfig 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: FunctionScalingConfigArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FunctionScalingConfig resources. */ export interface FunctionScalingConfigState { /** * ARN of the Lambda function. */ functionArn?: pulumi.Input; /** * Name or ARN of the Lambda function. Changing this forces a new resource. */ functionName?: pulumi.Input; /** * Scaling configuration block. See `functionScalingConfig` Block below. */ functionScalingConfig?: pulumi.Input; /** * State of the function after the scaling configuration was applied. This reflects the state reported by the most recent create or update and is not refreshed on read. */ functionState?: pulumi.Input; /** * Qualifier for the scaling configuration. Valid values: `$LATEST.PUBLISHED` to target the latest published version, or a specific numeric version number (e.g., `1`). Changing this forces a new resource. * * The following arguments are optional: */ qualifier?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; timeouts?: pulumi.Input; } /** * The set of arguments for constructing a FunctionScalingConfig resource. */ export interface FunctionScalingConfigArgs { /** * Name or ARN of the Lambda function. Changing this forces a new resource. */ functionName: pulumi.Input; /** * Scaling configuration block. See `functionScalingConfig` Block below. */ functionScalingConfig: pulumi.Input; /** * Qualifier for the scaling configuration. Valid values: `$LATEST.PUBLISHED` to target the latest published version, or a specific numeric version number (e.g., `1`). Changing this forces a new resource. * * The following arguments are optional: */ qualifier: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; timeouts?: pulumi.Input; } //# sourceMappingURL=functionScalingConfig.d.ts.map