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

42 lines
1.2 KiB
JSON
Raw Normal View History

2020-10-06 01:16:09 +00:00
{
"min_packer_version": "1.5.4",
"variables": {
"aws_region": "{{env `AWS_DEFAULT_REGION`}}"
},
"builders": [{
"name": "ubuntu18-ami",
"ami_name": "loadtest-ubuntu-{{isotime | clean_resource_name}}-{{uuid}}",
"ami_description": "An Ubuntu 18.04 AMI that has k6 installed.",
2020-10-06 01:16:09 +00:00
"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"
}]
}