Repository navigation
Conversation
Member
Author
|
Validation runs (CodeBuild), @
(IsenLinks → Readonly, account 671107461633.) |
Admin roles in custom-roles.json now match on the exact role name. The product-catalog fixture listed a name prefix, which only matched the Gen2 authenticated role through the old substring match. Pin the Gen2 authenticated role name in post-generate and list that exact name in pre-push.
amplify push now prints an advisory warning when an adminRoleNames entry in custom-roles.json does not match an IAM role name exactly: partial names (with the roles that contain them), account IDs and IAM user names. The GraphQL auth resolvers only match exact role names, so these entries grant no admin access. Lookup failures skip the entry and never fail the push.
Replace the IAM-based adminRoleNames check with a static reminder. When a pushed API has adminRoleNames entries, amplify push lists them and notes that each must be an exact IAM role name. No IAM calls, so there are no permission gaps or cross-account false warnings.
Move the adminRoleNames reminder from the provider deploy step into the CLI push flow, right before "Are you sure you want to continue?", so it can be read before deciding to push. It covers the GraphQL APIs being created or updated, or all of them for a forced push.
soberm
previously approved these changes
Dec 2, 2026
belaboe
approved these changes
Dec 2, 2026
belaboe
requested changes
Dec 2, 2026
belaboe
left a comment
Contributor
There was a problem hiding this comment.
The bump and the api_10 snapshot match upstream #3528. A few things before merge:
- Title: we squash-merge and release notes only pick up
fix/feat, so withchore:the behavior-change note won't appear. Suggestfix(cli-internal): .... - Behavior change section: it covers
custom-roles.jsononly. 5.15.7 also matches functions by execution role name (no admin access if the name can't be resolved), reduces full STS ARNs to the role name and ignores IAM role ARNs. 5.15.8 (#3558) changes field resolvers for list/search/listen/sync rules. Worth listing all of them. - Harness bullet: against
dev,app.tsdrops each function'sLambdaExecutionRoleoutput; "keeps API outputs" describes the delta from 90447e7. - product-catalog
backend/custom-roles.json(amplify-${appId}) and README lines 211-216 still use the prefix, which now matches nothing. Only the e2e pre-push overwrites it.
- push: scope the custom-roles.json reminder to the APIs in the push
(category, resource name, filtered resources), and skip only a malformed
file instead of every API.
- product-catalog: name the Gen2 authenticated role
amplify-<app>-<branch>-gen2-auth, using the unscoped package name and the
branch read at synth time (AWS_BRANCH, else the sandbox identifier), so
names contain no '/' and branches or sandboxes do not collide.
- product-catalog: backend/custom-roles.json lists that exact role name for
gen2-${env}, and the README no longer asks for an app-id prefix.
Contributor
|
Thanks for the thorough review!
|
belaboe
approved these changes
Dec 2, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bumps the bundled Gen1 API category to
@aws-amplify/amplify-category-api5.15.8 (graphql-auth-transformer3.6.18). This brings in the changes from amplify-category-api 5.15.7 and 5.15.8.Behavior changes to note in the release
These take effect for an API when its resolvers are regenerated by
amplify pushwith this CLI.From 5.15.7:
adminRoleNamesincustom-roles.jsonmust match the IAM role name exactly. Before, an entry also matched any caller whose ARN contained it (for example a prefix likeamplify-<app-id>, an account ID or an IAM user).adminRoleNamesis reduced to the role name. IAM role ARNs are ignored with a warning, since they never match the caller identity.From 5.15.8 (amplify-category-api #3558):
@authrules for list, search, listen and sync operations.Push-time reminder
When a GraphQL API in the push has
adminRoleNamesentries incustom-roles.json,amplify pushlists them and reminds that each must be an exact IAM role name. It appears before the "Are you sure you want to continue?" prompt, also prints with--yes, makes no AWS calls and never fails the push. It only covers APIs in the push scope, and a malformed file skips only that API.Test updates
api_10snapshot updated for the regenerated resolvers.amplify-e2e-gen2-migrationharness (src/core/app.ts): the restoredamplify-meta.jsondrops each function's recordedLambdaExecutionRoleoutput, so admin roles resolve to the live environment's role names.product-catalogmigration app: itscustom-roles.jsonused the prefixamplify-${appId}, which only worked through the substring match. The Gen2 authenticated role is now namedamplify-<app>-<branch>-gen2-auth(unscoped package name; branch fromAWS_BRANCHat synth time, else the sandbox identifier), andcustom-roles.jsonlists that exact name forgen2-${env}. The README no longer asks for an app-id prefix.Testing
amplify-cliunit suite passes (915 tests).pre-push.tsand in the generatedbackend.tsstatement for a Hosting branch, the e2e harness and a sandbox.