From 530f5e3f63e8c80def897a07b9fb5cf9f687b20b Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Fri, 17 Jul 2020 15:52:11 -0700 Subject: [PATCH] more additions to partials --- builder/amazon/common/block_device.go | 30 +++++++++++++++---- helper/communicator/config.go | 20 ++++++++++++- .../common/AccessConfig-not-required.mdx | 11 ++++--- .../builder/amazon/common/BlockDevice.mdx | 30 +++++++++++++++---- .../communicator/Config-not-required.mdx | 20 ++++++++++++- 5 files changed, 93 insertions(+), 18 deletions(-) diff --git a/builder/amazon/common/block_device.go b/builder/amazon/common/block_device.go index b641849c4..4e1046823 100644 --- a/builder/amazon/common/block_device.go +++ b/builder/amazon/common/block_device.go @@ -21,12 +21,32 @@ import ( // The following mapping will tell Packer to encrypt the root volume of the // build instance at launch using a specific non-default kms key: // +// +// +// // ```json -// [{ -// "device_name": "/dev/sda1", -// "encrypted": true, -// "kms_key_id": "1a2b3c4d-5e6f-1a2b-3c4d-5e6f1a2b3c4d" -// }] +// ami_block_device_mappings: [ +// { +// "device_name": "/dev/sda1", +// "encrypted": true, +// "kms_key_id": "1a2b3c4d-5e6f-1a2b-3c4d-5e6f1a2b3c4d" +// } +// ] +// ``` +// +// +// +// +// ```hcl +// ami_block_device_mappings { +// device_name = "/dev/sda1" +// encrypted = true +// kms_key_id = "1a2b3c4d-5e6f-1a2b-3c4d-5e6f1a2b3c4d" +// } +// ``` +// +// +// // ``` // // Documentation for Block Devices Mappings can be found here: diff --git a/helper/communicator/config.go b/helper/communicator/config.go index 874fe254e..cd9160377 100644 --- a/helper/communicator/config.go +++ b/helper/communicator/config.go @@ -49,14 +49,32 @@ type Config struct { // If you end up in this situation, you can use the template option // `pause_before_connecting`. By default, there is no pause. For example: // + // + // + // // ```json - // { + // "builders" [{ + // ... // "communicator": "ssh", // "ssh_username": "myuser", // "pause_before_connecting": "10m" + // }] + // ``` + // + // + // + // + // ```hcl + // source "amazon-ebs" "example" { + // communicator = "ssh" + // ssh_username = "myuser" + // pause_before_connecting = "10m" // } // ``` // + // + // + // // In this example, Packer will check whether it can connect, as normal. But once // a connection attempt is successful, it will disconnect and then wait 10 minutes // before connecting to the guest and beginning provisioning. diff --git a/website/pages/partials/builder/amazon/common/AccessConfig-not-required.mdx b/website/pages/partials/builder/amazon/common/AccessConfig-not-required.mdx index fb04fe023..93ea549f1 100644 --- a/website/pages/partials/builder/amazon/common/AccessConfig-not-required.mdx +++ b/website/pages/partials/builder/amazon/common/AccessConfig-not-required.mdx @@ -59,10 +59,10 @@ the DurationSeconds parameter for AssumeRole (for assumed\_role credential types) and GetFederationToken (for federation\_token credential types) for more details. - + - + ```json { "vault_aws_engine": { @@ -71,11 +71,10 @@ "ttl": "3600s" } } - ``` - + - + ```hcl vault_aws_engine { name = "myrole" @@ -83,6 +82,6 @@ ttl = "3600s" } ``` - + diff --git a/website/pages/partials/builder/amazon/common/BlockDevice.mdx b/website/pages/partials/builder/amazon/common/BlockDevice.mdx index 89536e6c3..9d70f64c6 100644 --- a/website/pages/partials/builder/amazon/common/BlockDevice.mdx +++ b/website/pages/partials/builder/amazon/common/BlockDevice.mdx @@ -8,12 +8,32 @@ Example use case: The following mapping will tell Packer to encrypt the root volume of the build instance at launch using a specific non-default kms key: + + + ```json -[{ - "device_name": "/dev/sda1", - "encrypted": true, - "kms_key_id": "1a2b3c4d-5e6f-1a2b-3c4d-5e6f1a2b3c4d" -}] +ami_block_device_mappings: [ + { + "device_name": "/dev/sda1", + "encrypted": true, + "kms_key_id": "1a2b3c4d-5e6f-1a2b-3c4d-5e6f1a2b3c4d" + } +] +``` + + + + +```hcl +ami_block_device_mappings { + device_name = "/dev/sda1" + encrypted = true + kms_key_id = "1a2b3c4d-5e6f-1a2b-3c4d-5e6f1a2b3c4d" +} +``` + + + ``` Documentation for Block Devices Mappings can be found here: diff --git a/website/pages/partials/helper/communicator/Config-not-required.mdx b/website/pages/partials/helper/communicator/Config-not-required.mdx index 5ad952f90..075f85672 100644 --- a/website/pages/partials/helper/communicator/Config-not-required.mdx +++ b/website/pages/partials/helper/communicator/Config-not-required.mdx @@ -22,14 +22,32 @@ If you end up in this situation, you can use the template option `pause_before_connecting`. By default, there is no pause. For example: + + + ```json - { + "builders" [{ + ... "communicator": "ssh", "ssh_username": "myuser", "pause_before_connecting": "10m" + }] + ``` + + + + + ```hcl + source "amazon-ebs" "example" { + communicator = "ssh" + ssh_username = "myuser" + pause_before_connecting = "10m" } ``` + + + In this example, Packer will check whether it can connect, as normal. But once a connection attempt is successful, it will disconnect and then wait 10 minutes before connecting to the guest and beginning provisioning.