ops0ops0

Your First Project

This guide walks you through creating your first Infrastructure as Code project in ops0 - from writing code to deploying resources.


Prerequisites

Before starting, make sure you have:

ops0 account (Sign up here)
Cloud provider connected (Connect AWS/GCP/Azure)

Step 1: Create a New Project

1Click IaC in the left sidebar
2Click + New Project
3Enter project details:
FieldValueNotes
Namemy-first-projectLowercase, hyphens allowed
TypeTerraformOr OpenTofu, Oxid. Pulumi and CloudFormation are upcoming
IntegrationYour AWS/GCP/AzureSelect the cloud you connected
Regionus-east-1Or your preferred region

Click Create Project to continue.


Step 2: Meet the Editor

The project editor has three main areas:

┌─────────────────────────────────────────────────────────────────┐
│  File Tree  │           Code Editor           │   AI Chat      │
│             │                                 │                │
│  main.tf    │  # Your Terraform code here    │  Ask me to     │
│  variables  │                                 │  create        │
│  outputs.tf │                                 │  infrastructure│
│             │                                 │                │
└─────────────────────────────────────────────────────────────────┘
File Tree
Navigate your Terraform files
Code Editor
Monaco editor with autocomplete
AI Chat
Create code with plain English

Step 3: Create Your First Resource

Let's use AI to create an S3 bucket. In the AI Chat panel, type:

Create an S3 bucket with:
- Versioning enabled
- Server-side encryption (AES-256)
- Block all public access
- A lifecycle rule to move objects to Glacier after 90 days

ops0 will produce Terraform code like this:

resource "aws_s3_bucket" "main" {
  bucket = "my-first-project-bucket-${random_id.suffix.hex}"

  tags = {
    Name        = "my-first-project-bucket"
    Environment = "dev"
    ManagedBy   = "ops0"
  }
}

resource "aws_s3_bucket_versioning" "main" {
  bucket = aws_s3_bucket.main.id
  versioning_configuration {
    status = "Enabled"
  }
}

resource "aws_s3_bucket_server_side_encryption_configuration" "main" {
  bucket = aws_s3_bucket.main.id

  rule {
    apply_server_side_encryption_by_default {
      sse_algorithm = "AES256"
    }
  }
}

resource "aws_s3_bucket_public_access_block" "main" {
  bucket = aws_s3_bucket.main.id

  block_public_acls       = true
  block_public_policy     = true
  ignore_public_acls      = true
  restrict_public_buckets = true
}

resource "aws_s3_bucket_lifecycle_configuration" "main" {
  bucket = aws_s3_bucket.main.id

  rule {
    id     = "glacier-transition"
    status = "Enabled"

    transition {
      days          = 90
      storage_class = "GLACIER"
    }
  }
}

resource "random_id" "suffix" {
  byte_length = 4
}

Click Accept to add this code to your project.


Step 4: Review and Customize

The code appears in main.tf. You can:

  • Edit directly - Modify the code in the editor
  • Ask AI to adjust - "Change the bucket name to company-data-archive"
  • Add more resources - "Add an IAM policy that allows read access from my application"

Pro Tips

Be Specific
"Create a VPC" gives basic results. "Create a VPC with 3 AZs, public/private subnets, and NAT gateways" gives production-ready code.
Iterate
Start simple, then ask for additions. "Now add CloudWatch alarms for the bucket size."

Step 5: Run a Plan

Before deploying, preview what will change:

1Click the Plan button in the top toolbar
2Wait for Terraform to initialize and produce a plan
3Review the plan output

Understanding the Plan

Terraform will perform the following actions:

  # aws_s3_bucket.main will be created
  + resource "aws_s3_bucket" "main" {
      + bucket = "my-first-project-bucket-a1b2c3d4"
      + ...
    }

  # aws_s3_bucket_versioning.main will be created
  + resource "aws_s3_bucket_versioning" "main" {
      + bucket = (known after apply)
      + ...
    }

Plan: 6 to add, 0 to change, 0 to destroy.
SymbolMeaning
+Resource will be created
~Resource will be modified
-Resource will be destroyed
-/+Resource will be replaced (destroy then create)

Step 6: Check Policy & Cost

After the plan, ops0 automatically runs:

Policy Check

All Policies Passed

✓ S3 bucket has encryption enabled
✓ S3 bucket blocks public access
✓ All resources have required tags

If a policy fails, you'll see what to fix before deploying.

Cost Estimation

ResourceTypeMonthly Cost
S3 BucketStandard$0.023/GB
S3 VersioningPer versionIncluded
Estimated Total~$2.30 (for 100GB)

Step 7: Apply the Changes

Ready to create the resources? Click Apply.

1Click Apply in the plan view
2Confirm by typing the project name (for production environments)
3Watch the real-time logs as resources are created

Apply Output

aws_s3_bucket.main: Creating...
aws_s3_bucket.main: Creation complete after 2s [id=my-first-project-bucket-a1b2c3d4]
aws_s3_bucket_versioning.main: Creating...
aws_s3_bucket_versioning.main: Creation complete after 1s
...

Apply complete! Resources: 6 added, 0 changed, 0 destroyed.

Step 8: View Your Resources

After a successful apply:

Resource Graph
See your S3 bucket and related resources visualized as a graph
AWS Console
Your bucket is now live in S3 with all the configurations applied

What's Next?


Cleanup (Optional)

To delete the resources you just created:

1Open your project
2Click Destroy in the toolbar
3Confirm by typing the project name
4All resources will be deleted from AWS

This prevents any ongoing charges for resources you created while learning.