Skip to content

Commit 2a4a772

Browse files
committed
docs: fix IAM auth provider prerequisite section
Change admin role pattern from appId to first 10 characters of app name to match Gen2 role naming. Explain that after refactor the Gen2 auth role is external to the Gen1 API and needs admin role configuration. --- Prompt: Fix GraphQL IAM auth provider section to use app name (first 10 chars) instead of appId and explain external role concept.
1 parent 9e6f490 commit 2a4a772

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

GEN2_MIGRATION_GUIDE.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,23 +147,24 @@ type Todo @model @auth(rules: [{ allow: private, provider: iam }]) {
147147
}
148148
```
149149

150-
Clients access such models using the `AuthRole` configured on the identity pool.
151-
After the refactor operation, the role is updated to point to the Gen2 role, which doesn't
152-
allow access to the Gen1 AppSync API. This means that after refactor your **Gen1** environment will
153-
lose IAM access to the API (but **Gen2** will work correctly).
150+
Clients access such models using the `AuthRole` configured on the identity pool. After refactor,
151+
the identity pool's `AuthRole` is updated to point to the Gen2 role. Since this role is external
152+
to the Gen1 AppSync API, it is denied access by default. Your **Gen2** environment will work
153+
correctly, but your **Gen1** environment will lose IAM access to the API.
154154

155-
To workaround this issue, you must pre allow the Gen2 `AuthRole` by [configuring a custom admin role](https://docs.amplify.aws/gen1/javascript/build-a-backend/graphqlapi/customize-authorization-rules/#use-iam-authorization-within-the-appsync-console) on the Gen1 API.
155+
To workaround this, [configure a custom admin role](https://docs.amplify.aws/gen1/javascript/build-a-backend/graphqlapi/customize-authorization-rules/#use-iam-authorization-within-the-appsync-console)
156+
on the Gen1 API that matches the Gen2 `AuthRole` naming pattern:
156157

157158
`+ ./amplify/api/<api-name>/custom-roles.json`
158159

159160
```json
160161
{
161-
"adminRoleNames": ["amplify-${appId}"]
162+
"adminRoleNames": ["amplify-${appName}"]
162163
}
163164
```
164165

165-
> Where `${appId}` should be replaced with the value of the Gen1 application id. This role name follows
166-
> the Gen2 `AuthRole` naming pattern and therefore allows access to **any** Gen2 environment (branch).
166+
> Where `${appName}` is the first 10 characters of your Gen1 application name. Gen2 role names
167+
> are trimmed to this prefix, so this pattern allows access from **any** Gen2 environment (branch).
167168

168169
Once added, redeploy the app by running `amplify push`.
169170

0 commit comments

Comments
 (0)