Carina

Quick Start

Create your first infrastructure resource with Carina in five minutes.

This guide walks you through creating an AWS VPC using Carina.

  1. Step 1 · Author

    Write a .crn file

    Create a directory for your project and add a main.crn file:

    mkdir my-infra && cd my-infra
    
    // main.crn
    provider awscc {
      source  = 'github.com/carina-rs/carina-provider-awscc'
      version = '0.5.0'
      region  = awscc.Region.ap_northeast_1
    }
    
    awscc.ec2.Vpc {
      cidr_block = '10.0.0.0/16'
    
      tags = {
        Name = 'my-first-vpc'
      }
    }
    

    Carina downloads the WASM provider plugin from the release matching version (or use revision = 'main' to track the latest commit). The plugin is cached under .carina/providers/.

  2. Step 2 · Validate

    Validate

    Check that the syntax and schema are correct:

    carina validate
    

    This parses the .crn files in the current directory and reports any errors. No AWS credentials are needed.

  3. Step 3 · Plan

    Plan

    Preview what Carina will create:

    carina plan
    

    The plan output shows each resource and the action Carina will take (Create, Update, Delete, or Replace).

  4. Step 4 · Apply

    Apply

    Create the resources:

    carina apply
    

    Carina executes the plan and records the result in carina.state.json. This state file tracks which resources Carina manages and their current attributes.

  5. Step 5 · Destroy

    Destroy

    Tear down all managed resources:

    carina destroy
    

    This deletes every resource recorded in the state file.

Next steps