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",
|
2020-12-11 19:11:14 +00:00
|
|
|
"ami_name": "consul-test-{{isotime | clean_resource_name}}-{{uuid}}",
|
|
|
|
"ami_description": "An Ubuntu 18.04 AMI that has hey 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"
|
|
|
|
}]
|
|
|
|
|
|
|
|
}
|