View a markdown version of this page

Integrations - AWS Amplify

Integrations

Integrations connect your Amplify application to AWS services such as databases and AI models. An integration exposes the resource’s connection details to your app as environment variables. There are no credentials to manage and no role to assume in your application code.

How integrations work

  • You bring your own resource. An integration points to an AWS resource that already exists in your account, such as an Aurora DSQL cluster. Amplify doesn’t create, change or delete the resource.

  • Integrations belong to your account. You create an integration once and connect it to the environments of any app in the same account and Region.

  • Changes take effect on the next deployment. When you connect or disconnect an integration, the environment variables and permissions change on the next deployment of that environment.

  • Permissions are scoped to the resource. In the scoped mode, each deployment’s session policy limits your app to the actions that each connected first-party integration needs, on that resource. Amplify doesn’t add these actions to the environment’s AWS Identity and Access Management (IAM) role, so a role of your own must allow them. To see the permissions a deployment uses, run aws amplifygen3 deployment get --id <deployment-id> --output json and read SessionPolicy.

  • You can rename the variables. Use --prefix when you create an integration to add a prefix to each variable name, for example to connect two databases to the same environment.

Types of integrations

  • First-party integrations – Amplify knows the service. It sets the environment variables for you and grants your app only the permissions that it needs on the resource. Amplify supports Amazon S3, Amazon Aurora DSQL, and Amazon Bedrock.

  • Custom integrations – For any other AWS resource or a third-party service. You define the environment variables yourself.

Manage integrations with the CLI

Task Command

Create an integration and connect it to an environment

aws amplifygen3 integration connect <type> --name <name> --env <environment>

Connect an existing integration to another environment

aws amplifygen3 integration connect --name <name> --env <environment>

Disconnect an integration from an environment

aws amplifygen3 integration disconnect --name <name> --env <environment>

View an integration and its environment variables

aws amplifygen3 integration get --name <name>

List your integrations

aws amplifygen3 integration list

Delete an integration

aws amplifygen3 integration delete --name <name>

--env defaults to preview. With connect, repeat it to connect several environments, for example --env preview --env production. disconnect takes exactly one --env.

To use an integration’s variables in local development, download your environment’s variables to a dotenv file. The file includes the variables that integrations provide.

aws amplifygen3 var download .env.local --env preview