open-consul/test/load/packer/loadtest-ami/loadtest.json

42 lines
1.2 KiB
JSON

{
"min_packer_version": "1.5.4",
"variables": {
"aws_region": "{{env `AWS_DEFAULT_REGION`}}"
},
"builders": [{
"name": "ubuntu18-ami",
"ami_name": "consul-test-{{isotime | clean_resource_name}}-{{uuid}}",
"ami_description": "An Ubuntu 18.04 AMI that has hey installed.",
"instance_type": "t2.micro",
"region": "{{user `aws_region`}}",
"associate_public_ip_address": true,
"type": "amazon-ebs",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"architecture": "x86_64",
"name": "ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*",
"block-device-mapping.volume-type": "gp2",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"ssh_username": "ubuntu"
}],
"provisioners": [{
"type": "shell",
"inline": ["mkdir -p /home/ubuntu/scripts/"]
},{
"type": "file",
"source": "{{template_dir}}/scripts",
"destination": "/home/ubuntu",
"pause_before": "30s"
},{
"type": "shell",
"execute_command": "sudo -S sh -c '{{ .Vars }} {{ .Path }}'",
"script": "./scripts/install-k6.sh"
}]
}