Open ellisonc opened 10 months ago
Appreciate it, @ellisonc The workaround you suggested is effective, even it starts with "0"
boilerplate ... --var AwsLogsAccountId="'01234567890'"
Same issue here:
- name: AwsVersion
description: Version of the AWS provider required in the module
default: "5.0"
boilerplate ... --var AwsVersion='5.0'
# results in:
ERROR: Value '5' is not a valid value for variable 'AwsVersion' with type 'string'.
This workaround fixes it:
boilerplate ... --var AwsVersion="'5.0'"
Describe the bug When parsing inputs on the cli given by
--var
, boilerplate will use default YAML parsing rules to guess the type rather than using the type provided in theboilerplate.yml
fileTo Reproduce
Suppose we have a
boilerplate.yml
file like this:You would expect to be able to use a command like the following to provide the AWS account ID:
This will throw an error saying an integer cannot be treated as a string:
Expected behavior When type is ambiguous, default to the type specified by the user in the boilerplate.yml file
Additional context Based on an inspection of the code, I suspect this would happen with other yaml types as well, but haven't verified.
As a workaround you can provide the value as a YML string, but this is not expected unless the user knows yaml parsing is being used under the hood: