Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Commit

Permalink
fix fni
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-rjt committed May 15, 2019
1 parent 6d3ed3f commit 1868b07
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion osc/resource_osc_network_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1868b07

Please sign in to comment.