If I remember correctly you first add the device in launch_block_device_mappings and then in ami_block_device_mappings you add the same device again, but this time with the no_device set to true.
See https://packer.io/docs/builders/amazon-ebs.html#no_device On Fri, Dec 27, 2019, 01:15 John Jones < jjo...@integratedauctionsolutions.com> wrote: > I'm trying to create a temporary drive during the packer build so i can > make references to that additional drive in IIS virtual directories. But i > don't want this drive to be included in the AMI created, because a network > drive will be used instead. > It appears that both the ami and launch_block_device_mappings result in an > AMI created with those drives included. How do add a drive during the > build so that I can configure IIS, but not have the drive included in the > AMI? > > Here is what i am using so far, but results in /dev/sdf included in the > AMI. > > "launch_block_device_mappings": [ > { > "device_name": "/dev/sda1", > "volume_size": 50, > "volume_type": "gp2", > "delete_on_termination": true > }, > { > "device_name": "/dev/sdf", > "volume_size": 50, > "volume_type": "gp2", > "delete_on_termination": true > } > ], > > -- > This mailing list is governed under the HashiCorp Community Guidelines - > https://www.hashicorp.com/community-guidelines.html. Behavior in > violation of those guidelines may result in your removal from this mailing > list. > > GitHub Issues: https://github.com/mitchellh/packer/issues > IRC: #packer-tool on Freenode > --- > You received this message because you are subscribed to the Google Groups > "Packer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to packer-tool+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/packer-tool/cd006c7a-8005-4ef9-bac1-4f8f582da636%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/cd006c7a-8005-4ef9-bac1-4f8f582da636%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt9DNGZK%2BVxChHCZOH41EuB7XBMaF_cF0Fsi5Bva1xet6A%40mail.gmail.com.