title: Unable to set true/false as an environment variable's value for Cloud Function
body: <p>I am writing a Deployment Manager script which creates a Cloud Function and sets some environment variables.</p>
  
  <p>Everything works well apart from the fact that one of my properties/variables is not recognized by the Deployment Manager correctly. I keep on getting an error.</p>
  
  <p>I have a property <code>is-local</code> that I supply from CMD line.</p>
  
  <p>Its value needs to be false/true or I can also live with yes/no.</p>
  
  <p>In the schema file if I specify the property as <code>boolean</code> and supply the value as <code>false/true</code> then the deployment starts and only the Cloud Function component fails with an error. I have specified the error as <code>Error#1</code> below.</p>
  
  <p>if I specify the property as <code>string</code> and supply the value as <code>false/true</code> then the deployment starts but fails immediately with an error. I have specified the error as <code>Error#2</code> below.</p>
  
  <p><strong>main.jinja</strong></p>
  
  <pre><code>{% set PROJECT_NAME = env['project'] %}
  {% set CODE_BUCKET = properties['code-bucket'] %}
  {% set IS_LOCAL = properties['is-local'] %}
  
  resources:
  - name: create-cf
    type: create_cloud_function.jinja
    properties:
      name: test-cf
      project: {{ PROJECT_NAME }}
      region: europe-west1
      bucket: {{ CODE_BUCKET }}
      runtime: nodejs10
      entryPoint: test
      topic: test
      environmentVariables: { 'CODE_BUCKET': {{ CODE_BUCKET }}, 'IS_LOCAL': {{IS_LOCAL}} }
  </code></pre>
  
  <p><strong>main.jinja.schema</strong></p>
  
  <pre><code>imports:
  - path: create_cloud_function.jinja
  
  required:
  - code-bucket
  - is-local
  
  properties:
    code-bucket:
      type: string
      description: Name of the code bucket to host the code for Cloud Function.
    is-local:
      type: boolean
      description: Will Cloud Function run locally or in cloud.
  </code></pre>
  
  <p><strong>create_cloud_function.jinja</strong></p>
  
  <pre><code>{% set codeFolder = properties['name'] %}
  {% set environmentVariables = properties['environmentVariables'] %}
  
  resources:
  #- type: cloudfunctions.v1.function
  - type: gcp-types/cloudfunctions-v1:projects.locations.functions
    name: {{ properties['name'] }}
    properties:
      parent: projects/{{ properties['project'] }}/locations/{{ properties['region'] }}
      location: {{ properties['region'] }}
      function: {{ properties['name'] }}
      sourceArchiveUrl: gs://$(ref.{{ properties['bucket'] }}.name)/{{ codeFolder }}.zip
      entryPoint: {{ properties['entryPoint'] }}
      runtime: {{properties['runtime']}}
      eventTrigger:
        resource: $(ref.{{ properties['topic'] }}.name)
        eventType: providers/cloud.pubsub/eventTypes/topic.publish
      environmentVariables:
        {% for key, value in environmentVariables.items() %}
          {{ key }} : {{ value }}
        {% endfor %}
  </code></pre>
  
  <p><strong>Deployment Manager CMD</strong></p>
  
  <pre><code>gcloud deployment-manager deployments create setup --template main.jinja --properties code-bucket:something-random-test-code-bucket,is-local:false
  </code></pre>
  
  <p><strong>Error#1:</strong> - when the property type is boolean in schema file</p>
  
  <pre><code>{"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"400","ResourceErrorMessage":{"code":400,"message":"Invalid value at 'function.environment_variables[1].value' (TYPE_STRING), false","status":"INVALID_ARGUMENT","details":[{"@type":"type.googleapis.com/google.rpc.BadRequest","fieldViolations":[{"field":"function.environment_variables[1].value","description":"Invalid value at 'function.environment_variables[1].value' (TYPE_STRING), false"}]}],"statusMessage":"Bad Request","requestPath":"https://cloudfunctions.googleapis.com/v1/projects/someproject/locations/europe-west1/functions","httpMethod":"POST"}}
  </code></pre>
  
  <p><strong>Error#2:</strong> - when the property type is string in schema file</p>
  
  <pre><code>errors:
  - code: MANIFEST_EXPANSION_USER_ERROR
    location: /deployments/setup/manifests/manifest-1571821997285
    message: |-
      Manifest expansion encountered the following errors: Invalid properties for 'main.jinja':
      True is not of type 'string' at ['is-local']
       Resource: main-jinja Resource: config
  </code></pre>
  
  <p>Any idea whats the issue here...</p>