@aws-sdk/client-lambda
Version:
AWS SDK for JavaScript Lambda Client for Node.js, Browser and React Native
127 lines (126 loc) • 5.35 kB
TypeScript
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
import { LambdaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LambdaClient";
import { AliasConfiguration, CreateAliasRequest } from "../models/models_0";
/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link CreateAliasCommand}.
*/
export interface CreateAliasCommandInput extends CreateAliasRequest {
}
/**
* @public
*
* The output of {@link CreateAliasCommand}.
*/
export interface CreateAliasCommandOutput extends AliasConfiguration, __MetadataBearer {
}
declare const CreateAliasCommand_base: {
new (input: CreateAliasCommandInput): import("@smithy/smithy-client").CommandImpl<CreateAliasCommandInput, CreateAliasCommandOutput, LambdaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
new (input: CreateAliasCommandInput): import("@smithy/smithy-client").CommandImpl<CreateAliasCommandInput, CreateAliasCommandOutput, LambdaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
};
/**
* <p>Creates an <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html">alias</a> for a Lambda function version. Use aliases to provide clients with a function identifier that you can update to invoke a different version.</p> <p>You can also map an alias to split invocation requests between two versions. Use the <code>RoutingConfig</code> parameter to specify a second version and the percentage of invocation requests that it receives.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { LambdaClient, CreateAliasCommand } from "@aws-sdk/client-lambda"; // ES Modules import
* // const { LambdaClient, CreateAliasCommand } = require("@aws-sdk/client-lambda"); // CommonJS import
* const client = new LambdaClient(config);
* const input = { // CreateAliasRequest
* FunctionName: "STRING_VALUE", // required
* Name: "STRING_VALUE", // required
* FunctionVersion: "STRING_VALUE", // required
* Description: "STRING_VALUE",
* RoutingConfig: { // AliasRoutingConfiguration
* AdditionalVersionWeights: { // AdditionalVersionWeights
* "<keys>": Number("double"),
* },
* },
* };
* const command = new CreateAliasCommand(input);
* const response = await client.send(command);
* // { // AliasConfiguration
* // AliasArn: "STRING_VALUE",
* // Name: "STRING_VALUE",
* // FunctionVersion: "STRING_VALUE",
* // Description: "STRING_VALUE",
* // RoutingConfig: { // AliasRoutingConfiguration
* // AdditionalVersionWeights: { // AdditionalVersionWeights
* // "<keys>": Number("double"),
* // },
* // },
* // RevisionId: "STRING_VALUE",
* // };
*
* ```
*
* @param CreateAliasCommandInput - {@link CreateAliasCommandInput}
* @returns {@link CreateAliasCommandOutput}
* @see {@link CreateAliasCommandInput} for command's `input` shape.
* @see {@link CreateAliasCommandOutput} for command's `response` shape.
* @see {@link LambdaClientResolvedConfig | config} for LambdaClient's `config` shape.
*
* @throws {@link InvalidParameterValueException} (client fault)
* <p>One of the parameters in the request is not valid.</p>
*
* @throws {@link ResourceConflictException} (client fault)
* <p>The resource already exists, or another operation is in progress.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource specified in the request does not exist.</p>
*
* @throws {@link ServiceException} (server fault)
* <p>The Lambda service encountered an internal error.</p>
*
* @throws {@link TooManyRequestsException} (client fault)
* <p>The request throughput limit was exceeded. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests">Lambda quotas</a>.</p>
*
* @throws {@link LambdaServiceException}
* <p>Base exception class for all service exceptions from Lambda service.</p>
*
*
* @example To create an alias for a Lambda function
* ```javascript
* // The following example creates an alias named LIVE that points to version 1 of the my-function Lambda function.
* const input = {
* Description: "alias for live version of function",
* FunctionName: "my-function",
* FunctionVersion: "1",
* Name: "LIVE"
* };
* const command = new CreateAliasCommand(input);
* const response = await client.send(command);
* /* response is
* {
* AliasArn: "arn:aws:lambda:us-east-2:123456789012:function:my-function:LIVE",
* Description: "alias for live version of function",
* FunctionVersion: "1",
* Name: "LIVE",
* RevisionId: "873282ed-xmpl-4dc8-a069-d0c647e470c6"
* }
* *\/
* ```
*
* @public
*/
export declare class CreateAliasCommand extends CreateAliasCommand_base {
/** @internal type navigation helper, not in runtime. */
protected static __types: {
api: {
input: CreateAliasRequest;
output: AliasConfiguration;
};
sdk: {
input: CreateAliasCommandInput;
output: CreateAliasCommandOutput;
};
};
}