From 350e8bfe0d9de3c2af975f46eceb8cfcbd1090f7 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Tue, 13 Jun 2017 17:35:48 -0700 Subject: [PATCH] we don't need to look for region in metadata. Closes #4615' --- builder/amazon/common/access_config.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/builder/amazon/common/access_config.go b/builder/amazon/common/access_config.go index ec0082ff2..10fba2d79 100644 --- a/builder/amazon/common/access_config.go +++ b/builder/amazon/common/access_config.go @@ -7,7 +7,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/ec2metadata" "github.com/aws/aws-sdk-go/aws/session" "github.com/hashicorp/packer/template/interpolate" ) @@ -92,13 +91,7 @@ func (c *AccessConfig) Region() (string, error) { return c.RawRegion, nil } - sess := session.New() - ec2meta := ec2metadata.New(sess) - identity, err := ec2meta.GetInstanceIdentityDocument() - if err != nil { - return "", err - } - return identity.Region, nil + return "", nil } func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error {