-
Notifications
You must be signed in to change notification settings - Fork 13
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
Large integer config value unexpectedly translated to scientific notation #561
Comments
I have a workaround where I stick a letter into randSuffix so not a blocker. |
Yeah this config stuff in yaml is unfortunately quite awkward. We're passing the config values through from pulumi/pulumi, where be base the type on the value instead of the type that's specified in the yaml template. And we're passing it over the wire as property values, which I believe are always floats, so that's how you end up with the scientific notation. Eventually we should take another look at the whole config system for pulumi-yaml, since right now it's clearly quite awkward. |
related to pulumi/pulumi-yaml#561
Well float64 representation does not have to be lossy here, JavaScript engines represent numbers as f64 and yet:
Perhaps debugging this particular program could help find the place where the conversion is garbling the data. |
related to pulumi/pulumi-yaml#561
We've just had someone message into support where they're having this issue and as such are blocked on creating resources where they need to pass in an ID. So using the following as name: yaml-config
runtime: yaml
config:
infraAlertsSlackChannelId:
type: string
projectId:
type: string
resources:
alert-policy:
type: gcp:monitoring:AlertPolicy
properties:
combiner: OR
conditions:
- conditionThreshold:
comparison: COMPARISON_GT
duration: 60s
filter: resource.type="pubsub_subscription" AND resource.labels.subscription_id="my-subscription" AND metric.type="pubsub.googleapis.com/subscription/num_undelivered_messages"
displayName: Dead Letters Exceeded Threshold
displayName: My Dead Letter Count Alert
notificationChannels:
- "projects/${projectId}/notificationChannels/${slackChannelId}"
project: ${projectId} And then the config:
gcp:project: pulumi-ce-team
yaml-config:infraAlertsSlackChannelId: "12345678909876543212"
yaml-config:projectId: pulumi-ce-team fails because of the converting to a number |
What happened?
Large integer config value unexpectedly translated to scientific notation - tried to use randomization for an AWS security group name threaded through the Config system but the resulting unexpected transformation rendered the generated name invalid and ended up in a confusing error message. Generally this behavior looks unexpected.
Example
Using something like this:
Results in:
Output of
pulumi about
Additional context
N/A
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: