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 {