[ aws . amplifygen3 . app ]

edit

Description

Display or update app-level settings for an Amplify app. The app name is resolved the same way as aws amplifygen3 app create: –app, then amplify.jsonc, then package.json, then the current directory name. The first non-empty source wins.

With no settable flags, starts an interactive prompt to pick and change settings. In CI (CI=true), where that prompt can’t run, the command fails instead of silently doing nothing; pass a setting flag, or run aws amplifygen3 app get to view current settings. With one or more settable flags, applies them all in a single update and prints a confirmation. This command never modifies amplify.jsonc.

Build-setting flags (–install-command, –build-command, –output-dir, –root-dir) apply to the whole app, not a single environment, and a value in amplify.jsonc overrides them at deploy time.

Git flags (–git, –git-branch, –git-owner) connect the app to a git repository, change an existing connection, or remove it. Connecting or changing it also sets the branches the production and preview environments deploy from: production deploys the production branch, and preview deploys every other branch. Removing it reverts the app to local-asset deploys, pushes no longer deploy, and the environments stop tracking branches.

–backend adds a backend to the app or (with –allow-destroy) removes it. It changes only the cloud app: run aws amplifygen3 local init --type fullstack to add the backend block to amplify.jsonc and create the placeholder files.

Synopsis

  edit
[--app <value>]
[--config <value>]
[--install-command <value>]
[--build-command <value>]
[--output-dir <value>]
[--root-dir <value>]
[--git <value>]
[--git-branch <value>]
[--git-owner <value>]
[--backend <value>]
[--allow-destroy]
[--firewall-web-acl <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]

Options

--app (string) App name. If omitted, the name is read from the config file (amplify.jsonc by default, see –config), then package.json in the current directory, then the current directory name. Shorthand: -a.

--config (string) Path to the configuration file to read the app name from when –app is not passed. Defaults to amplify.jsonc in the current directory.

--install-command (string) App-level install command (e.g., npm ci), used for every environment unless overridden by amplify.jsonc at deploy time.

--build-command (string) App-level build command (e.g., npm run build), used for every environment unless overridden by amplify.jsonc at deploy time.

--output-dir (string) App-level build output directory (e.g., .amplify), used for every environment unless overridden by amplify.jsonc at deploy time.

--root-dir (string) App root directory inside a monorepo (e.g., apps/web). Pass “” to clear it back to the framework default.

--git (string) Connect the app to a git repository, switch an already-connected app to a different one, or pass “” to disconnect it. Pass “.” to infer the URL from the local git remotes, or pass an explicit URL. SSH URLs are normalized to HTTPS automatically. Connecting or switching also sets the production environment to deploy the production branch and the preview environment to deploy every other branch, replacing the branches they tracked before. Without –git-branch, the production branch is the stored one for the same repository, and the repository’s default branch for a different one (main if it can’t be read). To track other branches afterwards, use amplifygen3 env edit --git-branch. Disconnecting stops pushes from deploying, and every environment stops tracking branches.

--git-branch (string) The app’s production branch (e.g., main). Requires the app to already be connected, or connected via –git in the same command. Also sets the production environment to deploy this branch and the preview environment to deploy every other branch. A single branch name, not a pattern. To track other branches, use amplifygen3 env edit --git-branch.

--git-owner (string) GitLab account that owns the repository passed to –git. The account must be connected to Amplify and able to access the repository; if it is not, the command says how to connect one that is. Requires –git, so to switch to another account, pass the repository again with it. Without this flag, Amplify asks which account to use, which it can’t do when several GitLab accounts are connected and CI=true. Ignored for GitHub repositories.

--backend (string) ‘add’ or ‘remove’. ‘add’ gives the app a backend: a database and sign-in for every environment, created in a few minutes. ‘remove’ deletes the backend, with the database and sign-in users of every environment, production included, and cannot be undone. It needs –allow-destroy and cannot be combined with other settings. Local files, amplify.jsonc included, are not changed: run aws amplifygen3 local init --type fullstack to add the backend block, and remove the block after removing the backend, or the next deploy adds one again.

  • add
  • remove

--allow-destroy (boolean) Confirm that –backend remove may delete the app’s backend, with the database and sign-in users of every environment. Required for –backend remove, and rejected without it. There is no prompt, so this flag is the confirmation.

--firewall-web-acl (string) ARN of the AWS WAF web ACL to use as the app’s firewall. Must be a global (CloudFront-scope) web ACL. Pass “” to remove it. Applied separately from the other settings here, so it can succeed or fail on its own. Calls AWS WAF directly, so it needs wafv2:AssociateWebACL (or wafv2:DisassociateWebACL to remove) in addition to the Amplify permissions the other settings use.

Global Options

--debug (boolean)

Turn on debug logging.

--endpoint-url (string)

Override command’s default URL with the given URL.

--no-verify-ssl (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

--no-paginate (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

--output (string)

The formatting style for command output.

  • json
  • text
  • table
  • yaml
  • yaml-stream
  • off

--query (string)

A JMESPath query to use in filtering the response data.

--profile (string)

Use a specific profile from your credential file.

--region (string)

The region to use. Overrides config/env settings.

--version (string)

Display the version of this tool.

--color (string)

Turn on/off color output.

  • on
  • off
  • auto

--no-sign-request (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

--ca-bundle (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

--cli-read-timeout (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

--cli-connect-timeout (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

--cli-binary-format (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.

  • base64
  • raw-in-base64-out

--no-cli-pager (boolean)

Disable cli pager for output.

--cli-auto-prompt (boolean)

Automatically prompt for CLI input parameters.

--no-cli-auto-prompt (boolean)

Disable automatically prompt for CLI input parameters.

--cli-error-format (string)

The formatting style for error output. By default, errors are displayed in enhanced format.

  • legacy
  • json
  • yaml
  • text
  • table
  • enhanced

--help (boolean)

Display help for the command/subcommand.

Examples

Note

To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

Example 1: To change an app’s build settings

The following app edit example changes the install and build commands. Each flag you pass is reported back. The new settings apply to the next deployment.

aws amplifygen3 app edit \
    --app my-app \
    --install-command "npm ci" \
    --build-command "npm run build"

Output:

App updated:
  - install-command: npm ci
  - build-command: npm run build

Example 2: To clear a setting

The following app edit example clears the root directory by passing an empty string, so builds run from the repository root again.

aws amplifygen3 app edit \
    --app my-app \
    --root-dir ""

Output:

App updated:
  - root-dir: (cleared -- falls back to framework default)

Example 3: To add a backend

The following app edit example adds a backend to the app. The command changes only the cloud app; run aws amplifygen3 local init --type fullstack to add the backend block to amplify.jsonc.

aws amplifygen3 app edit \
    --app my-app \
    --backend add

Output:

App updated:
  - backend: added
    The backend is being created. Run 'aws amplifygen3 app get' to check its status.

Example 4: To remove a backend

The following app edit example removes the app’s backend. This deletes the database and sign-in users of every environment and cannot be undone, so the command requires --allow-destroy. Remove the backend block from amplify.jsonc too, or the next deploy adds a new backend.

aws amplifygen3 app edit \
    --app my-app \
    --backend remove \
    --allow-destroy

Output:

Backend removal requested for app 'my-app'. Run 'aws amplifygen3 app get' to check its status.
This deletes the database and sign-in users of: preview, production.