This repository was archived by the owner on Sep 30, 2020. It is now read-only.
File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ func newDefaultCluster() *Cluster {
67
67
Subnets : []* Subnet {},
68
68
MapPublicIPs : true ,
69
69
Experimental : experimental ,
70
+ IsChinaRegion : false ,
70
71
}
71
72
}
72
73
@@ -171,6 +172,7 @@ type Cluster struct {
171
172
MapPublicIPs bool `yaml:"mapPublicIPs,omitempty"`
172
173
Experimental Experimental `yaml:"experimental"`
173
174
providedEncryptService encryptService
175
+ IsChinaRegion bool
174
176
}
175
177
176
178
type Subnet struct {
@@ -313,6 +315,8 @@ func (c Cluster) Config() (*Config, error) {
313
315
config .EtcdEndpoints = etcdEndpoints .String ()
314
316
config .EtcdInitialCluster = etcdInitialCluster .String ()
315
317
318
+ config .IsChinaRegion = strings .HasPrefix (config .Region , "cn" )
319
+
316
320
return & config , nil
317
321
}
318
322
Original file line number Diff line number Diff line change 174
174
"Effect" : " Allow" ,
175
175
"Principal" : {
176
176
"Service" : [
177
- " ec2.amazonaws.com"
177
+ " ec2.amazonaws.com{{if .IsChinaRegion}}.cn{{end}} "
178
178
]
179
179
}
180
180
}
221
221
"Effect" : " Allow" ,
222
222
"Principal" : {
223
223
"Service" : [
224
- " ec2.amazonaws.com"
224
+ " ec2.amazonaws.com{{if .IsChinaRegion}}.cn{{end}} "
225
225
]
226
226
}
227
227
}
286
286
"Effect" : " Allow" ,
287
287
"Principal" : {
288
288
"Service" : [
289
- " ec2.amazonaws.com"
289
+ " ec2.amazonaws.com{{if .IsChinaRegion}}.cn{{end}} "
290
290
]
291
291
}
292
292
}
You can’t perform that action at this time.
0 commit comments