|
|
|
|
@ -59,8 +59,21 @@ func (c *AMIConfig) Prepare(accessConfig *AccessConfig, ctx *interpolate.Context
|
|
|
|
|
|
|
|
|
|
errs = append(errs, c.prepareRegions(accessConfig)...)
|
|
|
|
|
|
|
|
|
|
if len(c.AMIUsers) > 0 && c.AMIEncryptBootVolume != nil && *c.AMIEncryptBootVolume {
|
|
|
|
|
errs = append(errs, fmt.Errorf("Cannot share AMI with encrypted boot volume"))
|
|
|
|
|
//if len(c.AMIUsers) > 0 && c.AMIEncryptBootVolume != nil && *c.AMIEncryptBootVolume {
|
|
|
|
|
//errs = append(errs, fmt.Errorf("Cannot share AMI with encrypted boot volume"))
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
if len(c.AMIUsers) > 0 {
|
|
|
|
|
if len(c.AMIKmsKeyId) == 0 && c.AMIEncryptBootVolume != nil && *c.AMIEncryptBootVolume {
|
|
|
|
|
errs = append(errs, fmt.Errorf("Cannot share AMI encrypted with default KMS key"))
|
|
|
|
|
}
|
|
|
|
|
if len(c.AMIRegionKMSKeyIDs) > 0 {
|
|
|
|
|
for _, kmsKey := range c.AMIRegionKMSKeyIDs {
|
|
|
|
|
if len(kmsKey) == 0 {
|
|
|
|
|
errs = append(errs, fmt.Errorf("Cannot share AMI encrypted with default KMS key for other regions"))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var kmsKeys []string
|
|
|
|
|
|