Skip to content

Conversation

@leonmk-aws
Copy link
Contributor

Issue # (if applicable)

Closes #.

Reason for this change

In some languages for which jsii cannot properly generate unions like Go, if a user passes the wrong property (i.e an ILayerRef instead of an IRoleRef), the error message will be unclear:

panic: ValidationError: Resolution error: Resolution error: Trying to resolve() a Construct at /Resources/${Token[GoAppStack.SampleFunction.LogicalID.139]}/Properties/role/node..

Description of changes

Add a check to ensure that all unions have been resolved to a string and throw an error if not, at runtime it will look like:

panic: TypeError: Property role should be one of iam.IRoleRef | string

Description of how you validated changes

Ran locally, updated snapshot tests. Unit test will be added once the relationships are enabled for lambda.

Checklist


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

@leonmk-aws leonmk-aws requested a review from a team as a code owner October 31, 2025 16:56
@aws-cdk-automation aws-cdk-automation requested a review from a team October 31, 2025 16:56
@github-actions github-actions bot added the p2 label Oct 31, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 31, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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)

@leonmk-aws leonmk-aws changed the title core(spec2cdk): ensure strings are passed to attributes chore(spec2cdk): ensure strings are passed to attributes Nov 3, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 3, 2025 09:12

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 3, 2025
@mergify
Copy link
Contributor

mergify bot commented Nov 6, 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).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 6, 2025
@mergify
Copy link
Contributor

mergify bot commented Nov 6, 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
Copy link
Contributor

mergify bot commented Nov 6, 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 fda6e13 into aws:main Nov 6, 2025
18 of 19 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

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 Nov 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

contribution/core This is a PR that came from AWS. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants