fix ssh interface docs for amazon builders

This commit is contained in:
Megan Marsh 2020-01-06 12:01:30 -08:00
parent 8098ba9cdf
commit 76251e5fd2
5 changed files with 28 additions and 8 deletions

View File

@ -377,8 +377,20 @@ type RunConfig struct {
WindowsPasswordTimeout time.Duration `mapstructure:"windows_password_timeout" required:"false"` WindowsPasswordTimeout time.Duration `mapstructure:"windows_password_timeout" required:"false"`
// Communicator settings // Communicator settings
Comm communicator.Config `mapstructure:",squash"` Comm communicator.Config `mapstructure:",squash"`
SSHInterface string `mapstructure:"ssh_interface"`
// 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
// `<region>.compute.internal` included in the `NO_PROXY` environment
// variable.
SSHInterface string `mapstructure:"ssh_interface"`
} }
func (c *RunConfig) Prepare(ctx *interpolate.Context) []error { func (c *RunConfig) Prepare(ctx *interpolate.Context) []error {

View File

@ -97,7 +97,6 @@ Block devices can be nested in the
<%= partial "partials/helper/communicator/Config-not-required" %> <%= partial "partials/helper/communicator/Config-not-required" %>
<%= partial "partials/helper/communicator/SSH-not-required" %> <%= partial "partials/helper/communicator/SSH-not-required" %>
<%= partial "partials/helper/communicator/SSHInterface-not-required" %>
## Basic Example ## Basic Example

View File

@ -99,7 +99,6 @@ Block devices can be nested in the
<%= partial "partials/helper/communicator/Config-not-required" %> <%= partial "partials/helper/communicator/Config-not-required" %>
<%= partial "partials/helper/communicator/SSH-not-required" %> <%= partial "partials/helper/communicator/SSH-not-required" %>
<%= partial "partials/helper/communicator/SSHInterface-not-required" %>
## Basic Example ## Basic Example

View File

@ -110,7 +110,6 @@ Block devices can be nested in the
<%= partial "partials/helper/communicator/Config-not-required" %> <%= partial "partials/helper/communicator/Config-not-required" %>
<%= partial "partials/helper/communicator/SSH-not-required" %> <%= partial "partials/helper/communicator/SSH-not-required" %>
<%= partial "partials/helper/communicator/SSHInterface-not-required" %>
## Basic Example ## Basic Example

View File

@ -285,4 +285,15 @@
password for Windows instances. Defaults to 20 minutes. Example value: password for Windows instances. Defaults to 20 minutes. Example value:
10m 10m
- `ssh_interface` (string) - SSH Interface - `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
`<region>.compute.internal` included in the `NO_PROXY` environment
variable.