Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aws] Expose RDS DB Instance HostedZoneId attribute #10000

Merged
merged 2 commits into from
Nov 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion builtin/providers/aws/resource_aws_db_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ func resourceAwsDbInstance() *schema.Resource {
Computed: true,
},

"zone_id": &schema.Schema{
Type: schema.TypeString,
Computed: true,
},

"status": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -669,7 +674,7 @@ func resourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error {
if v.Endpoint != nil {
d.Set("port", v.Endpoint.Port)
d.Set("address", v.Endpoint.Address)

d.Set("zone_id", v.Endpoint.HostedZoneId)
if v.Endpoint.Address != nil && v.Endpoint.Port != nil {
d.Set("endpoint",
fmt.Sprintf("%s:%d", *v.Endpoint.Address, *v.Endpoint.Port))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ The following attributes are exported:
* `status` - The RDS instance status
* `username` - The master username for the database
* `storage_encrypted` - Specifies whether the DB instance is encrypted
* `zone_id` - The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record)

On Oracle instances the following is exported additionally:

Expand Down