This guide walks you through creating your first Infrastructure as Code project in ops0 - from writing code to deploying resources.
Before starting, make sure you have:
| 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.
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│
│ │ │ │
└─────────────────────────────────────────────────────────────────┘
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.
The code appears in main.tf. You can:
company-data-archive"Before deploying, preview what will change:
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) |
After the plan, ops0 automatically runs:
✓ 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.
| Resource | Type | Monthly Cost |
|---|---|---|
| S3 Bucket | Standard | $0.023/GB |
| S3 Versioning | Per version | Included |
| Estimated Total | ~$2.30 (for 100GB) |
Ready to create the resources? Click Apply.
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.
After a successful apply:
To delete the resources you just created:
This prevents any ongoing charges for resources you created while learning.