Skip to content

Commit

Permalink
Adding private ip address reference
Browse files Browse the repository at this point in the history
* adding private ip address reference
* Updating the docs.
  • Loading branch information
Felivel authored and Felivel Camilo committed May 8, 2016
1 parent 57a1001 commit b623727
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions builtin/providers/azurerm/resource_arm_network_interface_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,17 @@ func resourceArmNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) e
}
}

if iface.IPConfigurations != nil && len(*iface.IPConfigurations) > 0 {
privateIPAddresses := make([]*string, 0, len(*iface.IPConfigurations))
for _, ipConfig := range *iface.IPConfigurations {
privateIPAddresses = append(privateIPAddresses, ipConfig.Properties.PrivateIPAddress)
}

if err := d.Set("private_ip_addresses", privateIPAddresses); err != nil {
return err
}
}

if iface.VirtualMachine != nil {
if *iface.VirtualMachine.ID != "" {
d.Set("virtual_machine_id", *iface.VirtualMachine.ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ The following attributes are exported:

* `id` - The virtual NetworkConfiguration ID.
* `mac_address` - The media access control (MAC) address of the network interface.
* `private_ip_addresses` - The private ip address of the network interface.
* `virtual_machine_id` - Reference to a VM with which this NIC has been associated.
* `applied_dns_servers` - If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set
* `internal_fqdn` - Fully qualified DNS name supporting internal communications between VMs in the same VNet

0 comments on commit b623727

Please sign in to comment.