Skip to content

Commit

Permalink
Addition of privateIP in DB resource (#333)
Browse files Browse the repository at this point in the history
* Addition of privateIP in DB resource
  • Loading branch information
uzaxirr authored Sep 2, 2024
1 parent 8150e74 commit 658b854
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions civo/database/resource_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ func ResourceDatabase() *schema.Resource {
Computed: true,
Description: "The status of the database",
},
"private_ipv4": {
Type: schema.TypeString,
Computed: true,
Description: "The private IPv4 address for the database",
},
},
CreateContext: resourceDatabaseCreate,
ReadContext: resourceDatabaseRead,
Expand Down Expand Up @@ -270,6 +275,7 @@ func resourceDatabaseRead(ctx context.Context, d *schema.ResourceData, m interfa
d.Set("dns_endpoint", fmt.Sprintf("%s.db.civo.com", resp.ID))
d.Set("port", resp.Port)
d.Set("status", resp.Status)
d.Set("private_ipv4", resp.PrivateIPv4)

return nil
}
Expand Down
1 change: 1 addition & 0 deletions docs/resources/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ resource "civo_database" "custom_database" {
- `port` (Number) The port of the database
- `status` (String) The status of the database
- `username` (String) The username of the database
- `private_ipv4` (String) The private IP assigned to the database

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/civo/terraform-provider-civo

require (
github.com/civo/civogo v0.3.73
github.com/civo/civogo v0.3.74
github.com/google/uuid v1.3.1
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/civo/civogo v0.3.73 h1:thkNnkziU+xh+MEOChIUwRZI1forN20+SSAPe/VFDME=
github.com/civo/civogo v0.3.73/go.mod h1:7UCYX+qeeJbrG55E1huv+0ySxcHTqq/26FcHLVelQJM=
github.com/civo/civogo v0.3.74 h1:MPrInhgOIuNOfcg1soyX2pm2L0nUa3/+No5hEgFgAuc=
github.com/civo/civogo v0.3.74/go.mod h1:7UCYX+qeeJbrG55E1huv+0ySxcHTqq/26FcHLVelQJM=
github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
Expand Down

0 comments on commit 658b854

Please sign in to comment.