-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat(ses): add fromEmailIdentityArn #33984
base: main
Are you sure you want to change the base?
feat(ses): add fromEmailIdentityArn #33984
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This review is outdated)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33984 +/- ##
=======================================
Coverage 83.98% 83.98%
=======================================
Files 120 120
Lines 6976 6976
Branches 1178 1178
=======================================
Hits 5859 5859
Misses 1005 1005
Partials 112 112
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Exemption Request I would like to request an exemption from the requirements to update the README and integration test files, based on the following reasons:
Since this feature follows the same usage pattern and abstraction level as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an integ test and a readme please?
Please let me know if you need help with writing the test. There are few samples that can be referred from within the repo. |
@QuantumNeuralCoder Thanks for the feedback. Regarding the integration test, I will work on adding one. Since the newly added method does not create or modify any actual AWS resources—it's a static method for importing an existing resource by ARN—I initially considered its behavior sufficiently covered by unit tests. However, I understand the value of having integ test coverage for completeness and consistency, and I’ll follow up with an appropriate test case. As for the README, I’d appreciate a bit more detail on what kind of addition you’d like to see. The fromEmailIdentityArn method follows a common static import pattern used across many L2 constructs, and based on a quick review of similar modules, this type of method is often not explicitly documented unless it’s part of a usage example. Would it make sense to update an existing example in the README to use fromEmailIdentityArn instead of constructing a new resource? I’d be happy to revise the documentation accordingly once I better understand the intended scope. |
ba1ccb6
to
39fce40
Compare
}); | ||
|
||
test('import email identity by ARN fails with invalid ARN', () => { | ||
expect(() => EmailIdentity.fromEmailIdentityArn(stack, 'Identity', 'arn:aws:s3:us-west-2:123456789012:bucket/cdk.dev')).toThrow(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add the expected error message here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review, yes I have added explicitly assert thrown error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hassaku63 for submitting the change, can we add a section to Readme for this, would be helpful for the users.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Issue # (if applicable)
Closes #33981
Reason for this change
The SES module currently lacks a method to import an
EmailIdentity
by its ARN, which is inconsistent with many other CDK resource libraries. Supporting this would allow users to follow a consistent pattern when managing resources across CDK stacks.Description of changes
EmailIdentity.fromEmailIdentityArn(scope, id, emailIdentityArn)
to enable importing anEmailIdentity
by ARN.Describe any new or updated permissions being added
No new IAM permissions are required, as this change does not perform any operations requiring permissions. It only allows referencing an existing SES Email Identity by ARN.
Description of how you validated changes
email-identity.test.ts
to verify that the ARN is correctly parsed and the resultingIEmailIdentity
behaves as expected.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license