## installation
Add the provider to your Terraform configuration and run terraform init:
terraform {
required_providers {
ac12dev = {
source = "AndrewCopeland/ac12dev"
version = "~> 0.1"
}
}
}
provider "ac12dev" {
username = "myuser"
private_key = file("~/.ac12/keys/default.pem")
}
Run terraform init and you're ready to go.
## what you can manage
The provider ships with resources covering the core ac12.dev platform:
- Services Deploy and manage Docker containers
-
Domains
Map
*.p.ac12.devsubdomains to services or files - Cron Jobs Schedule HTTP requests to your services
- Files Upload and manage project files (inline or from disk)
- Secrets Store encrypted secrets referenced by services
-
Email Accounts
Create
@ac12.devemail accounts - Projects Create and manage projects
- Agents Spin up AI coding agents
- IAM Roles, groups, group memberships, and role assignments
There's also a project data source for looking up existing projects by name or ID.
## example: deploy a service with a domain
One terraform apply and your service is deployed, has a public subdomain,
and runs a nightly cleanup job:
resource "ac12dev_service" "api" {
name = "my-api"
image = "my-api:latest"
port = 8000
env = {
APP_ENV = "production"
}
}
resource "ac12dev_domain" "api" {
subdomain = "my-api"
target_type = "service"
target_service = ac12dev_service.api.name
}
resource "ac12dev_cron_job" "cleanup" {
name = "nightly-cleanup"
schedule = "0 3 * * *"
target_service = ac12dev_service.api.name
target_path = "/cleanup"
http_method = "POST"
}
Define your service, wire up its subdomain, and schedule recurring jobs — all in one
terraform apply. State is tracked, changes are diffs, rollbacks are aterraform destroyaway.