Skip to content

Quick Start

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

Write a .crn file

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

Terminal window
mkdir my-infra && cd my-infra
main.crn
provider awscc {
source = 'github.com/carina-rs/carina-provider-awscc'
version = '0.3.0'
region = 'ap-northeast-1'
}
awscc.ec2.vpc {
cidr_block = '10.0.0.0/16'
tags = {
Name = 'my-first-vpc'
}
}

Replace the source path with the actual path to your built WASM provider plugin.

Validate

Check that the syntax and schema are correct:

Terminal window
carina validate

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

Plan

Preview what Carina will create:

Terminal window
carina plan

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

Apply

Create the resources:

Terminal window
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.

Destroy

Tear down all managed resources:

Terminal window
carina destroy

This deletes every resource recorded in the state file.

Next steps