Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/next-release/main' into amplif…
Browse files Browse the repository at this point in the history
…yconfiguration-to-outputs
  • Loading branch information
josefaidt committed May 2, 2024
2 parents 5e423c4 + a0425ed commit a9ddc9c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ This will generate the `amplify_outputs.json` file that contains all the informa

4. To validate that your frontend can connect to the backend, add the `Authenticator` login form to your app.

```ts
// pages/_app.tsx
```ts title="pages/_app.tsx"
import { withAuthenticator } from '@aws-amplify/ui-react';
import { Amplify } from 'aws-amplify';
import outputs from '@/amplify_outputs.json';
Expand Down Expand Up @@ -150,7 +149,7 @@ aws amplify create-webhook --app-id FRONTEND-APPID --branch-name main --region

1. Now update the build settings for the `backend-app` to include the `curl` command to trigger a frontend build any time there are changes to the backend.

``` yaml
```yaml title="amplify.yml"
version: 1
backend:
phases:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ Alternatively, if you want to generate the config for a branch environment to te
For Web and React Native, generating the config with the default format and output directory.

```bash title="Terminal" showLineNumbers={false}
npx ampx generate config --app-id <app-id> --branch main
npx ampx generate outputs --app-id <app-id> --branch main
```
</InlineFilter>
<InlineFilter filters={['flutter']}>
```bash title="Terminal" showLineNumbers={false}
npx ampx generate config --app-id <app-id> --branch main --format dart --out-dir lib
npx ampx generate outputs --app-id <app-id> --branch main --format dart --out-dir lib
```
</InlineFilter>
<InlineFilter filters={['android']}>
Expand All @@ -240,7 +240,7 @@ npx ampx generate outputs --app-id <app-id> --branch main --out-dir app/src/main
<InlineFilter filters={['swift']}>

```bash title="Terminal" showLineNumbers={false}
npx ampx generate config --app-id <app-id> --format json-mobile
npx ampx generate outputs --app-id <app-id> --format json-mobile
```

Once the sandbox environment is running, it will generate the backend outputs file for your frontend application. However, Xcode won't be able to recognize them. For recognizing the files, you need to drag and drop the generated files to your project.
Expand Down
2 changes: 1 addition & 1 deletion src/pages/[platform]/reference/amplify_outputs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function getStaticProps() {

In Amplify Gen 2, the CLI will generate an `amplify_outputs.json` file with your backend's outputs such as your Data endpoint and Auth metadata. This file -- also known as the "client configuration file" -- is used to configure the client libraries in order to interact with your backend resources. Locally, this file is created while using `ampx sandbox`. In Amplify's CI/CD, this is created automatically for you based on the current Amplify app ID and git branch.

You can also manually create this file for a specified Amplify app ID and branch, or an AWS CloudFormation stack name with [`ampx generate config`](/[platform]/reference/cli-commands#npx-ampx-generate-config).
You can also manually create this file for a specified Amplify app ID and branch, or an AWS CloudFormation stack name with [`ampx generate outputs`](/[platform]/reference/cli-commands#npx-ampx-generate-outputs).

{/* @TODO full type/interface to reference */}

Expand Down

0 comments on commit a9ddc9c

Please sign in to comment.