Skip to content

Instantly share code, notes, and snippets.

@jackdpeterson
Created August 23, 2023 20:29
Show Gist options
  • Save jackdpeterson/c07d580bceaa6c49521e6808fae5fe1d to your computer and use it in GitHub Desktop.
Save jackdpeterson/c07d580bceaa6c49521e6808fae5fe1d to your computer and use it in GitHub Desktop.
Packer Build manifest for EC2 + CodeDeploy for Docker based architecture
packer {
required_plugins {
docker = {
version = ">= 1.2.6"
source = "github.com/hashicorp/amazon"
}
}
}
locals {
ami_name = "ubuntu-codedeploy-docker-${formatdate("YYYY-MM-DD-hhmmss", timestamp())}"
}
source "amazon-ebs" "ubuntu" {
ami_name = local.ami_name
instance_type = "t2.micro"
region = "us-west-2"
source_ami = "ami-016d1b215ea28dcee"
ssh_username = "ubuntu"
}
build {
sources = [
"source.amazon-ebs.ubuntu"
]
provisioner "shell" {
script = "install.sh"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment