@@ -30,18 +30,18 @@ func resourceAlibabacloudStackVpnGateway() *schema.Resource {
30
30
31
31
Schema : map [string ]* schema.Schema {
32
32
"name" : {
33
- Type : schema .TypeString ,
34
- Optional : true ,
35
- ValidateFunc : validation .StringLenBetween (1 , 128 ),
36
- Computed : true ,
37
- Deprecated : "Field 'name' is deprecated and will be removed in a future release. Please use new field 'vpn_gateway_name' instead." ,
33
+ Type : schema .TypeString ,
34
+ Optional : true ,
35
+ ValidateFunc : validation .StringLenBetween (1 , 128 ),
36
+ Computed : true ,
37
+ Deprecated : "Field 'name' is deprecated and will be removed in a future release. Please use new field 'vpn_gateway_name' instead." ,
38
38
ConflictsWith : []string {"vpn_gateway_name" },
39
39
},
40
40
"vpn_gateway_name" : {
41
- Type : schema .TypeString ,
42
- Optional : true ,
43
- ValidateFunc : validation .StringLenBetween (1 , 128 ),
44
- Computed : true ,
41
+ Type : schema .TypeString ,
42
+ Optional : true ,
43
+ ValidateFunc : validation .StringLenBetween (1 , 128 ),
44
+ Computed : true ,
45
45
ConflictsWith : []string {"name" },
46
46
},
47
47
"vpc_id" : {
@@ -73,47 +73,47 @@ func resourceAlibabacloudStackVpnGateway() *schema.Resource {
73
73
},
74
74
75
75
"enable_ipsec" : {
76
- Type : schema .TypeBool ,
77
- Optional : true ,
78
- Computed :true ,
79
- Deprecated : "Field 'enable_ipsec' is deprecated and will be removed in a future release. Please use new field 'ipsec_vpn' instead." ,
76
+ Type : schema .TypeBool ,
77
+ Optional : true ,
78
+ Computed : true ,
79
+ Deprecated : "Field 'enable_ipsec' is deprecated and will be removed in a future release. Please use new field 'ipsec_vpn' instead." ,
80
80
ConflictsWith : []string {"ipsec_vpn" },
81
81
},
82
82
"ipsec_vpn" : {
83
- Type : schema .TypeBool ,
84
- Optional : true ,
85
- Computed :true ,
83
+ Type : schema .TypeBool ,
84
+ Optional : true ,
85
+ Computed : true ,
86
86
ConflictsWith : []string {"enable_ipsec" },
87
87
},
88
88
89
89
"enable_ssl" : {
90
- Type : schema .TypeBool ,
91
- Optional : true ,
92
- Computed :true ,
93
- Deprecated : "Field 'enable_ssl' is deprecated and will be removed in a future release. Please use new field 'ssl_vpn' instead." ,
90
+ Type : schema .TypeBool ,
91
+ Optional : true ,
92
+ Computed : true ,
93
+ Deprecated : "Field 'enable_ssl' is deprecated and will be removed in a future release. Please use new field 'ssl_vpn' instead." ,
94
94
ConflictsWith : []string {"ssl_vpn" },
95
95
},
96
96
"ssl_vpn" : {
97
- Type : schema .TypeBool ,
98
- Optional : true ,
99
- Computed :true ,
97
+ Type : schema .TypeBool ,
98
+ Optional : true ,
99
+ Computed : true ,
100
100
ConflictsWith : []string {"enable_ssl" },
101
101
},
102
102
103
103
"ssl_connections" : {
104
104
Type : schema .TypeInt ,
105
105
Optional : true ,
106
- Computed :true ,
106
+ Computed : true ,
107
107
DiffSuppressFunc : vpnSslConnectionsDiffSuppressFunc ,
108
108
Deprecated : "Field 'ssl_connections' is deprecated and will be removed in a future release. Please use new field 'ssl_max_connections' instead." ,
109
- ConflictsWith : []string {"ssl_max_connections" },
109
+ ConflictsWith : []string {"ssl_max_connections" },
110
110
},
111
111
"ssl_max_connections" : {
112
112
Type : schema .TypeInt ,
113
113
Optional : true ,
114
- Computed :true ,
114
+ Computed : true ,
115
115
DiffSuppressFunc : vpnSslConnectionsDiffSuppressFunc ,
116
- ConflictsWith : []string {"ssl_connections" },
116
+ ConflictsWith : []string {"ssl_connections" },
117
117
},
118
118
119
119
"description" : {
@@ -155,7 +155,7 @@ func resourceAlibabacloudStackVpnGatewayCreate(d *schema.ResourceData, meta inte
155
155
client .InitRpcRequest (* request .RpcRequest )
156
156
request .VpcId = d .Get ("vpc_id" ).(string )
157
157
158
- if v , ok := connectivity .GetResourceDataOk (d , "vpn_gateway_name" , "name" ); ok && v .(string ) != "" {
158
+ if v , ok := connectivity .GetResourceDataOk (d , "vpn_gateway_name" , "name" ); ok && v .(string ) != "" {
159
159
request .Name = v .(string )
160
160
}
161
161
@@ -193,7 +193,7 @@ func resourceAlibabacloudStackVpnGatewayCreate(d *schema.ResourceData, meta inte
193
193
194
194
if v , ok := connectivity .GetResourceDataOk (d , "ssl_max_connections" , "ssl_connections" ); ok {
195
195
request .SslConnections = requests .NewInteger (v .(int ))
196
- }else {
196
+ } else {
197
197
//Default must be nil if computed
198
198
request .SslConnections = requests .NewInteger (5 )
199
199
}
@@ -244,7 +244,7 @@ func resourceAlibabacloudStackVpnGatewayRead(d *schema.ResourceData, meta interf
244
244
d .Set ("internet_ip" , object .InternetIp )
245
245
d .Set ("status" , object .Status )
246
246
d .Set ("vswitch_id" , object .VSwitchId )
247
- connectivity .SetResourceData (d , "enable" == strings .ToLower (object .IpsecVpn ), "ipsec_vpn" , "enable " )
247
+ connectivity .SetResourceData (d , "enable" == strings .ToLower (object .IpsecVpn ), "ipsec_vpn" , "enable_ipsec " )
248
248
connectivity .SetResourceData (d , "enable" == strings .ToLower (object .SslVpn ), "ssl_vpn" , "enable_ssl" )
249
249
connectivity .SetResourceData (d , object .SslMaxConnections , "ssl_max_connections" , "ssl_connections" )
250
250
d .Set ("business_status" , object .BusinessStatus )
@@ -325,7 +325,7 @@ func resourceAlibabacloudStackVpnGatewayUpdate(d *schema.ResourceData, meta inte
325
325
return fmt .Errorf ("Now Cann't Support modify vpn gateway bandwidth, try to modify on the web console" )
326
326
}
327
327
328
- if d .HasChanges ("enable_ipsec" ,"enable_ssl" ,"ipsec_vpn" , "ssl_vpn" ) {
328
+ if d .HasChanges ("enable_ipsec" , "enable_ssl" , "ipsec_vpn" , "ssl_vpn" ) {
329
329
return fmt .Errorf ("Now Cann't Support modify ipsec/ssl switch, try to modify on the web console" )
330
330
}
331
331
if d .HasChanges ("ssl_max_connections" , "ssl_connections" ) {
0 commit comments