0

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

  1. Am I approaching this problem in the right way?
  2. If so, how do you map an EBS Volume to a path on the host
GreenyMcDuff
  • 3,292
  • 7
  • 34
  • 66

1 Answers1

0
1. Am I approaching this problem in the right way?

Yes this is a good solution.

2. If so, how do you map an EBS Volume to a path on the host?

Add it to /etc/fstab, see fstab (5). And then mount it.

Rickard von Essen
  • 4,110
  • 2
  • 23
  • 27