From 1868b07e12af286665d92bbfb6afc00a3c7043e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Jouannet?= Date: Wed, 15 May 2019 15:03:01 +0200 Subject: [PATCH] fix fni --- osc/resource_osc_network_interface.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/osc/resource_osc_network_interface.go b/osc/resource_osc_network_interface.go index a1fe7afd..1b5a0ac4 100644 --- a/osc/resource_osc_network_interface.go +++ b/osc/resource_osc_network_interface.go @@ -33,6 +33,13 @@ func resourceAwsNetworkInterface() *schema.Resource { ForceNew: true, }, + "private_ip": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "private_ips": &schema.Schema{ Type: schema.TypeSet, Optional: true, @@ -51,8 +58,8 @@ func resourceAwsNetworkInterface() *schema.Resource { "source_dest_check": &schema.Schema{ Type: schema.TypeBool, + Computed: true, Optional: true, - Default: false, }, "description": &schema.Schema{ @@ -101,6 +108,10 @@ func resourceAwsNetworkInterfaceCreate(d *schema.ResourceData, meta interface{}) request.Groups = expandStringList(security_groups) } + if v, ok := d.GetOk("private_ip"); ok { + request.PrivateIpAddress = aws.String(v.(string)) + } + private_ips := d.Get("private_ips").(*schema.Set).List() if len(private_ips) != 0 { request.PrivateIpAddresses = expandPrivateIPAddresses(private_ips) @@ -144,6 +155,7 @@ func resourceAwsNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) e eni := describeResp.NetworkInterfaces[0] d.Set("subnet_id", eni.SubnetId) + d.Set("private_ip", eni.PrivateIpAddress) d.Set("private_ips", flattenNetworkInterfacesPrivateIPAddresses(eni.PrivateIpAddresses)) d.Set("security_groups", flattenGroupIdentifiers(eni.Groups)) d.Set("source_dest_check", eni.SourceDestCheck)