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