diff --git a/src/pages/gen2/build-a-backend/data/connect-to-API/index.mdx b/src/pages/gen2/build-a-backend/data/connect-to-API/index.mdx index 2f3ff476064..2dd7144163b 100644 --- a/src/pages/gen2/build-a-backend/data/connect-to-API/index.mdx +++ b/src/pages/gen2/build-a-backend/data/connect-to-API/index.mdx @@ -101,7 +101,7 @@ import { generateClient } from 'aws-amplify/data'; import type { Schema } from '../amplify/data/resource'; // Path to your backend resource definition const client = generateClient({ - authMode: 'iam', + authMode: 'identityPool', }); ``` @@ -166,7 +166,7 @@ const { data: todos, errors } = await client.models.Todo.list({ ```ts const { data: todos, errors } = await client.models.Todo.list({ - authMode: 'iam', + authMode: 'identityPool', }); ``` diff --git a/src/pages/gen2/build-a-backend/data/customize-authz/grant-lambda-function-access-to-api/index.mdx b/src/pages/gen2/build-a-backend/data/customize-authz/grant-lambda-function-access-to-api/index.mdx index fe27464ab15..89040f9bd96 100644 --- a/src/pages/gen2/build-a-backend/data/customize-authz/grant-lambda-function-access-to-api/index.mdx +++ b/src/pages/gen2/build-a-backend/data/customize-authz/grant-lambda-function-access-to-api/index.mdx @@ -94,7 +94,7 @@ Amplify.configure( GraphQL: { endpoint: env._GRAPHQL_ENDPOINT, // replace with your defineData name region: env.AWS_REGION, - defaultAuthMode: 'iam', + defaultAuthMode: 'identityPool', modelIntrospection: modelIntrospection as never } } diff --git a/src/pages/gen2/build-a-backend/data/customize-authz/index.mdx b/src/pages/gen2/build-a-backend/data/customize-authz/index.mdx index e5f3bd5a188..3776718b735 100644 --- a/src/pages/gen2/build-a-backend/data/customize-authz/index.mdx +++ b/src/pages/gen2/build-a-backend/data/customize-authz/index.mdx @@ -164,7 +164,7 @@ const { data: newPostResult , errors } = await client.models.Post.create({ // Listing posts is available to unauthenticated users (verified by Amazon Cognito identity pool's unauthenticated role) const { data: listPostsResult , errors } = await client.models.Post.list({ query: queries.listPosts, - authMode: 'iam', + authMode: 'identityPool', }); ``` diff --git a/src/pages/gen2/build-a-backend/data/customize-authz/public-data-access/index.mdx b/src/pages/gen2/build-a-backend/data/customize-authz/public-data-access/index.mdx index aa1f6aa4a1e..504a46dc68d 100644 --- a/src/pages/gen2/build-a-backend/data/customize-authz/public-data-access/index.mdx +++ b/src/pages/gen2/build-a-backend/data/customize-authz/public-data-access/index.mdx @@ -100,7 +100,7 @@ const { errors, data: newTodo } = await client.models.Todo.create( }, // highlight-start { - authMode: 'iam', + authMode: 'identityPool', } // highlight-end ); diff --git a/src/pages/gen2/build-a-backend/data/customize-authz/signed-in-user-data-access/index.mdx b/src/pages/gen2/build-a-backend/data/customize-authz/signed-in-user-data-access/index.mdx index 715ed2ae9f2..73d0263b314 100644 --- a/src/pages/gen2/build-a-backend/data/customize-authz/signed-in-user-data-access/index.mdx +++ b/src/pages/gen2/build-a-backend/data/customize-authz/signed-in-user-data-access/index.mdx @@ -64,7 +64,7 @@ const schema = a.schema({ .model({ content: a.string(), }) - .authorization(allow => [allow.authenticated('iam')]), + .authorization(allow => [allow.authenticated('identityPool')]), }); ``` @@ -86,7 +86,7 @@ const { errors, data: newTodo } = await client.models.Todo.create( }, // highlight-start { - authMode: 'iam', + authMode: 'identityPool', } // highlight-end );