builder/amazon: Raise error when ebsvolume kms_key_id is without encrypted = true
This commit is contained in:
parent
2ac59b3c27
commit
f6772f06be
|
@ -57,6 +57,14 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
|||
errs = packer.MultiErrorAppend(errs, b.config.AccessConfig.Prepare(&b.config.ctx)...)
|
||||
errs = packer.MultiErrorAppend(errs, b.config.RunConfig.Prepare(&b.config.ctx)...)
|
||||
|
||||
// Warn that encrypted must be true when setting kms_key_id
|
||||
for _, device := range b.config.VolumeMappings {
|
||||
if device.KmsKeyId != "" && device.Encrypted == false {
|
||||
errs = packer.MultiErrorAppend(errs, fmt.Errorf("The device %v, must also have `encrytped: "+
|
||||
"true` when setting a kms_key_id.", device.DeviceName))
|
||||
}
|
||||
}
|
||||
|
||||
b.config.launchBlockDevices, err = commonBlockDevices(b.config.VolumeMappings, &b.config.ctx)
|
||||
if err != nil {
|
||||
errs = packer.MultiErrorAppend(errs, err)
|
||||
|
|
Loading…
Reference in New Issue