{
  "version": "1.0",
  "name": "VPC Template",
  "description": "Creates a Virtual Private Cloud with subnets",
  "parameters": [
    {
      "name": "vpcName",
      "type": "string",
      "description": "Name of the VPC",
      "required": true
    },
    {
      "name": "cidr",
      "type": "string",
      "description": "CIDR block for the VPC",
      "default": "10.0.0.0/16",
      "validation": {
        "pattern": "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}/\\d{1,2}$"
      }
    },
    {
      "name": "subnetCount",
      "type": "number",
      "description": "Number of subnets to create",
      "default": 2,
      "validation": {
        "min": 1,
        "max": 10
      }
    }
  ],
  "resources": [
    {
      "type": "phoenix_vpc",
      "name": "main_vpc",
      "properties": {
        "name": "${vpcName}",
        "cidr": "${cidr}",
        "enable_dns": true,
        "enable_dns_hostnames": true
      }
    }
  ],
  "outputs": [
    {
      "name": "vpc_id",
      "description": "ID of the created VPC",
      "value": "${phoenix_vpc.main_vpc.id}"
    }
  ]
}

