Skip to content

Instantly share code, notes, and snippets.

@larkintuckerllc
Created March 29, 2020 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larkintuckerllc/f1a9c56fdb42d977b655ca71487d3aa7 to your computer and use it in GitHub Desktop.
Save larkintuckerllc/f1a9c56fdb42d977b655ca71487d3aa7 to your computer and use it in GitHub Desktop.
aws
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "todosrus {{timestamp}}"
}],
"provisioners": [
{
"type": "shell",
"inline":[
"sudo apt-get update",
"sudo apt-get upgrade -y",
"sudo apt-get install apache2 -y",
"sudo systemctl enable apache2"
]
},
{
"type": "file",
"source": "./index.html",
"destination": "/tmp/"
},
{
"type": "shell",
"inline":[
"sudo cp /tmp/index.html /var/www/html"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment