From 76251e5fd23ad7579ac7b022edbbc6ed6f5cc23a Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Mon, 6 Jan 2020 12:01:30 -0800 Subject: [PATCH] fix ssh interface docs for amazon builders --- builder/amazon/common/run_config.go | 16 ++++++++++++++-- .../builders/amazon-ebssurrogate.html.md.erb | 3 +-- .../docs/builders/amazon-ebsvolume.html.md.erb | 1 - .../docs/builders/amazon-instance.html.md.erb | 3 +-- .../common/_RunConfig-not-required.html.md | 13 ++++++++++++- 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/builder/amazon/common/run_config.go b/builder/amazon/common/run_config.go index f8d739609..fc7b69818 100644 --- a/builder/amazon/common/run_config.go +++ b/builder/amazon/common/run_config.go @@ -377,8 +377,20 @@ type RunConfig struct { WindowsPasswordTimeout time.Duration `mapstructure:"windows_password_timeout" required:"false"` // Communicator settings - Comm communicator.Config `mapstructure:",squash"` - SSHInterface string `mapstructure:"ssh_interface"` + Comm communicator.Config `mapstructure:",squash"` + + // One of `public_ip`, `private_ip`, `public_dns`, or `private_dns`. If + // set, either the public IP address, private IP address, public DNS name + // or private DNS name will used as the host for SSH. The default behaviour + // if inside a VPC is to use the public IP address if available, otherwise + // the private IP address will be used. If not in a VPC the public DNS name + // will be used. Also works for WinRM. + // + // Where Packer is configured for an outbound proxy but WinRM traffic + // should be direct, `ssh_interface` must be set to `private_dns` and + // `.compute.internal` included in the `NO_PROXY` environment + // variable. + SSHInterface string `mapstructure:"ssh_interface"` } func (c *RunConfig) Prepare(ctx *interpolate.Context) []error { diff --git a/website/source/docs/builders/amazon-ebssurrogate.html.md.erb b/website/source/docs/builders/amazon-ebssurrogate.html.md.erb index d04fb127b..77d377eec 100644 --- a/website/source/docs/builders/amazon-ebssurrogate.html.md.erb +++ b/website/source/docs/builders/amazon-ebssurrogate.html.md.erb @@ -82,7 +82,7 @@ Block devices can be nested in the <%= partial "partials/builder/amazon/common/BlockDevice" %> -#### Optional only for [launch_block_device_mappings](#launch_block_device_mappings) +#### Optional only for [launch_block_device_mappings](#launch_block_device_mappings) <%= partial "partials/builder/amazon/ebssurrogate/BlockDevice-not-required" %> @@ -97,7 +97,6 @@ Block devices can be nested in the <%= partial "partials/helper/communicator/Config-not-required" %> <%= partial "partials/helper/communicator/SSH-not-required" %> -<%= partial "partials/helper/communicator/SSHInterface-not-required" %> ## Basic Example diff --git a/website/source/docs/builders/amazon-ebsvolume.html.md.erb b/website/source/docs/builders/amazon-ebsvolume.html.md.erb index 00ab2639b..24e194a25 100644 --- a/website/source/docs/builders/amazon-ebsvolume.html.md.erb +++ b/website/source/docs/builders/amazon-ebsvolume.html.md.erb @@ -99,7 +99,6 @@ Block devices can be nested in the <%= partial "partials/helper/communicator/Config-not-required" %> <%= partial "partials/helper/communicator/SSH-not-required" %> -<%= partial "partials/helper/communicator/SSHInterface-not-required" %> ## Basic Example diff --git a/website/source/docs/builders/amazon-instance.html.md.erb b/website/source/docs/builders/amazon-instance.html.md.erb index 7b740186d..f45366240 100644 --- a/website/source/docs/builders/amazon-instance.html.md.erb +++ b/website/source/docs/builders/amazon-instance.html.md.erb @@ -95,7 +95,7 @@ necessary for this build to succeed and can be found further down the page. ### Block Devices Configuration Block devices can be nested in the -[ami_block_device_mappings](#ami_block_device_mappings) or the +[ami_block_device_mappings](#ami_block_device_mappings) or the [launch_block_device_mappings](#launch_block_device_mappings) array. <%= partial "partials/builder/amazon/common/BlockDevice" %> @@ -110,7 +110,6 @@ Block devices can be nested in the <%= partial "partials/helper/communicator/Config-not-required" %> <%= partial "partials/helper/communicator/SSH-not-required" %> -<%= partial "partials/helper/communicator/SSHInterface-not-required" %> ## Basic Example diff --git a/website/source/partials/builder/amazon/common/_RunConfig-not-required.html.md b/website/source/partials/builder/amazon/common/_RunConfig-not-required.html.md index 92d7f818b..264b3817a 100644 --- a/website/source/partials/builder/amazon/common/_RunConfig-not-required.html.md +++ b/website/source/partials/builder/amazon/common/_RunConfig-not-required.html.md @@ -285,4 +285,15 @@ password for Windows instances. Defaults to 20 minutes. Example value: 10m -- `ssh_interface` (string) - SSH Interface \ No newline at end of file +- `ssh_interface` (string) - One of `public_ip`, `private_ip`, `public_dns`, or `private_dns`. If + set, either the public IP address, private IP address, public DNS name + or private DNS name will used as the host for SSH. The default behaviour + if inside a VPC is to use the public IP address if available, otherwise + the private IP address will be used. If not in a VPC the public DNS name + will be used. Also works for WinRM. + + Where Packer is configured for an outbound proxy but WinRM traffic + should be direct, `ssh_interface` must be set to `private_dns` and + `.compute.internal` included in the `NO_PROXY` environment + variable. + \ No newline at end of file