We are excited to announce the developer preview of our new API documentation for AWS SDK for JavaScript v3. Please follow instructions on the landing page to leave us your feedback.
Protected
Creates a new branch for an Amplify app.
Use a bare-bones client and the command you need to make an API call.
import { AmplifyClient, CreateBranchCommand } from "@aws-sdk/client-amplify"; // ES Modules import// const { AmplifyClient, CreateBranchCommand } = require("@aws-sdk/client-amplify"); // CommonJS importconst client = new AmplifyClient(config);const input = { // CreateBranchRequest appId: "STRING_VALUE", // required branchName: "STRING_VALUE", // required description: "STRING_VALUE", stage: "PRODUCTION" || "BETA" || "DEVELOPMENT" || "EXPERIMENTAL" || "PULL_REQUEST", framework: "STRING_VALUE", enableNotification: true || false, enableAutoBuild: true || false, environmentVariables: { // EnvironmentVariables "<keys>": "STRING_VALUE", }, basicAuthCredentials: "STRING_VALUE", enableBasicAuth: true || false, enablePerformanceMode: true || false, tags: { // TagMap "<keys>": "STRING_VALUE", }, buildSpec: "STRING_VALUE", ttl: "STRING_VALUE", displayName: "STRING_VALUE", enablePullRequestPreview: true || false, pullRequestEnvironmentName: "STRING_VALUE", backendEnvironmentArn: "STRING_VALUE",};const command = new CreateBranchCommand(input);const response = await client.send(command);// { // CreateBranchResult// branch: { // Branch// branchArn: "STRING_VALUE", // required// branchName: "STRING_VALUE", // required// description: "STRING_VALUE", // required// tags: { // TagMap// "<keys>": "STRING_VALUE",// },// stage: "PRODUCTION" || "BETA" || "DEVELOPMENT" || "EXPERIMENTAL" || "PULL_REQUEST", // required// displayName: "STRING_VALUE", // required// enableNotification: true || false, // required// createTime: new Date("TIMESTAMP"), // required// updateTime: new Date("TIMESTAMP"), // required// environmentVariables: { // EnvironmentVariables // required// "<keys>": "STRING_VALUE",// },// enableAutoBuild: true || false, // required// customDomains: [ // CustomDomains // required// "STRING_VALUE",// ],// framework: "STRING_VALUE", // required// activeJobId: "STRING_VALUE", // required// totalNumberOfJobs: "STRING_VALUE", // required// enableBasicAuth: true || false, // required// enablePerformanceMode: true || false,// thumbnailUrl: "STRING_VALUE",// basicAuthCredentials: "STRING_VALUE",// buildSpec: "STRING_VALUE",// ttl: "STRING_VALUE", // required// associatedResources: [ // AssociatedResources// "STRING_VALUE",// ],// enablePullRequestPreview: true || false, // required// pullRequestEnvironmentName: "STRING_VALUE",// destinationBranch: "STRING_VALUE",// sourceBranch: "STRING_VALUE",// backendEnvironmentArn: "STRING_VALUE",// },// };
CreateBranchCommandInput
CreateBranchCommandOutput
input
response
config
BadRequestException (client fault)
A request contains unexpected data.
DependentServiceFailureException (server fault)
An operation failed because a dependent service threw an exception.
InternalFailureException (server fault)
The service failed to perform an operation due to an internal issue.
LimitExceededException (client fault)
A resource could not be created because service quotas were exceeded.
NotFoundException (client fault)
An entity was not found during an operation.
UnauthorizedException (client fault)
An operation failed due to a lack of access.
AmplifyServiceException
Base exception class for all service exceptions from Amplify service.
Readonly
Static
Creates a new branch for an Amplify app.
Example
Use a bare-bones client and the command you need to make an API call.
Param
CreateBranchCommandInput
Returns
CreateBranchCommandOutput
See
input
shape.response
shape.config
shape.Throws
BadRequestException (client fault)
A request contains unexpected data.
Throws
DependentServiceFailureException (server fault)
An operation failed because a dependent service threw an exception.
Throws
InternalFailureException (server fault)
The service failed to perform an operation due to an internal issue.
Throws
LimitExceededException (client fault)
A resource could not be created because service quotas were exceeded.
Throws
NotFoundException (client fault)
An entity was not found during an operation.
Throws
UnauthorizedException (client fault)
An operation failed due to a lack of access.
Throws
AmplifyServiceException
Base exception class for all service exceptions from Amplify service.