The purpose of this repository is to demonstrate a fully automated image deployment and testing pipeline.
This repository builds Amazon Machine Images (AMIs) using software called Packer. After Packer finishes the build, it uploads an artifact (AMI) to the AWS account associated with the AWS Access Key ID and AWS Secret Access Key provided by the user. The AMI is then available for use by Vagrant.
The main.tf file wraps the Packer build command in a Terraform configuration file and creates the security group used via the Vagrant AWS provider to allow incoming SSH connections.
$ terraform init
$ terraform apply
The following environment variables are required to use this repository.
Name | Required |
---|---|
AWS_ACCESS_KEY_ID |
✔️ |
AWS_DEFAULT_REGION |
✔️ |
AWS_SECRET_ACCESS_KEY |
✔️ |
Name | Description | Type | Default | Required |
---|---|---|---|---|
instance_type | The EC2 instance type to use while building the AMI | string | "t2.small" |
no |
options | https://packer.io/docs/commands/build.html#options | map | <map> |
no |
public_key | The public key material | string | "~/.ssh/id_rsa.pub" |
no |
ssh_username | The username to connect to SSH with | string | n/a | yes |
template | The Packer template | string | n/a | yes |
Name | Description |
---|---|
message | SSH connectivity information |