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  = 'carina-rs/awscc'
      version = '0.7.1'
      region  = awscc.Region.ap_northeast_1
    }
    
    awscc.ec2.Vpc {
      cidr_block = '10.0.0.0/16'
    
      tags = {
        Name = 'my-first-vpc'
      }
    }
    
  2. Step 2 · Init

    Install the provider

    Download the provider plugins declared in your provider blocks:

    carina init
    

    Carina downloads the WASM plugin from the release matching version into .carina/providers/ and pins it in carina-providers.lock. Commit the lock file. Run carina init again whenever you add a provider or change its version.

  3. Step 3 · 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.

  4. Step 4 · 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). plan and apply talk to AWS, so run them with credentials available. Profiles and IAM Identity Center are supported, for example AWS_PROFILE=development carina plan; if the SSO session has expired, run aws sso login --profile development first. See AWS Credentials.

  5. Step 5 · Apply

    Apply

    Create the resources:

    carina apply
    

    Carina shows the plan, asks for confirmation (--auto-approve skips it), executes it, and records the result in carina.state.json. This state file tracks which resources Carina manages and their current attributes.

  6. Step 6 · Destroy

    Destroy

    Tear down managed resources:

    carina destroy
    

    After you confirm by typing yes, Carina destroys eligible managed resources in state. Protected resources are retained, and removed entries are forgotten without cloud deletion.

Next steps