Merge pull request #1910 from PeopleNet/rds-tags

Closes #1908. Parse AccountId from User ARN for RDS tags
This commit is contained in:
Mitchell Hashimoto 2015-05-11 16:37:10 -07:00
commit c9b483d92a
1 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package aws
import (
"fmt"
"log"
"strings"
"time"
"github.com/awslabs/aws-sdk-go/aws"
@ -572,7 +573,8 @@ func buildRDSARN(d *schema.ResourceData, meta interface{}) (string, error) {
if err != nil {
return "", err
}
user := resp.User
arn := fmt.Sprintf("arn:aws:rds:%s:%s:db:%s", region, *user.UserID, d.Id())
userARN := *resp.User.ARN
accountID := strings.Split(userARN, ":")[4]
arn := fmt.Sprintf("arn:aws:rds:%s:%s:db:%s", region, accountID, d.Id())
return arn, nil
}