UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

106 lines 4.78 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.RuntimeManagementConfig = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an AWS Lambda Runtime Management Config. Use this resource to control how Lambda updates the runtime for your function. * * Refer to the [AWS Lambda documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) for supported runtimes. * * > **Note:** Deletion of this resource returns the runtime update mode to `Auto` (the default behavior). To leave the configured runtime management options in-place, use a `removed` block with the destroy lifecycle set to `false`. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.lambda.RuntimeManagementConfig("example", { * functionName: exampleAwsLambdaFunction.functionName, * updateRuntimeOn: "FunctionUpdate", * }); * ``` * * ### Manual Update * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.lambda.RuntimeManagementConfig("example", { * functionName: exampleAwsLambdaFunction.functionName, * updateRuntimeOn: "Manual", * runtimeVersionArn: "arn:aws:lambda:us-east-1::runtime:abcd1234", * }); * ``` * * > **Note:** Once the runtime update mode is set to `Manual`, the `aws.lambda.Function` `runtime` cannot be updated. To upgrade a runtime, the `updateRuntimeOn` argument must be set to `Auto` or `FunctionUpdate` prior to changing the function's `runtime` argument. * * ## Import * * Using `pulumi import`, import Lambda Runtime Management Config using a comma-delimited string combining `function_name` and `qualifier`. For example: * * ```sh * $ pulumi import aws:lambda/runtimeManagementConfig:RuntimeManagementConfig example example,$LATEST * ``` */ class RuntimeManagementConfig extends pulumi.CustomResource { /** * Get an existing RuntimeManagementConfig 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, id, state, opts) { return new RuntimeManagementConfig(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of RuntimeManagementConfig. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === RuntimeManagementConfig.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["functionArn"] = state?.functionArn; resourceInputs["functionName"] = state?.functionName; resourceInputs["qualifier"] = state?.qualifier; resourceInputs["region"] = state?.region; resourceInputs["runtimeVersionArn"] = state?.runtimeVersionArn; resourceInputs["updateRuntimeOn"] = state?.updateRuntimeOn; } else { const args = argsOrState; if (args?.functionName === undefined && !opts.urn) { throw new Error("Missing required property 'functionName'"); } resourceInputs["functionName"] = args?.functionName; resourceInputs["qualifier"] = args?.qualifier; resourceInputs["region"] = args?.region; resourceInputs["runtimeVersionArn"] = args?.runtimeVersionArn; resourceInputs["updateRuntimeOn"] = args?.updateRuntimeOn; resourceInputs["functionArn"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RuntimeManagementConfig.__pulumiType, name, resourceInputs, opts); } } exports.RuntimeManagementConfig = RuntimeManagementConfig; /** @internal */ RuntimeManagementConfig.__pulumiType = 'aws:lambda/runtimeManagementConfig:RuntimeManagementConfig'; //# sourceMappingURL=runtimeManagementConfig.js.map