Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 04ea371

Browse files
committed
vip_address added to loadbalancer resource
1 parent c81f52f commit 04ea371

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

docs/resources/gcore_loadbalancer.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ resource "gcore_loadbalancer" "lb" {
5454
- **vip_network_id** (String)
5555
- **vip_subnet_id** (String)
5656

57+
### Read-Only
58+
59+
- **vip_address** (String) Load balancer IP address
60+
5761
<a id="nestedblock--listener"></a>
5862
### Nested Schema for `listener`
5963

gcore/resource_gcore_loadbalancer.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ func resourceLoadBalancer() *schema.Resource {
103103
Optional: true,
104104
ForceNew: true,
105105
},
106+
"vip_address": &schema.Schema{
107+
Type: schema.TypeString,
108+
Description: "Load balancer IP address",
109+
Computed: true,
110+
},
106111
//todo fix client and enabled vip_port_id
107112
//"vip_port_id": &schema.Schema{
108113
// Type: schema.TypeString,
@@ -244,6 +249,10 @@ func resourceLoadBalancerRead(ctx context.Context, d *schema.ResourceData, m int
244249
d.Set("region_id", lb.RegionID)
245250
d.Set("name", lb.Name)
246251

252+
if lb.VipAddress != nil {
253+
d.Set("vip_address", lb.VipAddress.String())
254+
}
255+
247256
fields := []string{"flavor", "vip_network_id", "vip_subnet_id"}
248257
revertState(d, &fields)
249258

0 commit comments

Comments
 (0)