Skip to content

Build and deploy a golden Kali Linux Amazon Machine Image (AMI) with Packer and Terraform

License

Notifications You must be signed in to change notification settings

hexrom/kali-golden

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kali-golden

Terraform Packer template for creating a golden Kali Linux Amazon Machine Image (AMI) in AWS

Creating an AWS EC2 Instance with Packer and Terraform

This guide explains how to use Packer and Terraform to create an Amazon Machine Image (AMI) and launch an EC2 instance on AWS.

Prerequisites

  • Terraform installed
  • Packer installed
  • AWS credentials configured (via environment variables or AWS CLI)

Build the AMI with Packer

Use the following command to create an AMI based on the Packer configuration file:

packer init kali.pkr.hcl
packer build kali.pkr.hcl

Note the AMI ID generated by Packer.

Deploy the AMI with Terraform

Replace variables.tf with the AMI ID generated by your Packer.

Initialize and Apply the Terraform Configuration

Run the following commands to initialize Terraform and create the Kali Linux EC2 instance:

terraform init
terraform apply

Confirm the changes when prompted.

Access the EC2 Instance

After Terraform completes provisioning, access the EC2 instance using SSH with the private key corresponding to the SSH key pair used in the Packer configuration:

ssh -i /path/to/your/ssh/private/kali-key kali@INSTANCE_IP

Replace /path/to/your/ssh/private/key.pem with the path to your private key and INSTANCE_IP with the actual public IP or DNS name of the EC2 instance.

About

Build and deploy a golden Kali Linux Amazon Machine Image (AMI) with Packer and Terraform

Topics

Resources

License

Stars

Watchers

Forks

Languages