From 658b8548101f909f777221d1b49aa39eb5e9e9f6 Mon Sep 17 00:00:00 2001 From: Uzair Ali <72073401+uzaxirr@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:56:50 +0530 Subject: [PATCH] Addition of privateIP in DB resource (#333) * Addition of privateIP in DB resource --- civo/database/resource_database.go | 6 ++++++ docs/resources/database.md | 1 + go.mod | 2 +- go.sum | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/civo/database/resource_database.go b/civo/database/resource_database.go index a4c9ed5f..260192bb 100644 --- a/civo/database/resource_database.go +++ b/civo/database/resource_database.go @@ -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, @@ -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 } diff --git a/docs/resources/database.md b/docs/resources/database.md index bcee184d..42e06bbd 100644 --- a/docs/resources/database.md +++ b/docs/resources/database.md @@ -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 ### Nested Schema for `timeouts` diff --git a/go.mod b/go.mod index 4a2dbb92..2c7a0653 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index f4f8c002..c09b376b 100644 --- a/go.sum +++ b/go.sum @@ -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=