I'm using:
Packer v1.31.1
Amazon Linux 2 Base AMI
Concept
When I bake my AMI with Packer I want to create an encrypted EBS volume that contains the contents of the JENKINS_HOME path. My current way of thinking is that I should be able to create an EBS volume that I can mount to a particular path on the Linux filesystem (/var/jenkins_home/
in this case)
What I've done so far
I've added the below snippet to my packer template, to create the EBS Volume.
"ami_block_device_mappings":
{
"device_name": "/dev/sdh",
"encrypted ": true,
"volume_size": "10",
"volume_type": "gp2"
}
Questions
- Am I approaching this problem in the right way?
- If so, how do you map an EBS Volume to a path on the host