Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SendEmailAsync does not document AmazonSimpleEmailServiceV2Exception #3550

Open
lonix1 opened this issue Nov 14, 2024 · 2 comments
Open

SendEmailAsync does not document AmazonSimpleEmailServiceV2Exception #3550

lonix1 opened this issue Nov 14, 2024 · 2 comments
Labels
documentation This is a problem with documentation. module/sdk-generated p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@lonix1
Copy link

lonix1 commented Nov 14, 2024

Describe the issue

I'm using SES v2.

I used SendEmailAsync with an identity that has a default configuration set. The policy was not correct and so prevented my app from sending the mail:

This exception was thrown: AmazonSimpleEmailServiceV2Exception:

Amazon.SimpleEmailV2.AmazonSimpleEmailServiceV2Exception: User 'arn:aws:iam::000000000000:user/foo' is not authorized to perform 'ses:SendEmail' on resource `arn:aws:ses:region:000000000000:configuration-set/bar'

That exception is not documented - neither in the API docs nor in the doc-comments that show in my IDE.

Links

https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/SimpleEmailV2/MSimpleEmailServiceV2SendEmailAsyncSendEmailRequestCancellationToken.html

@lonix1 lonix1 added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Nov 14, 2024
@lonix1
Copy link
Author

lonix1 commented Nov 14, 2024

Also, that is probably not the right exception to throw in the case of a misconfiguration. A misconfigured app could send 1000s of emails before the problem is identified by a human operator.

It's a catch-all exception - "Common exception for the SimpleEmailServiceV2 service." - so the app has no way to differentiate between config errors and other errors.

@ashishdhingra
Copy link
Contributor

@lonix1 Good morning. The mentioned exception is thrown by the incorrect policy configuration per your issue description. It is the IAM issue, not SES issue. In fact any service would throw this exception if the IAM policy does not allow a role or service to invoke certain service API operations. Hence, such exceptions are not documented in specific service (in this case SES) API page. The page SESv2 > Common Errors lists the errors common to the API actions of all AWS services. It specifically states that For errors specific to an API action for this service, see the topic for that API action.. The AWS .NET SDK (or any other language SDK) and it's respective service API documentation are generated from models shared by AWS services (refer here).

In your use case, policy was misconfigured and hence it caused IAM exception which is returned as AmazonSimpleEmailServiceV2Exception since you are invoking SESv2 API operation.

Thanks,
Ashish

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. module/sdk-generated p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants