Skip to content

030 - Terraform Resource

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

maml
{
  provider: "aws"
  region: "eu-west-1"
  resources: {
    # Network
    vpc: {
      cidr_block: "10.255.0.0/16"
      enable_dns: true
      tags: {
        Name: "bar-vpc"
        Environment: "staging"
      }
    }

    # Compute
    instance: {
      ami: "ami-15ccfdb4"
      type: "t3.small"
      key_name: "hammock-key"
      monitoring: true
      root_volume: {
        size: 100
        type: "gp2"
        encrypted: true
      }
    }

    # Security
    security_group: {
      name: "allow-ssh"
      ingress_port: 8080
      ingress_cidr: "0.0.0.0/0"
    }
  }
}

See Also