From b7d7c03ec8fea88e96374414ec1754ad6e66b44f Mon Sep 17 00:00:00 2001 From: Hans Rakers Date: Wed, 22 Feb 2023 15:13:35 +0100 Subject: [PATCH] Add source_nat_ip_address attribute --- cloudstack/resource_cloudstack_network.go | 7 +++++++ website/docs/r/network.html.markdown | 1 + 2 files changed, 8 insertions(+) diff --git a/cloudstack/resource_cloudstack_network.go b/cloudstack/resource_cloudstack_network.go index 8b4ae37b..febd0bb6 100644 --- a/cloudstack/resource_cloudstack_network.go +++ b/cloudstack/resource_cloudstack_network.go @@ -137,6 +137,11 @@ func resourceCloudStackNetwork() *schema.Resource { ForceNew: true, }, + "source_nat_ip_address": { + Type: schema.TypeString, + Computed: true, + }, + "source_nat_ip_id": { Type: schema.TypeString, Computed: true, @@ -282,10 +287,12 @@ func resourceCloudStackNetworkCreate(d *schema.ResourceData, meta interface{}) e if err != nil { return fmt.Errorf("Error associating a new IP address: %s", err) } + d.Set("source_nat_ip_address", ip.Ipaddress) d.Set("source_nat_ip_id", ip.Id) // Set the additional partial d.SetPartial("source_nat_ip") + d.SetPartial("source_nat_ip_address") d.SetPartial("source_nat_ip_id") } diff --git a/website/docs/r/network.html.markdown b/website/docs/r/network.html.markdown index 8b3781a7..d83ebb1a 100644 --- a/website/docs/r/network.html.markdown +++ b/website/docs/r/network.html.markdown @@ -78,6 +78,7 @@ The following attributes are exported: * `id` - The ID of the network. * `display_text` - The display text of the network. * `network_domain` - DNS domain for the network. +* `source_nat_ip_address` - The associated source NAT IP. * `source_nat_ip_id` - The ID of the associated source NAT IP. ## Import