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:
Step 1: Create a New Project
| Field | Value | Notes |
|---|---|---|
| Name | my-first-project | Lowercase, hyphens allowed |
| Type | Terraform | Or OpenTofu, Oxid. Pulumi and CloudFormation are upcoming |
| Integration | Your AWS/GCP/Azure | Select the cloud you connected |
| Region | us-east-1 | Or 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│
│ │ │ │
└─────────────────────────────────────────────────────────────────┘
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
Step 5: Run a Plan
Before deploying, preview what will change:
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.
| Symbol | Meaning |
|---|---|
+ | 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
✓ 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
| Resource | Type | Monthly Cost |
|---|---|---|
| S3 Bucket | Standard | $0.023/GB |
| S3 Versioning | Per version | Included |
| Estimated Total | ~$2.30 (for 100GB) |
Step 7: Apply the Changes
Ready to create the resources? Click Apply.
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:
What's Next?
Cleanup (Optional)
To delete the resources you just created:
This prevents any ongoing charges for resources you created while learning.