-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improve the Ref intrinsic implementation #243
Conversation
Acceptance tests catching something, excellent, I'll have a look. |
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.
🚀
return ctx.getRegion(); | ||
case 'AWS::URLSuffix': | ||
return ctx.getURLSuffix(); | ||
case 'AWS::NotificationARNs': |
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.
I think this was actually a bug I introduced when I enabled use of StackId & StackName. AWS::NotificationARNs
should still throw an error because it is not supported.
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.
I'll fix that!
|
||
return ctx.apply(ctx.succeed(propValues), (resolvedValues) => { | ||
let i = 0; | ||
for (const v of resolvedValues) { |
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.
Nit:
resolvedValues.forEach((v, idx) => {
...
})
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.
forEach wouldn't have the early return. To express this functionally this would be a reduce, but perhaps having written too much Go since my FP days I prefer the imperative version now for readability.
Co-authored-by: Cory Hall <[email protected]>
This PR has been shipped in release v1.0.0. |
This change adds some tests and comments around the
Ref
intrinsic implementation and moves it tointrinsics.ts
. The one change in behavior is that nowRef
is able to consult Pulumi metadata from theaws-native
provider. The metadata helps it resolve to the same values as it would in CloudFormation for resources that have non-standardRef
behavior. The correctness of this process is up to the correctness of the metadata tables. Entries not found in the metadata tables default to using Pulumiid
for most cases should do the right thing.Fixes #173
Needs pulumi/pulumi-aws-native#1836