It seems that defining numbers in a variable file is not possible.
Here's the related code.
Content of variables.yaml:
EcsCluster:
InstanceType: t2.small
Size: (*)
Content of ecs-cluster.yaml:
template_path: templates/environment/ecs-cluster.cf.yaml
parameters:
InstanceType: {{ var.EcsCluster.InstanceType }}
ClusterSize: {{ var.EcsCluster.Size }}
I tried substituting (*) with both 1 and "1" but neither works.
The result is always:
Invalid type for parameter Parameters[2].ParameterValue, value: 1, type: <class 'int'>, valid types: <class 'str'>
Hi
Do you tried?
(note the quotes around the variable "ClusterSize")
template_path: templates/environment/ecs-cluster.cf.yaml
parameters:
InstanceType: {{ var.EcsCluster.InstanceType }}
ClusterSize: "{{ var.EcsCluster.Size }}"
@gbegher I'd also suggest @jerep6's suggestion. You need to surround the Value of the Parameter Key with "'s even if it is being substituted for a variable from elsewhere.
Closing as the issue has been answered. If it persists re-open the issue.
Most helpful comment
Hi
Do you tried?
(note the quotes around the variable "ClusterSize")