Skip to content

Commit

Permalink
datbase replica: Add uuid to data source schema. (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsomething committed Apr 6, 2023
1 parent 2a15e38 commit 332f739
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions digitalocean/database/datasource_database_replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ func DataSourceDigitalOceanDatabaseReplica() *schema.Resource {
ValidateFunc: validation.NoZeroValues,
},

"uuid": {
Type: schema.TypeString,
Computed: true,
},

"region": {
Type: schema.TypeString,
Computed: true,
Expand Down
2 changes: 2 additions & 0 deletions digitalocean/database/datasource_database_replica_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ func TestAccDataSourceDigitalOceanDatabaseReplica_Basic(t *testing.T) {
"data.digitalocean_database_replica.my_db_replica", "cluster_id"),
resource.TestCheckResourceAttrPair("digitalocean_database_replica.read-01", "name",
"data.digitalocean_database_replica.my_db_replica", "name"),
resource.TestCheckResourceAttrPair("digitalocean_database_replica.read-01", "uuid",
"data.digitalocean_database_replica.my_db_replica", "uuid"),
resource.TestCheckResourceAttr(
"data.digitalocean_database_replica.my_db_replica", "region", "nyc3"),
resource.TestCheckResourceAttr(
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/database_replica.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The following arguments are supported:
The following attributes are exported:

* `id` - The ID of the database replica.
* `uuid` - The UUID of the database replica.
* `host` - Database replica's hostname.
* `private_host` - Same as `host`, but only accessible from resources within the account and in the same region.
* `port` - Network port that the database replica is listening on.
Expand Down

0 comments on commit 332f739

Please sign in to comment.