Skip to content

Instantly share code, notes, and snippets.

@alxschwarz
Last active June 16, 2017 11:54
Show Gist options
  • Save alxschwarz/a5cf764c119edc5c49d4ff269d63125d to your computer and use it in GitHub Desktop.
Save alxschwarz/a5cf764c119edc5c49d4ff269d63125d to your computer and use it in GitHub Desktop.
test
pb := &compute.Instance{
Name: name,
Description: "compute sample instance",
MachineType: prefix + "/zones/" + zone + "/machineTypes/" + mtype,
Disks: []*compute.AttachedDisk{
{
AutoDelete: true,
Boot: true,
Type: "PERSISTENT",
InitializeParams: &compute.AttachedDiskInitializeParams{
SourceImage: "projects/" + project + "/global/images/family/" + family,
},
},
},
NetworkInterfaces: []*compute.NetworkInterface{
&compute.NetworkInterface{
AccessConfigs: []*compute.AccessConfig{
&compute.AccessConfig{
Type: "ONE_TO_ONE_NAT",
Name: "External NAT",
},
},
Network: prefix + "/global/networks/" + network,
//Subnetwork: "regions/us-east1/subnetworks/" + subnet,
},
},
ServiceAccounts: []*compute.ServiceAccount{
{
Email: "default",
Scopes: []string{
compute.DevstorageFullControlScope,
compute.ComputeScope,
},
},
},
Metadata: &compute.Metadata{
Items: []*compute.MetadataItems{
{
Key: "id",
Value: id,
},
{
Key: metadata["key"],
Value: metadata["value"],
},
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment