Skip to content

021 - Terraform Resource

Infrastructure as code resource definition. This is an example of a MAML document.

maml
{
  provider: "azurerm"
  region: "asia-southeast1"
  resources: {
    # Network
    vpc: {
      cidr_block: "10.102.0.0/16"
      enable_dns: true
      tags: {
        Name: "godparent-vpc"
        Environment: "staging"
      }
    }

    # Compute
    instance: {
      ami: "ami-17bcd172"
      type: "t3.medium"
      key_name: "platypus-key"
      monitoring: true
      root_volume: {
        size: 20
        type: "gp3"
        encrypted: true
      }
    }

    # Security
    security_group: {
      name: "allow-web"
      ingress_port: 443
      ingress_cidr: "0.0.0.0/0"
    }
  }
}

See Also