This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Types

Carbon has several types defined for providers to use

Carbon organizes your machines in a tree like:

  • Providers
    • Profiles
      • Environments

An example could look like this:

  • Provider: AWS
    • Profile: default aws profile
      • Environment: VPC 001
      • Environment: VPC 002
    • Profile: red team aws profile
      • Environment: VPC 001
      • Environment: VPC 002
  • Provider: VirtualBox
    • Profile: local
      • Environment: local
  • Provider: Multipass
    • Profile: local
      • Environment: local
  • Provider: vSphere
    • Profile: whatever.vsphere.local
      • Environment: Datacenter 01
      • Environment: Datacenter 02

1 - Provider

Provider interface

A provider can be thought of as the service provider or application used to virtualize your environments. Think of AWS, GCP, Azure, VirtualBox, or vSphere. They provide the ability to spin up VMs.

2 - Profile

Profile interface

If providers are AWS, GCP, and VirtualBox. Profile can be thought of as the AWS/GCP account or in the case of VirtualBox the machine it is running on.

3 - Environment

Environment interface

Environments provide the magic. They provide the functionality to:

  • List virtual machines
  • Start, stop, and restart virtual machines
  • Mapping provider specific values to the values Carbon expects

Most of the code for providers will happen here.

4 - Image

Image interface

Images are the results of a packer build. They are snapshots of a VM. Ideally they are configured and ready to use. VMs can be created from an Image.

5 - Image Build

Image build interface

An image build is simply packer configs to build specific images.

6 - Project

Project interface

Deployments are where your Terraform code lives for your projects. Typically, this would be deployments/projects .

7 - VM

VM interface

The VM interface defines methods for interacting with a VM. Unlike the rest of the types, there probably won’t be multiple implementations. Since the Carbon provided Machine struct should be sufficient.