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:
poida 2016-12-02 21:51:10 +11:00
parent 7ea17e1630
commit 8b13b75097
3 changed files with 5 additions and 5 deletions

View File

@ -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 {

View File

@ -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")
}
}

View File

@ -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.