View a markdown version of this page

Deploy with AI coding agents - AWS Amplify

Deploy with AI coding agents

AWS Amplify has a skill for AI coding agents, such as Kiro CLI and Claude Code. The skill teaches the agent the Amplify CLI commands to create, deploy, and manage your app. You describe what you want, and the agent runs the commands. This page lists the exact commands, so you or your agent can follow them.

Prerequisites

Before you start, make sure that you have the following:

  • AWS credentials for your AWS account

  • Node.js 22.12 or later, and npm 10 or later

  • The latest version of the AWS Command Line Interface (AWS CLI) v2

  • Permissions for Amplify

For how to set up each item and give your account permissions, see Tutorial: Deploy a website.

To check your AWS credentials, run the following AWS CLI command:

aws sts get-caller-identity

If the command prints your account ID and Amazon Resource Name (ARN), your credentials are valid. If it fails, your credentials are missing or expired. Sign in again, as described in Tutorial: Deploy a website.

Step 1: Install the AWS CLI

If your agent installs the CLI for you, skip this step.

Install or update to the latest AWS CLI v2 by following the Installing or updating to the latest version of the AWS CLI in the AWS CLI User Guide. The AWS CLI includes the aws amplifygen3 subcommand for creating, deploying, and managing Amplify apps.

Run the following command to verify the installation:

aws amplifygen3 help

You should see a list of commands that includes create and deploy.

Step 2: Install the Amplify skill

Run the following AWS Agent Toolkit command to install the skill:

aws agent-toolkit add-skill --skill-name aws-amplify

After you install the skill, restart your agent.

Step 3: Ask your agent to deploy your app

In your app folder, give your agent a prompt such as the following:

Deploy my app to Amplify and give me the preview URL.

The agent runs Amplify CLI commands such as the following:

  1. To create your app:

    Replace my-app with the name of your app.

    aws amplifygen3 create --name my-app

    This command creates the app and writes the amplify.jsonc configuration file to your app folder. If the folder already has an amplify.jsonc file, the agent uses it instead of running create.

  2. To deploy your app:

    aws amplifygen3 deploy

    This command deploys your app to the preview environment. The agent gives you the URL from the Visit line of the command output, such as the following:

    Visit:    https://preview-ab12--my-app.amplify.app/

To avoid keeping resources that you don’t need, delete the app when you finish. For the commands, see Clean up.

Step 4: Ask your agent to add a backend

If your app needs a database, or users who sign up and sign in, your agent can add a backend. A backend has three parts: Database, Auth, and Data API. Auth is authentication, authorization, and user management, built into your backend.

Your agent can add the backend, write its tables as migrations, run it on your computer, and deploy it. To run the backend on your computer, the CLI uses Docker by default, so install Docker and start it. To use Finch instead, start Finch. Then set the AWS_AMPLIFY_CONTAINER_RUNTIME environment variable to finch, or add "containerRuntime": "finch" to amplify.local.json.

In your app folder, give your agent a prompt such as the following:

Add a backend to my app so that users can sign up and sign in with an email and password. Each user sees only their own notes. Run it locally and show me that it works.

The agent runs Amplify CLI commands such as the following:

  1. To add a backend to your app:

    aws amplifygen3 local backend add

    This command turns on the backend block in amplify.jsonc and creates the migrations/ and .secrets/ folders. In a project with a package.json file, it also installs the client SDK. If your folder has no amplify.jsonc file yet, the agent runs aws amplifygen3 local init --type fullstack instead.

  2. To run the backend and your app on your computer:

    aws amplifygen3 local run

    This command starts the backend in Docker or Finch and applies your migrations. Then it starts your app’s dev server.

  3. To create a table:

    aws amplifygen3 local migration create --description "create notes"

    The agent writes the table, its grants, and its row-level security (RLS) policies in the new migration file. Then it applies the migration with aws amplifygen3 local migration apply.

  4. To deploy your app and its backend:

    aws amplifygen3 deploy

    This command deploys to the preview environment. Your first deployment from the CLI creates the backend and applies your migrations.

You can also give your agent prompts such as the following:

Add a due_date column to the notes table with a new migration, try it locally, and deploy it to preview.
Show me how much database compute my app's backend used this month, and list the branches of my preview environment.

For the last prompt, your agent gets the usage from aws amplifygen3 app get and the branches from aws amplifygen3 branch list --env preview.

For more information, see Backend.

Commit amplify.jsonc to your repository

amplify.jsonc is the file to commit to your repository. It holds your app’s build settings, so your teammates and their agents deploy the app the same way.

  • Don’t put environment variables or secrets in amplify.jsonc. Set them with aws amplifygen3 var set instead. For more information, see Environment variables and secrets.

  • Don’t commit the .amplify/ folder. It’s build output, and aws amplifygen3 create adds it to your .gitignore file.

  • If your app has a backend, also commit the migrations/ folder. Don’t commit .secrets/ or amplify.local.json, which hold your local database password and this computer’s local state. aws amplifygen3 local backend add adds both to your .gitignore file.

For more information about amplify.jsonc, see Configuration file.

What your agent asks before it acts

The Amplify skill tells your agent to ask you and wait for your yes before it does the following:

  • Deploys to the production environment (aws amplifygen3 deploy --env production)

  • Deletes an app, environment, integration, or domain

  • Turns off access control for an environment (aws amplifygen3 access-control disable), which makes every deployment in that environment public

  • Disconnects your Git repository (aws amplifygen3 app edit --git ""), which stops Git deploys for every environment

  • Deletes the backend, with every branch in every environment, including production. To delete it, your agent removes the backend block from amplify.jsonc and then runs aws amplifygen3 deploy --allow-destroy.

    Delete the backend?

    Deleting the backend also deletes each branch’s database, its automated backups, and its users. The aws amplifygen3 app edit --backend remove --allow-destroy command deletes the backend the same way, without a prompt.

  • Deletes a backend branch and its data (aws amplifygen3 branch delete). The command refuses the production branch. It also refuses the branch that your live deployment uses, unless the agent adds --allow-deployed-branch.

  • Deletes a user of your app, with the user’s sessions (aws amplifygen3 backend user delete)

  • Creates or edits a user for your app in the production environment (aws amplifygen3 backend user create or aws amplifygen3 backend user edit)

  • Revokes a publishable key (aws amplifygen3 backend publishable-key revoke), which turns the key off for good. If your live deployment uses the key, you also pass --allow-deployed-key. In that case, your app’s backend requests fail until the next successful deployment.

  • Deletes a network connector, which disconnects your app from the resources in your VPC

  • Resets or deletes the local backend and its data (aws amplifygen3 local reset or aws amplifygen3 local destroy)

In an agent session, a command that asks you to confirm stops before it changes anything, unless the agent adds --yes. Your agent adds --yes only after you say yes. For more information about what each command deletes, see Backend.

Common commands

The following table lists Amplify CLI commands that you or your agent can use.

Command Description

aws amplifygen3 create --name my-app

Create an app and write amplify.jsonc

aws amplifygen3 deploy

Deploy your app to the preview environment

aws amplifygen3 deploy --env production

Deploy your app to the production environment

aws amplifygen3 app list

List your apps

aws amplifygen3 app get --app my-app

Show details for an app

aws amplifygen3 env list

List an app’s environments

aws amplifygen3 env create --name staging

Create an environment

aws amplifygen3 integration list

List your integrations

aws amplifygen3 var set KEY value

Set an environment variable

aws amplifygen3 domain add www.example.com --env production

Add a custom domain to an environment

aws amplifygen3 logs get

Get your app’s runtime logs

For every command and option, see the CLI reference. For the frameworks that Amplify supports, see Frameworks.

Clean up

To avoid keeping resources that you don’t need, delete the app when you finish.

Deleting the app is permanent

Deleting the app also deletes all of its environments and its backend, including every branch’s database and users. This action can’t be undone.

To delete the app and all of its environments, run the following command. Replace my-app with the name of your app.

aws amplifygen3 app delete --app my-app --yes

The app delete command doesn’t delete integrations. To delete an integration, run aws amplifygen3 integration delete --name integration-name, replacing integration-name with the name of your integration.

Next steps

After your agent deploys your app, you can do the following: