diff --git a/src/pages/gen2/build-a-backend/add-aws-services/rest-api/index.mdx b/src/pages/gen2/build-a-backend/add-aws-services/rest-api/index.mdx index e467660ab29..f83834482e2 100644 --- a/src/pages/gen2/build-a-backend/add-aws-services/rest-api/index.mdx +++ b/src/pages/gen2/build-a-backend/add-aws-services/rest-api/index.mdx @@ -40,8 +40,8 @@ export const handler: APIGatewayProxyHandlerV2 = async (event) => { Lets create API Gateway REST API with AWS Lambda proxy integration using AWS CDK and add the function. ```ts title="amplify/backend.ts" -import { myFunction } from "./functions/my-function/resource"; import { LambdaRestApi } from "aws-cdk-lib/aws-apigateway"; +import { myFunction } from "./functions/my-function/resource"; const backend = defineBackend({ auth, @@ -73,8 +73,8 @@ To initialize the REST API you need to configure Amplify with `Amplify.configure ```tsx title="pages/index.tsx" import { Amplify } from 'aws-amplify'; -import amplifyconfig from './src/amplifyconfiguration.json'; -Amplify.configure(amplifyconfig): +import outputs from '../amplify_outputs.json'; +Amplify.configure(outputs): const existingConfig = Amplify.getConfig(); diff --git a/src/pages/gen2/build-a-backend/auth/set-up-auth/index.mdx b/src/pages/gen2/build-a-backend/auth/set-up-auth/index.mdx index 11cacf6e8fc..2e06b723957 100644 --- a/src/pages/gen2/build-a-backend/auth/set-up-auth/index.mdx +++ b/src/pages/gen2/build-a-backend/auth/set-up-auth/index.mdx @@ -118,7 +118,7 @@ After you have chosen and set up your authentication resource, run the following npx amplify sandbox ``` -After a successful deployment, this command also generates a configuration file (`amplifyconfiguration.json`) to enable your frontend app to connect to your backend resources. The values you configure in your backend authentication resource are set in the generated configuration file to automatically configure the frontend [`Authenticator connected component`](https://ui.docs.amplify.aws/react/connected-components/authenticator). +After a successful deployment, this command also generates an outputs file (`amplify_outputs.json`) to enable your frontend app to connect to your backend resources. The values you configure in your backend authentication resource are set in the generated outputs file to automatically configure the frontend [`Authenticator connected component`](https://ui.docs.amplify.aws/react/connected-components/authenticator). ## Connect your application code to the auth backend @@ -151,11 +151,11 @@ A higher-order component (HOC) is a function that takes a component and returns import type { AppProps } from "next/app"; import { withAuthenticator } from '@aws-amplify/ui-react'; import { Amplify } from 'aws-amplify'; -import config from '@/amplifyconfiguration.json'; +import outputs from '@/amplify_outputs.json'; import '@aws-amplify/ui-react/styles.css'; import type { WithAuthenticatorProps } from '@aws-amplify/ui-react'; -Amplify.configure(config); +Amplify.configure(outputs); function App({ signOut, user, Component, pageProps }: WithAuthenticatorProps & AppProps) { return ( @@ -177,10 +177,10 @@ export default withAuthenticator(App); // pages/_app.js import { withAuthenticator } from '@aws-amplify/ui-react'; import { Amplify } from 'aws-amplify'; -import config from '@/amplifyconfiguration.json'; +import outputs from '@/amplify_outputs.json'; import '@aws-amplify/ui-react/styles.css'; -Amplify.configure(config); +Amplify.configure(outputs); function App({ signOut, user }) { return ( @@ -218,9 +218,9 @@ The `Authenticator` component offers a simple way to add authentication flows in import "@aws-amplify/ui-vue/styles.css"; import { Amplify } from 'aws-amplify'; - import config from '../amplifyconfiguration.json'; + import outputs from '../amplify_outputs.json'; - Amplify.configure(config); + Amplify.configure(outputs);