UpdateApp - Amplify

UpdateApp

Updates an existing Amplify app.

Request Syntax

POST /apps/appId HTTP/1.1 Content-type: application/json { "accessToken": "string", "autoBranchCreationConfig": { "basicAuthCredentials": "string", "buildSpec": "string", "enableAutoBuild": boolean, "enableBasicAuth": boolean, "enablePerformanceMode": boolean, "enablePullRequestPreview": boolean, "environmentVariables": { "string" : "string" }, "framework": "string", "pullRequestEnvironmentName": "string", "stage": "string" }, "autoBranchCreationPatterns": [ "string" ], "basicAuthCredentials": "string", "buildSpec": "string", "customHeaders": "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" }

URI Request Parameters

The request uses the following URI parameters.

appId

The unique ID for an Amplify app.

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

Pattern: d[a-z0-9]+

Required: Yes

Request Body

The request accepts the following data in JSON format.

accessToken

The personal access token for a GitHub repository for an Amplify app. The personal access token is used to authorize access to a GitHub repository using the Amplify GitHub App. The token is not stored.

Use accessToken for GitHub repositories only. To authorize access to a repository provider such as Bitbucket or CodeCommit, use oauthToken.

You must specify either accessToken or oauthToken when you update an app.

Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see Migrating an existing OAuth app to the Amplify GitHub App in the Amplify User Guide .

Type: String

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

Pattern: (?s).+

Required: No

autoBranchCreationConfig

The automated branch creation configuration for an Amplify app.

Type: AutoBranchCreationConfig object

Required: No

autoBranchCreationPatterns

Describes the automated branch creation glob patterns for an Amplify app.

Type: Array of strings

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

Pattern: (?s).+

Required: No

basicAuthCredentials

The basic authorization credentials for an Amplify app. You must base64-encode the authorization credentials and provide them in the format user:password.

Type: String

Length Constraints: Maximum length of 2000.

Pattern: (?s).*

Required: No

buildSpec

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

Type: String

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

Pattern: (?s).+

Required: No

customHeaders

The custom HTTP headers for an Amplify app.

Type: String

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

Pattern: (?s).*

Required: No

customRules

The custom redirect and rewrite 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.

Pattern: (?s).*

Required: No

enableAutoBranchCreation

Enables automated branch creation for an Amplify app.

Type: Boolean

Required: No

enableBasicAuth

Enables basic authorization for an Amplify app.

Type: Boolean

Required: No

enableBranchAutoBuild

Enables branch auto-building 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 for an Amplify app.

Type: String to string map

Key Length Constraints: Maximum length of 255.

Key Pattern: (?s).*

Value Length Constraints: Maximum length of 5500.

Value Pattern: (?s).*

Required: No

iamServiceRoleArn

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

Type: String

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

Pattern: (?s).*

Required: No

name

The name for an Amplify app.

Type: String

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

Pattern: (?s).+

Required: No

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 using SSH cloning. The OAuth token is not stored.

Use oauthToken for repository providers other than GitHub, such as Bitbucket or CodeCommit.

To authorize access to GitHub as your repository provider, use accessToken.

You must specify either oauthToken or accessToken when you update an app.

Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see Migrating an existing OAuth app to the Amplify GitHub App in the Amplify User Guide .

Type: String

Length Constraints: Maximum length of 1000.

Pattern: (?s).*

Required: No

platform

The platform for the Amplify app. For a static app, set the platform type to WEB. For a dynamic server-side rendered (SSR) app, set the platform type to WEB_COMPUTE. For an app requiring Amplify Hosting's original SSR support only, set the platform type to WEB_DYNAMIC.

Type: String

Valid Values: WEB | WEB_DYNAMIC | WEB_COMPUTE

Required: No

repository

The name of the Git repository for an Amplify app.

Type: String

Length Constraints: Maximum length of 1000.

Pattern: (?s).*

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, "enablePerformanceMode": boolean, "enablePullRequestPreview": boolean, "environmentVariables": { "string" : "string" }, "framework": "string", "pullRequestEnvironmentName": "string", "stage": "string" }, "autoBranchCreationPatterns": [ "string" ], "basicAuthCredentials": "string", "buildSpec": "string", "createTime": number, "customHeaders": "string", "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", "repositoryCloneMethod": "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 updated 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

InternalFailureException

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

HTTP Status Code: 500

NotFoundException

An entity was not found during an operation.

HTTP Status Code: 404

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: