@@ -33,6 +33,22 @@ func dataSourceGoogleComputeSubnetwork() *schema.Resource {
33
33
Type : schema .TypeBool ,
34
34
Computed : true ,
35
35
},
36
+ "secondary_ip_range" : & schema.Schema {
37
+ Type : schema .TypeList ,
38
+ Computed : true ,
39
+ Elem : & schema.Resource {
40
+ Schema : map [string ]* schema.Schema {
41
+ "range_name" : & schema.Schema {
42
+ Type : schema .TypeString ,
43
+ Computed : true ,
44
+ },
45
+ "ip_cidr_range" : & schema.Schema {
46
+ Type : schema .TypeString ,
47
+ Computed : true ,
48
+ },
49
+ },
50
+ },
51
+ },
36
52
"network" : & schema.Schema {
37
53
Type : schema .TypeString ,
38
54
Computed : true ,
@@ -43,11 +59,13 @@ func dataSourceGoogleComputeSubnetwork() *schema.Resource {
43
59
},
44
60
"region" : & schema.Schema {
45
61
Type : schema .TypeString ,
62
+ Computed : true ,
46
63
Optional : true ,
47
64
},
48
65
49
66
"project" : & schema.Schema {
50
67
Type : schema .TypeString ,
68
+ Computed : true ,
51
69
Optional : true ,
52
70
},
53
71
},
@@ -84,6 +102,10 @@ func dataSourceGoogleComputeSubnetworkRead(d *schema.ResourceData, meta interfac
84
102
d .Set ("description" , subnetwork .Description )
85
103
d .Set ("gateway_address" , subnetwork .GatewayAddress )
86
104
d .Set ("network" , subnetwork .Network )
105
+ d .Set ("project" , project )
106
+ d .Set ("region" , region )
107
+ // Flattening code defined in resource_compute_subnetwork.go
108
+ d .Set ("secondary_ip_range" , flattenSecondaryRanges (subnetwork .SecondaryIpRanges ))
87
109
88
110
//Subnet id creation is defined in resource_compute_subnetwork.go
89
111
subnetwork .Region = region
0 commit comments