Hi all,
I'm new to using packer. So far it looks like a wonderful tool with lots of feature. Thanks for the help with putting it altogether.
I need to create an AMI based on ubuntu 16.04 with a small non-encrypted volume and an encrypted volume data. Things work fine except the data volume is not encrypted even though I specified "encrypted: true". Do I need to encrypt the drive myself in my provision script or am I missing something? Would appreciate any and all help/pointers.
Thanks,
Derek
packer version - 1.2.2
Here's my build json.
============================================================
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
"aws_default_region": "{{env `AWS_DEFAULT_REGION`}}",
"aws_subnet_id": "{{env `AWS_SUBNET_ID`}}"
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "{{user `aws_default_region`}}",
"subnet_id": "{{user `aws_subnet_id`}}",
"associate_public_ip_address": true,
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "Docker EE AMI {{isotime \"2006-01-02T030406\"}}",
"ami_block_device_mappings" : [
{
"volume_type" : "gp2",
"device_name" : "/dev/xvda",
"delete_on_termination" : true,
"volume_size" : 8
},
{
"volume_type" : "gp2",
"device_name" : "/dev/xvdb",
"delete_on_termination" : false,
"encrypted" : true,
"volume_size" : 80
}
],
"launch_block_device_mappings" : [
{
"volume_type" : "gp2",
"device_name" : "/dev/xvda",
"delete_on_termination" : true,
"volume_size" : 8
},
{
"volume_type" : "gp2",
"device_name" : "/dev/xvdb",
"delete_on_termination" : false,
"encrypted" : true,
"volume_size" : 80
}
]
}],
"provisioners": [{
"type": "shell",
"inline": [
"sleep 30",
"sudo apt-get update",
"sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common",
"sudo apt-get update"
]
}]
}