Created
June 16, 2017 12:59
-
-
Save alxschwarz/6f04d99e7bc41a97a9cc3a12930b676c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func setNetworkInterface(prefix, network, subnet string) *compute.NetworkInterface { | |
var netif = new(compute.NetworkInterface) | |
netif.AccessConfigs = []*compute.AccessConfig{ | |
&compute.AccessConfig{ | |
Type: "ONE_TO_ONE_NAT", | |
Name: "External NAT", | |
}, | |
} | |
netif.Network = prefix + "/global/networks/" + network | |
if subnet != "" { | |
netif.Subnetwork = "regions/us-east1/subnetworks/" + subnet | |
} | |
return netif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment