stacker
stacker copied to clipboard
default lookup doesn't retain value type
I am passing in an environment file with the following line in it:
BaselineCapacity: 2
In my blueprint I have the following variable defined:
"BaselineCapacity": {
"type": int,
"description": "The number of instances to maintain during market close hours"
},
And finally, in my config.yml I have the following under one of my stacks
BaselineCapacity: ${default BaselineCapacity::1}
When I run stacker build I get the following error:
Value for variable BaselineCapacity must be of type <type 'int'>. Actual type: <type 'str'>.
Hey @Spareo - thanks for the bug report. @troyready - not sure what the best way would be to deal with this. I'm wondering if we should have a cast lookup that can cast values as different types.
Another option is to make it so default knows the type of the variable and automatically tries to cast it correctly, though that would be a much deeper change.
I like the cast idea. Would meet the need here in a simple way, and could always be cast off (pun not intended) in the future if it was made irrelevant.