From f637878822af534e5885c8e6ec137af43b4fb157 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Fri, 9 Jun 2017 10:46:01 -0700 Subject: [PATCH] with wrapping --- builder/amazon/common/access_config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builder/amazon/common/access_config.go b/builder/amazon/common/access_config.go index 7dc19f0f1..af5fce6bc 100644 --- a/builder/amazon/common/access_config.go +++ b/builder/amazon/common/access_config.go @@ -63,8 +63,9 @@ func (c *AccessConfig) Session() (*session.Session, error) { config := aws.NewConfig().WithRegion(region).WithMaxRetries(11).WithCredentialsChainVerboseErrors(true) if c.CustomEndpointEc2 != "" { - config.Endpoint = &c.CustomEndpointEc2 + config = config.WithEndpoint(aws.String(c.CustomEndpointEc2)) } + if c.AccessKey != "" { creds := credentials.NewChainCredentials( []credentials.Provider{