Skip to content

Conversation

@svidgen
Copy link
Member

@svidgen svidgen commented Apr 23, 2025

Description of changes

Adds @aws_iam directive to non-model types to support IAM auth from functions and other AWS services.

CDK / CloudFormation Parameters Changed

Issue #, if available

  1. IAM not authorized for custom types if default auth mode is not IAM #2929

Description of how you validated changes

  1. Updated tests
  2. Red/Green access test on EventBridge test app. (Removed the dummy model workaround, observed failure, updated to local build including fix, observed success.)
  3. Confirmed async function also still works as expected, per concerns from the linked issue.

Checklist

  • PR description included
  • yarn test passes
  • E2E test run linked (here)
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Any CDK or CloudFormation parameter changes are called out explicitly

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

@svidgen
Copy link
Member Author

svidgen commented Apr 25, 2025

E2E's and PR workflow are still failing in early stages. This has notably been occurring on prior PR's as well and warrants some investigation, which I'll perform prior to continuing with this PR.

@svidgen svidgen marked this pull request as ready for review May 1, 2025 14:26
@svidgen svidgen requested review from a team as code owners May 1, 2025 14:26
Comment on lines +120 to +121
addIamAuthToCustomTypes: (ctx: TransformerTransformSchemaStepContextProvider) => void;
// (undocumented)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this could be private.
(on the other hand, we never paid a lot of attention to transformers public apis...).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I haven't formed a strong opinion here yet. I'm just following the established pattern for now. 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend adopting "if something can be private it should be". that creates less liability going forward. (we've been doing this for a while on backend side).
For transformers it would be more to form a habit (or maybe stop the bleeding) rather than fix them. Their apis are already overexposed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not be customer facing API. But once exposed and called by some other package on it becomes liability.
An example where versioning "internal apis" matter is here aws-amplify/amplify-backend#2717 (comment) .
(this might not be that important for transformers because api construct locks/bundles them afaik - yet another assumption in the system to excuse ourselves from api versioning...).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Their apis are already overexposed

This might be a sign that all these transformers packages could have been directories in single package.

Copy link
Member Author

@svidgen svidgen May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might agree. And, it all seems pretty chaotic to me at the moment. But, there's also a ton of intrinsic complexity in the problem space. So, I'm attempting to respect what came before and keep as many existing fences erected until I understand them better and have more solid opinions.

@svidgen svidgen merged commit 2d08997 into main May 1, 2025
8 checks passed
@svidgen svidgen deleted the fix-missing-iam-on-custom-types branch May 1, 2025 16:20
sobolk added a commit that referenced this pull request May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants