> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formae.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy base VPC networking

> A GCP infrastructure pattern, deployed with formae.

The networking baseline you build the rest of your infrastructure on. One forma
provisions a VPC network with subnetworks turned off, a public and a private
subnet, ingress firewall rules for SSH and for HTTP/HTTPS, and a Cloud Router.
Every resource attaches to the VPC.

```mermaid theme={"languages":{"custom":["/languages/pkl.json"]}}
flowchart LR
  target["gcp-target"]:::tgt

  subgraph stack["gcp-stack"]
    direction LR
    vpc["VPC network"]:::res
    publicSubnet["Public subnet"]:::res
    privateSubnet["Private subnet"]:::res
    sshFw["Allow-SSH firewall"]:::res
    httpFw["Allow-HTTP/HTTPS firewall"]:::res
    router["Cloud Router"]:::res

    vpc --> publicSubnet
    vpc --> privateSubnet
    vpc --> sshFw
    vpc --> httpFw
    vpc --> router
  end

  target --> stack

  classDef tgt fill:#FF8201,stroke:#B25900,color:#ffffff
  classDef res fill:#FFF3E6,stroke:#FF8201,color:#02024B
  style stack fill:#ffffff,stroke:#02024B,stroke-width:2px,stroke-dasharray:6 4,color:#02024B
```

**Deploy.** Apply the example forma. formae brings the VPC up first, then the
subnets, firewall rules, and router that depend on it:

```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
formae apply --mode reconcile \
  /opt/pel/formae/examples/formae-plugin-gcp/gcp-lifeline/gcp_lifeline.pkl
```

**Verify.** Once the command completes, the stack's resources are under
management:

```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
formae inventory resources --query="type:GCP::Compute::Network"
```

**Tear down.** Remove everything the forma created:

```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
formae destroy \
  /opt/pel/formae/examples/formae-plugin-gcp/gcp-lifeline/gcp_lifeline.pkl
```

The full forma is in the
[gcp-lifeline example](https://github.com/platform-engineering-labs/formae-plugin-gcp/tree/main/examples/gcp-lifeline).
