CreateDeploymentCommand

Creates a Deployment for an API.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ApiGatewayV2Client, CreateDeploymentCommand } from "@aws-sdk/client-apigatewayv2"; // ES Modules import
// const { ApiGatewayV2Client, CreateDeploymentCommand } = require("@aws-sdk/client-apigatewayv2"); // CommonJS import
const client = new ApiGatewayV2Client(config);
const input = { // CreateDeploymentRequest
  ApiId: "STRING_VALUE", // required
  Description: "STRING_VALUE",
  StageName: "STRING_VALUE",
};
const command = new CreateDeploymentCommand(input);
const response = await client.send(command);
// { // CreateDeploymentResponse
//   AutoDeployed: true || false,
//   CreatedDate: new Date("TIMESTAMP"),
//   DeploymentId: "STRING_VALUE",
//   DeploymentStatus: "PENDING" || "FAILED" || "DEPLOYED",
//   DeploymentStatusMessage: "STRING_VALUE",
//   Description: "STRING_VALUE",
// };

CreateDeploymentCommand Input

See CreateDeploymentCommandInput for more details

Parameter
Type
Description
ApiId
Required
string | undefined

The API identifier.

Description
string | undefined

The description for the deployment resource.

StageName
string | undefined

The name of the Stage resource for the Deployment resource to create.

CreateDeploymentCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
AutoDeployed
boolean | undefined

Specifies whether a deployment was automatically released.

CreatedDate
Date | undefined

The date and time when the Deployment resource was created.

DeploymentId
string | undefined

The identifier for the deployment.

DeploymentStatus
DeploymentStatus | undefined

The status of the deployment: PENDING, FAILED, or SUCCEEDED.

DeploymentStatusMessage
string | undefined

May contain additional feedback on the status of an API deployment.

Description
string | undefined

The description for the deployment.

Throws

Name
Fault
Details
BadRequestException
client

The request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.

ConflictException
client

The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.

NotFoundException
client

The resource specified in the request was not found. See the message field for more information.

TooManyRequestsException
client

A limit has been exceeded. See the accompanying error message for details.

ApiGatewayV2ServiceException
Base exception class for all service exceptions from ApiGatewayV2 service.