> ## 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 VCN networking

> An OCI infrastructure pattern, deployed with formae.

The networking baseline you build the rest of your infrastructure on. One forma
provisions a VCN with public and private subnets, an internet gateway, a route
table, and network security groups. Everything attaches to the VCN.

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

  subgraph stack["oci-lifeline"]
    direction LR
    vcn["VCN"]:::res
    igw["Internet gateway"]:::res
    rt["Route table"]:::res
    subnets["Subnets"]:::res
    nsg["Network security groups"]:::res

    vcn --> igw
    vcn --> rt
    vcn --> subnets
    vcn --> nsg
  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 VCN up first, then the
gateways, route table, subnets, and security groups that depend on it:

```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
formae apply --mode reconcile \
  /opt/pel/formae/examples/formae-plugin-oci/lifeline/basic_infrastructure.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:OCI::Core::Vcn"
```

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

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

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