Skip to content

fix: accept AWS_IAM as valid gateway authorizer type in CLI flags#842

Closed
aidandaly24 wants to merge 1 commit intoaws:mainfrom
aidandaly24:fix/gateway-aws-iam-authorizer-type
Closed

fix: accept AWS_IAM as valid gateway authorizer type in CLI flags#842
aidandaly24 wants to merge 1 commit intoaws:mainfrom
aidandaly24:fix/gateway-aws-iam-authorizer-type

Conversation

@aidandaly24
Copy link
Copy Markdown
Contributor

Description

agentcore add gateway --authorizer-type AWS_IAM was rejected with "Invalid authorizer type. Use NONE or CUSTOM_JWT", even though the interactive TUI correctly offered AWS_IAM as a selectable option.

Root cause: validateAddGatewayOptions in validate.ts used a hardcoded ['NONE', 'CUSTOM_JWT'] array instead of the Zod schema GatewayAuthorizerTypeSchema (which includes AWS_IAM). The agent validation already used the schema-based approach — only the gateway validation was out of sync.

Fix: Replace the hardcoded array with GatewayAuthorizerTypeSchema.safeParse(), matching how agent authorizer validation already works. Also updated docs/commands.md to list all three valid values.

Related Issue

Closes #819

Documentation PR

N/A — docs updated inline (docs/commands.md)

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

…s#819)

The non-interactive `--authorizer-type AWS_IAM` flag was rejected by
`validateAddGatewayOptions` because it used a hardcoded array that only
included NONE and CUSTOM_JWT. The interactive TUI accepted AWS_IAM
correctly via the Zod schema. Replace the hardcoded check with
GatewayAuthorizerTypeSchema.safeParse() to stay in sync with the schema.
@aidandaly24 aidandaly24 requested a review from a team April 14, 2026 20:23
@github-actions github-actions bot added the size/s PR size: S label Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.8.0.tgz

How to install

npm install https://github.com/aws/agentcore-cli/releases/download/pr-842-tarball/aws-agentcore-0.8.0.tgz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--authorizer-type AWS_IAM rejected by agentcore add gateway but selectable in interactive TUI

1 participant