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

Allow customizing ResourceOptions in transformations #575

Merged
merged 4 commits into from
May 30, 2019
Merged

Conversation

lukehoban
Copy link
Member

@lukehoban lukehoban commented May 29, 2019

Adds the ability for transformations to see the current ResourceOptions and modify it if desired on an per-resource basis.

Fixes #574.

Adds the ability for transformations to see the current ResourceOptions and modify it if desired on an per-resource basis.

Fixes #574.
Copy link
Member

@lblackstone lblackstone left a comment

Choose a reason for hiding this comment

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

Node changes LGTM

# Allow users to change API objects before any validation.
if transformations is not None:
for t in transformations:
obj = t(obj)
Copy link
Member Author

Choose a reason for hiding this comment

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

BTW - note that this code previous did obj = t(obj) which is not the same semantics as JavaScript, and is possibly quite surprising. It's also not compatible with the change we want to make here.

I went ahead and changed it, though this is a breaking change. Curious if there's feedback on whether to take the breaking change to align these, or to adjust the PR somehow else to avoid it?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I'd go with the breaking change. It was unintentional behavior introduced when I ported from the Node SDK, and isn't widely used yet. We had at least one user mention that it was surprising, so I'd been intending to fix it anyway.

@lukehoban lukehoban merged commit 0e3dcef into master May 30, 2019
@pulumi-bot pulumi-bot deleted the lukehoban/574 branch May 30, 2019 03:45
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.

Support setting ResourceOptions inside transformations
2 participants