Skip to content

Instantly share code, notes, and snippets.

@carlosescura
Created June 3, 2019 13:37
Show Gist options
  • Save carlosescura/2e14e7aa60dcfa051b9ce0ccd991b46d to your computer and use it in GitHub Desktop.
Save carlosescura/2e14e7aa60dcfa051b9ce0ccd991b46d to your computer and use it in GitHub Desktop.
redash-guide-packer.json
{
"variables": {
"name": "redash",
"ami_name": "redash",
"redash_version": "7.0.0",
"account_id": null
},
"builders": [
{
"type": "amazon-ebs",
"region": "eu-west-1",
"instance_type": "t3.micro",
"ssh_username": "ec2-user",
"ami_name": "{{user `ami_name`}}-{{user `redash_version`}}-{{isotime \"2006-01-02T150405\"}}",
"source_ami_filter": {
"filters": {
"name": "my-company-base*",
"architecture": "x86_64",
"virtualization-type": "hvm",
"state": "available",
"is-public": "false"
},
"owners": [
"{{user `account_id`}}"
],
"most_recent": true
},
"ami_description": "{{user `ami_name`}} AMI",
"run_tags": {
"ami-create": "{{user `ami_name`}}"
},
"tags": {
"Name": "{{user `ami_name`}}"
}
}
],
"provisioners": [
{
"type": "file",
"source": "packer-redash/files",
"destination": "/tmp/files"
},
{
"type": "file",
"source": "packer-redash/shell",
"destination": "/tmp"
},
{
"type": "shell",
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'",
"inline": [
"chmod -R +x /tmp/shell",
"/tmp/shell/bootstrap.sh",
"/tmp/shell/cleanup.sh"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment