Example 10137

Terraform Resource

Infrastructure as code resource definition.

{
provider: "digitalocean"
region: "asia-southeast1"
resources: {
# Network
vpc: {
cidr_block: "10.11.0.0/16"
enable_dns: true
tags: {
Name: "pomelo-vpc"
Environment: "staging"
}
}

# Compute
instance: {
ami: "ami-caf6a2db"
type: "t3.micro"
key_name: "postbox-key"
monitoring: true
root_volume: {
size: 100
type: "gp3"
encrypted: true
}
}

# Security
security_group: {
name: "allow-all"
ingress_port: 80
ingress_cidr: "0.0.0.0/0"
}
}
}

See also