Updated documentation and error messages
The docs for kms_key_id needed to be next to encrypt_boot. Shortened some of the kms_key_id error messages.
This commit is contained in:
parent
7ea17e1630
commit
8b13b75097
|
@ -59,7 +59,7 @@ func (c *AMIConfig) Prepare(ctx *interpolate.Context) []error {
|
|||
}
|
||||
|
||||
if len(c.AMIUsers) > 0 && len(c.AMIKmsKeyId) == 0 && c.AMIEncryptBootVolume {
|
||||
errs = append(errs, fmt.Errorf("Cannot share AMI with encrypted boot volume unless key is specified with kms_key_id"))
|
||||
errs = append(errs, fmt.Errorf("Cannot share AMI with encrypted boot volume unless kms_key_id is provided"))
|
||||
}
|
||||
|
||||
if len(errs) > 0 {
|
||||
|
|
|
@ -66,11 +66,11 @@ func TestAMIConfigPrepare_Share_EncryptedBoot(t *testing.T) {
|
|||
|
||||
c.AMIKmsKeyId = ""
|
||||
if err := c.Prepare(nil); err == nil {
|
||||
t.Fatal("shouldn't be able to share ami with encrypted boot volume unless the kms_key_id param is provided")
|
||||
t.Fatal("shouldn't be able to share ami with encrypted boot volume unless kms_key_id is provided")
|
||||
}
|
||||
|
||||
c.AMIKmsKeyId = "89c3fb9a-de87-4f2a-aedc-fddc5138193c"
|
||||
if err := c.Prepare(nil); err != nil {
|
||||
t.Fatal("should be able to share ami with encrypted boot volume if the kms_key_id param is provided")
|
||||
t.Fatal("should be able to share ami with encrypted boot volume if kms_key_id is provided")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,8 +77,6 @@ builder.
|
|||
|
||||
- `encrypted` (boolean) - Indicates whether to encrypt the volume or not
|
||||
|
||||
- `kms_key_id` (string) - The ID of the KMS key to use for volume encryption
|
||||
|
||||
- `iops` (integer) - The number of I/O operations per second (IOPS) that the
|
||||
volume supports. See the documentation on
|
||||
[IOPs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html)
|
||||
|
@ -164,6 +162,8 @@ builder.
|
|||
AMI with an encrypted boot volume (discarding the initial unencrypted AMI in the
|
||||
process). Default `false`.
|
||||
|
||||
- `kms_key_id` (string) - The ID of the KMS key to use for boot volume encryption.
|
||||
|
||||
- `iam_instance_profile` (string) - The name of an [IAM instance
|
||||
profile](https://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html)
|
||||
to launch the EC2 instance with.
|
||||
|
|
Loading…
Reference in New Issue