From 503ffbd3be062bf89e32e418a1b08b42eb3873c4 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Mon, 2 Mar 2015 11:15:49 +0000 Subject: [PATCH] Save token that came from goamz + use it in go-sdk-aws --- builtin/providers/aws/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/providers/aws/config.go b/builtin/providers/aws/config.go index b6ed66a3b..e59d13834 100644 --- a/builtin/providers/aws/config.go +++ b/builtin/providers/aws/config.go @@ -21,6 +21,7 @@ import ( type Config struct { AccessKey string SecretKey string + Token string Region string } @@ -58,7 +59,7 @@ func (c *Config) Client() (interface{}, error) { // bucket storage in S3 client.region = c.Region - creds := awsGo.Creds(c.AccessKey, c.SecretKey, "") + creds := awsGo.Creds(c.AccessKey, c.SecretKey, c.Token) log.Println("[INFO] Initializing EC2 connection") client.ec2conn = ec2.New(auth, region) @@ -95,6 +96,7 @@ func (c *Config) AWSAuth() (aws.Auth, error) { // Store the accesskey and secret that we got... c.AccessKey = auth.AccessKey c.SecretKey = auth.SecretKey + c.Token = auth.Token } return auth, err