Skip to content

Commit

Permalink
Merge pull request #12 from mhlias/secondary_account_fixes
Browse files Browse the repository at this point in the history
Fix secondary account feature bugs.
  • Loading branch information
mhlias authored Aug 17, 2017
2 parents 6624be1 + 70ff925 commit 209b6eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions aws_helper/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Config struct {
Use_sts bool
Mfa_device_id string
Mfa_token string
Secondary *Account
Secondary Account
}

type Account struct {
Expand Down Expand Up @@ -105,7 +105,7 @@ func (c *Config) Connect() interface{} {
os.Setenv("AWS_SESSION_TOKEN", *sts_resp.Credentials.SessionToken)
os.Setenv("AWS_DEFAULT_REGION", c.Region)

if len(c.Secondary.Account_id) > 0 && len(c.Secondary.Role) > 0 && len(c.Secondary.Region) > 0 {
if c.Secondary != (Account{}) {

params2 := &sts.AssumeRoleInput{
RoleArn: aws.String(fmt.Sprintf("arn:aws:iam::%s:role/%s", c.Secondary.Account_id, c.Secondary.Role)),
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type conf struct {
Parallelism int16 `yaml:"parallelism"`
environment string
account string
Secondary map[string]*aws_helper.Account `yaml:"secondary_accounts"`
Secondary map[string]aws_helper.Account `yaml:"secondary_accounts"`
}

type multiflag []string
Expand Down

0 comments on commit 209b6eb

Please sign in to comment.