@@ -145,6 +145,24 @@ func schemaNodeConfig() *schema.Schema {
145145 },
146146 },
147147
148+ "gvnic" : {
149+ Type : schema .TypeList ,
150+ Optional : true ,
151+ MaxItems : 1 ,
152+ Description : `Enable or disable gvnic in the node pool.` ,
153+ ForceNew : true ,
154+ Elem : & schema.Resource {
155+ Schema : map [string ]* schema.Schema {
156+ "enabled" : {
157+ Type : schema .TypeBool ,
158+ Required : true ,
159+ ForceNew : true ,
160+ Description : `Whether or not gvnic is enabled` ,
161+ },
162+ },
163+ },
164+ },
165+
148166 "machine_type" : {
149167 Type : schema .TypeString ,
150168 Optional : true ,
@@ -436,6 +454,13 @@ func expandNodeConfig(v interface{}) *container.NodeConfig {
436454 }
437455 }
438456
457+ if v , ok := nodeConfig ["gvnic" ]; ok && len (v .([]interface {})) > 0 {
458+ conf := v .([]interface {})[0 ].(map [string ]interface {})
459+ nc .Gvnic = & container.VirtualNIC {
460+ Enabled : conf ["enabled" ].(bool ),
461+ }
462+ }
463+
439464 if scopes , ok := nodeConfig ["oauth_scopes" ]; ok {
440465 scopesSet := scopes .(* schema.Set )
441466 scopes := make ([]string , scopesSet .Len ())
@@ -620,6 +645,7 @@ func flattenNodeConfig(c *container.NodeConfig) []map[string]interface{} {
620645 "local_ssd_count" : c .LocalSsdCount ,
621646 "ephemeral_storage_config" : flattenEphemeralStorageConfig (c .EphemeralStorageConfig ),
622647 "gcfs_config" : flattenGcfsConfig (c .GcfsConfig ),
648+ "gvnic" : flattenGvnic (c .Gvnic ),
623649 "service_account" : c .ServiceAccount ,
624650 "metadata" : c .Metadata ,
625651 "image_type" : c .ImageType ,
@@ -688,6 +714,16 @@ func flattenGcfsConfig(c *container.GcfsConfig) []map[string]interface{} {
688714 return result
689715}
690716
717+ func flattenGvnic (c * container.VirtualNIC ) []map [string ]interface {} {
718+ result := []map [string ]interface {}{}
719+ if c != nil {
720+ result = append (result , map [string ]interface {}{
721+ "enabled" : c .Enabled ,
722+ })
723+ }
724+ return result
725+ }
726+
691727func flattenTaints (c []* container.NodeTaint ) []map [string ]interface {} {
692728 result := []map [string ]interface {}{}
693729 for _ , taint := range c {
0 commit comments