title: Configure a Firewall and a Startup Script with Deployment Manager
body: <p>I'm carrying out the lab of the GCP platform &quot;Configure a Firewall and a Startup Script with Deployment Manager&quot;, i changed the qwicklabs.jinja for this code:</p>
  <pre><code> resources:
  - name: default-allow-http
    type: compute.v1.firewall
    properties:
      targetTags: [&quot;http&quot;]
      sourceRanges: [&quot;0.0.0.0/0&quot;]
      allowed:
        - IPProtocol: TCP
          ports: [&quot;80&quot;]
  - type: compute.v1.instance
    name: vm-test
    properties:
      zone: {{ properties[&quot;zone&quot;] }}
      machineType: https://www.googleapis.com/compute/v1/projects/{{ env[&quot;project&quot;] }}/zones/{{ properties[&quot;zone&quot;] }}/machineTypes/f1-micro
      # For examples on how to use startup scripts on an instance, see:
      #   https://cloud.google.com/compute/docs/startupscript
      tags:
          items: [&quot;http&quot;]
      metadata:
        items:
        - key: startup-script
          value: &quot;apt-get update \n apt-get install -y apache2&quot;
      disks:
      - deviceName: boot
        type: PERSISTENT
        boot: true
        autoDelete: true
        initializeParams:
          diskName: disk-{{ env[&quot;deployment&quot;] }}
          sourceImage: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/family/debian-9
      networkInterfaces:
      - network: https://www.googleapis.com/compute/v1/projects/{{ env[&quot;project&quot;] }}/global/networks/default
        # Access Config required to give the instance a public IP address
        accessConfigs:
        - name: External NAT
          type: ONE_TO_ONE_NAT
  </code></pre>
  <p>The VM and Disk are made succesfully but i can't complete the last task &quot;Check that Deployment manager includes startup script and firewall resource&quot; because i have problems making the firewall rule an this appear:</p>
  <pre><code>ERROR: (gcloud.deployment-manager.deployments.create) Error in Operation [operation-1598852175371-5a
  e25c7f61bda-1c55c951-22ca1242]: errors:
  - code: RESOURCE_ERROR
    location: /deployments/deployment-templates/resources/http-firewall-rule
    message: '{&quot;ResourceType&quot;:&quot;compute.v1.firewall&quot;,&quot;ResourceErrorCode&quot;:&quot;400&quot;,&quot;ResourceErrorMessage&quot;:{
  &quot;code&quot;:400,&quot;message&quot;:&quot;Request
      contains an invalid argument.&quot;,&quot;status&quot;:&quot;INVALID_ARGUMENT&quot;,&quot;statusMessage&quot;:&quot;Bad
      Request&quot;,&quot;requestPath&quot;:&quot;https://compute.googleapis.com/compute/v1/projects/qwiklabs-gcp-01-888e7
  df2843f/global/firewalls&quot;,&quot;httpMethod&quot;:&quot;POST&quot;}}'
  </code></pre>
  <p>Could someone help me pls? I have to finish this lab!</p>