Created
August 23, 2023 20:29
-
-
Save jackdpeterson/c07d580bceaa6c49521e6808fae5fe1d to your computer and use it in GitHub Desktop.
Packer Build manifest for EC2 + CodeDeploy for Docker based architecture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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