Skip to content

Commit

Permalink
Added support for DynamoDB crendentials variables
Browse files Browse the repository at this point in the history
  • Loading branch information
MRinalducci committed Feb 24, 2018
1 parent fea5161 commit a0bbbd6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dynamodb/dynamo_lock_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const DEFAULT_READ_CAPACITY_UNITS = 1
const DEFAULT_WRITE_CAPACITY_UNITS = 1

// Create an authenticated client for DynamoDB
func CreateDynamoDbClient(awsRegion, awsProfile string, iamRoleArn string, terragruntOptions *options.TerragruntOptions) (*dynamodb.DynamoDB, error) {
session, err := aws_helper.CreateAwsSession(awsRegion, "", "", "", awsProfile, iamRoleArn, terragruntOptions)
func CreateDynamoDbClient(awsRegion, awsAccessKey, awsSecretKey, awsProfile string, iamRoleArn string, terragruntOptions *options.TerragruntOptions) (*dynamodb.DynamoDB, error) {
session, err := aws_helper.CreateAwsSession(awsRegion, "", awsAccessKey, awsSecretKey, awsProfile, iamRoleArn, terragruntOptions)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion dynamodb/dynamo_lock_test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func createDynamoDbClientForTest(t *testing.T) *dynamodb.DynamoDB {
t.Fatal(err)
}

client, err := CreateDynamoDbClient(DEFAULT_TEST_REGION, "", "", mockOptions)
client, err := CreateDynamoDbClient(DEFAULT_TEST_REGION, "", "", "", "", mockOptions)
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions remote/remote_state_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (s3Initializer S3Initializer) NeedsInitialization(config map[string]interfa
}

if s3Config.GetLockTableName() != "" {
dynamodbClient, err := dynamodb.CreateDynamoDbClient(s3Config.Region, s3Config.Profile, s3Config.RoleArn, terragruntOptions)
dynamodbClient, err := dynamodb.CreateDynamoDbClient(s3Config.Region, s3Config.AccessKey, s3Config.SecretKey, s3Config.Profile, s3Config.RoleArn, terragruntOptions)
if err != nil {
return false, err
}
Expand Down Expand Up @@ -255,7 +255,7 @@ func createLockTableIfNecessary(s3Config *RemoteStateConfigS3, terragruntOptions
return nil
}

dynamodbClient, err := dynamodb.CreateDynamoDbClient(s3Config.Region, s3Config.Profile, s3Config.RoleArn, terragruntOptions)
dynamodbClient, err := dynamodb.CreateDynamoDbClient(s3Config.Region, s3Config.AccessKey, s3Config.SecretKey, s3Config.Profile, s3Config.RoleArn, terragruntOptions)
if err != nil {
return err
}
Expand Down

0 comments on commit a0bbbd6

Please sign in to comment.