Merge pull request #4215 from hashicorp/pr-4207

Fix issue creating AWS RDS replicas across regions
This commit is contained in:
Clint 2015-12-09 09:54:53 -06:00
commit ced42342ff
2 changed files with 11 additions and 0 deletions

View File

@ -31,6 +31,11 @@ func resourceAwsDbInstance() *schema.Resource {
ForceNew: true,
},
"arn": &schema.Schema{
Type: schema.TypeString,
Computed: true,
},
"username": &schema.Schema{
Type: schema.TypeString,
Required: true,
@ -288,6 +293,10 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error
if attr, ok := d.GetOk("publicly_accessible"); ok {
opts.PubliclyAccessible = aws.Bool(attr.(bool))
}
if attr, ok := d.GetOk("db_subnet_group_name"); ok {
opts.DBSubnetGroupName = aws.String(attr.(string))
}
_, err := conn.CreateDBInstanceReadReplica(&opts)
if err != nil {
return fmt.Errorf("Error creating DB Instance: %s", err)
@ -548,6 +557,7 @@ func resourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error {
}
log.Printf("[DEBUG] Error building ARN for DB Instance, not setting Tags for DB %s", name)
} else {
d.Set("arn", arn)
resp, err := conn.ListTagsForResource(&rds.ListTagsForResourceInput{
ResourceName: aws.String(arn),
})

View File

@ -95,6 +95,7 @@ The following attributes are exported:
* `id` - The RDS instance ID.
* `address` - The address of the RDS instance.
* `arn` - The ARN of the RDS instance.
* `allocated_storage` - The amount of allocated storage
* `availability_zone` - The availability zone of the instance
* `backup_retention_period` - The backup retention period