# Firewall

{% hint style="info" %}
These examples assume that linked resources (Network) already exist in the same environment.
{% endhint %}

## Creating a firewall rule

```yaml
resources:
  - type: compute.v1.firewall
    name: allow-ssh
    props:
      network: global/networks/vpc1
      direction: INGRESS
      allowed:
        - ip_protocol: tcp
          ports:
            - "22"
      source_ranges:
        - "{{CURRENT_IP}}/32"
```
