Skip to content

chore(appsync): improve error message for missing iam authorization mode#33501

Merged
mergify[bot] merged 7 commits intoaws:mainfrom
garysassano:fix-msg
Feb 22, 2025
Merged

chore(appsync): improve error message for missing iam authorization mode#33501
mergify[bot] merged 7 commits intoaws:mainfrom
garysassano:fix-msg

Conversation

@garysassano
Copy link
Copy Markdown
Contributor

Issue # (if applicable)

Closes #33465

Reason for this change

The error message when using grant methods like grantPublish() and grantSubscribe() on an Event API without IAM authorization mode needs improvement. Currently, users get a confusing error without clear guidance on how to fix it.

The error should clearly explain:

  1. Why the operation failed (you tried to use a grant method on an Event API with missing IAM authorization mode)
  2. How to fix it (add IAM authorization mode to the auth providers list)

Description of changes

Rephrased the error message.

Describe any new or updated permissions being added

Description of how you validated changes

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Feb 19, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team February 19, 2025 03:14
@gshpychka
Copy link
Copy Markdown
Contributor

Seems like the PR includes a lot of formatting changes, which are not compatible with the linting setup in the repo.

@garysassano garysassano force-pushed the fix-msg branch 2 times, most recently from 1c05580 to c8ee4db Compare February 20, 2025 01:13
@gshpychka
Copy link
Copy Markdown
Contributor

You will need to change this test as well: https://github.com/garysassano/aws-cdk/blob/8b20e712a35ae7b5150bbfabfc94246ae4307745/packages/aws-cdk-lib/aws-appsync/test/appsync-eventapi.test.ts#L364

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Feb 20, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.17%. Comparing base (8494ad0) to head (6f29677).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33501   +/-   ##
=======================================
  Coverage   82.17%   82.17%           
=======================================
  Files         119      119           
  Lines        6862     6862           
  Branches     1158     1158           
=======================================
  Hits         5639     5639           
  Misses       1120     1120           
  Partials      103      103           
Flag Coverage Δ
suite.unit 82.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk ∅ <ø> (∅)
packages/aws-cdk-lib/core 82.17% <ø> (ø)

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 6f29677
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Feb 22, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 63ec7f9 into aws:main Feb 22, 2025
21 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/medium Medium work item – several days of effort p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-appsync: EventApi forces you to include IAM Authorization mode

4 participants