{
  "builders": [
    {
      "type": "amazon-ebs",
      "access_key": "{{user `access_key`}}",
      "secret_key": "{{user `secret_key`}}",
      "subnet_id": "{{user `subnet_id`}}",
      "security_group_id": "{{user `security_group_id`}}",
      "region": "{{user `region`}}",
      "associate_public_ip_address": "{{user `associate_public_ip_address`}}",
      "source_ami": "{{user `source_ami`}}",
      "user_data_file": "user_data.txt",
      "instance_type": "{{user `instance_type`}}",
      "ssh_username": "{{user `ssh_username`}}",
      "ssh_timeout": "5m",
      "ami_name": "{{user `ami_prefix`}}scylla_{{isotime | clean_ami_name}}",
      "enhanced_networking": true,
      "launch_block_device_mappings": [
        {
          "device_name": "/dev/sda1",
          "volume_size": 10,
          "delete_on_termination": true
        }
      ],
      "ami_block_device_mappings": [
        {
          "device_name": "/dev/sdb",
          "virtual_name": "ephemeral0"
        },
        {
          "device_name": "/dev/sdc",
          "virtual_name": "ephemeral1"
        },
        {
          "device_name": "/dev/sdd",
          "virtual_name": "ephemeral2"
        },
        {
          "device_name": "/dev/sde",
          "virtual_name": "ephemeral3"
        },
        {
          "device_name": "/dev/sdf",
          "virtual_name": "ephemeral4"
        },
        {
          "device_name": "/dev/sdg",
          "virtual_name": "ephemeral5"
        },
        {
          "device_name": "/dev/sdh",
          "virtual_name": "ephemeral6"
        },
        {
          "device_name": "/dev/sdi",
          "virtual_name": "ephemeral7"
        }
      ]
    }
  ],
  "provisioners": [
    {
      "type": "file",
      "source": "files/",
      "destination": "/home/{{user `ssh_username`}}/"
    },
    {
      "type": "shell",
      "inline": [
         "sudo yum install -y epel-release",
         "sudo yum install -y python34",
         "sudo /home/{{user `ssh_username`}}/scylla_install_ami {{ user `install_args` }}"
       ]
    }
  ],
  "variables": {
    "access_key": "",
    "secret_key": "",
    "subnet_id": "",
    "security_group_id": "",
    "region": "",
    "associate_public_ip_address": "",
    "instance_type": "",
    "install_args": "",
    "ami_prefix": "",
    "source_ami": "",
    "ssh_username": ""
  }
}
