CreateApp - AWS Amplify

CreateApp

Creates a new Amplify app.

Request Syntax

POST /apps HTTP/1.1 Content-type: application/json { "accessToken": "string", "autoBranchCreationConfig": { "basicAuthCredentials": "string", "buildSpec": "string", "enableAutoBuild": boolean, "enableBasicAuth": boolean, "enablePullRequestPreview": boolean, "environmentVariables": { "string" : "string" }, "framework": "string", "pullRequestEnvironmentName": "string", "stage": "string" }, "autoBranchCreationPatterns": [ "string" ], "basicAuthCredentials": "string", "buildSpec": "string", "customRules": [ { "condition": "string", "source": "string", "status": "string", "target": "string" } ], "description": "string", "enableAutoBranchCreation": boolean, "enableBasicAuth": boolean, "enableBranchAutoBuild": boolean, "enableBranchAutoDeletion": boolean, "environmentVariables": { "string" : "string" }, "iamServiceRoleArn": "string", "name": "string", "oauthToken": "string", "platform": "string", "repository": "string", "tags": { "string" : "string" } }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

accessToken

The personal access token for a third-party source control system for an Amplify app. The personal access token is used to create a webhook and a read-only deploy key. The token is not stored.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 255.

Required: No

autoBranchCreationConfig

The automated branch creation configuration for the Amplify app.

Type: AutoBranchCreationConfig object

Required: No

autoBranchCreationPatterns

The automated branch creation glob patterns for the Amplify app.

Type: Array of strings

Length Constraints: Minimum length of 1. Maximum length of 2048.

Required: No

basicAuthCredentials

The credentials for basic authorization for an Amplify app.

Type: String

Length Constraints: Maximum length of 2000.

Required: No

buildSpec

The build specification (build spec) for an Amplify app.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 25000.

Required: No

customRules

The custom rewrite and redirect rules for an Amplify app.

Type: Array of CustomRule objects

Required: No

description

The description for an Amplify app.

Type: String

Length Constraints: Maximum length of 1000.

Required: No

enableAutoBranchCreation

Enables automated branch creation for the Amplify app.

Type: Boolean

Required: No

enableBasicAuth

Enables basic authorization for an Amplify app. This will apply to all branches that are part of this app.

Type: Boolean

Required: No

enableBranchAutoBuild

Enables the auto building of branches for an Amplify app.

Type: Boolean

Required: No

enableBranchAutoDeletion

Automatically disconnects a branch in the Amplify Console when you delete a branch from your Git repository.

Type: Boolean

Required: No

environmentVariables

The environment variables map for an Amplify app.

Type: String to string map

Key Length Constraints: Maximum length of 255.

Value Length Constraints: Maximum length of 1000.

Required: No

iamServiceRoleArn

The AWS Identity and Access Management (IAM) service role for an Amplify app.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1000.

Required: No

name

The name for the Amplify app.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 255.

Required: Yes

oauthToken

The OAuth token for a third-party source control system for an Amplify app. The OAuth token is used to create a webhook and a read-only deploy key. The OAuth token is not stored.

Type: String

Length Constraints: Maximum length of 100.

Required: No

platform

The platform or framework for an Amplify app.

Type: String

Valid Values: WEB

Required: No

repository

The repository for an Amplify app.

Type: String

Length Constraints: Maximum length of 1000.

Required: No

tags

The tag for an Amplify app.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^(?!aws:)[a-zA-Z+-=._:/]+$

Value Length Constraints: Maximum length of 256.

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "app": { "appArn": "string", "appId": "string", "autoBranchCreationConfig": { "basicAuthCredentials": "string", "buildSpec": "string", "enableAutoBuild": boolean, "enableBasicAuth": boolean, "enablePullRequestPreview": boolean, "environmentVariables": { "string" : "string" }, "framework": "string", "pullRequestEnvironmentName": "string", "stage": "string" }, "autoBranchCreationPatterns": [ "string" ], "basicAuthCredentials": "string", "buildSpec": "string", "createTime": number, "customRules": [ { "condition": "string", "source": "string", "status": "string", "target": "string" } ], "defaultDomain": "string", "description": "string", "enableAutoBranchCreation": boolean, "enableBasicAuth": boolean, "enableBranchAutoBuild": boolean, "enableBranchAutoDeletion": boolean, "environmentVariables": { "string" : "string" }, "iamServiceRoleArn": "string", "name": "string", "platform": "string", "productionBranch": { "branchName": "string", "lastDeployTime": number, "status": "string", "thumbnailUrl": "string" }, "repository": "string", "tags": { "string" : "string" }, "updateTime": number } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

app

Represents the different branches of a repository for building, deploying, and hosting an Amplify app.

Type: App object

Errors

For information about the errors that are common to all actions, see Common Errors.

BadRequestException

A request contains unexpected data.

HTTP Status Code: 400

DependentServiceFailureException

An operation failed because a dependent service threw an exception.

HTTP Status Code: 503

InternalFailureException

The service failed to perform an operation due to an internal issue.

HTTP Status Code: 500

LimitExceededException

A resource could not be created because service quotas were exceeded.

HTTP Status Code: 429

UnauthorizedException

An operation failed due to a lack of access.

HTTP Status Code: 401

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: