Quick Start
Create your first infrastructure resource with Carina in five minutes.
This guide walks you through creating an AWS VPC using Carina.
-
Step 1 · Author
Write a
.crnfileCreate a directory for your project and add a
main.crnfile: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' } } -
Step 2 · Init
Install the provider
Download the provider plugins declared in your
providerblocks:carina initCarina downloads the WASM plugin from the release matching
versioninto.carina/providers/and pins it incarina-providers.lock. Commit the lock file. Runcarina initagain whenever you add a provider or change itsversion. -
Step 3 · Validate
Validate
Check that the syntax and schema are correct:
carina validateThis parses the
.crnfiles in the current directory and reports any errors. No AWS credentials are needed. -
Step 4 · Plan
Plan
Preview what Carina will create:
carina planThe plan output shows each resource and the action Carina will take (Create, Update, Delete, or Replace).
planandapplytalk to AWS, so run them with credentials available. Profiles and IAM Identity Center are supported, for exampleAWS_PROFILE=development carina plan; if the SSO session has expired, runaws sso login --profile developmentfirst. See AWS Credentials. -
Step 5 · Apply
Apply
Create the resources:
carina applyCarina shows the plan, asks for confirmation (
--auto-approveskips it), executes it, and records the result incarina.state.json. This state file tracks which resources Carina manages and their current attributes. -
Step 6 · Destroy
Destroy
Tear down managed resources:
carina destroyAfter you confirm by typing
yes, Carina destroys eligible managed resources in state. Protected resources are retained, andremovedentries are forgotten without cloud deletion.
Next steps
- Core Concepts — understand effects, providers, and the DSL
- Writing Resources — learn
letbindings, nested blocks, and data sources - State Management — configure S3 backends and import existing resources