Sceptre: Defining numbers via `--var-file`

Created on 20 Mar 2018  路  3Comments  路  Source: Sceptre/sceptre

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'>

Most helpful comment

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 }}"

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ngfgrant picture ngfgrant  路  3Comments

sathed picture sathed  路  3Comments

fabiodouek picture fabiodouek  路  5Comments

dalibor-aleksic-atomia picture dalibor-aleksic-atomia  路  4Comments

ngfgrant picture ngfgrant  路  3Comments