Merge pull request #1910 from PeopleNet/rds-tags
Closes #1908. Parse AccountId from User ARN for RDS tags
This commit is contained in:
commit
c9b483d92a
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue