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
@@ -172,6 +173,7 @@ type Cluster struct {
172
173
MapPublicIPs bool `yaml:"mapPublicIPs,omitempty"`
173
174
Experimental Experimental `yaml:"experimental"`
174
175
providedEncryptService encryptService
176
+ IsChinaRegion bool
175
177
}
176
178
177
179
type Subnet struct {
@@ -318,6 +320,8 @@ func (c Cluster) Config() (*Config, error) {
318
320
config .EtcdEndpoints = etcdEndpoints .String ()
319
321
config .EtcdInitialCluster = etcdInitialCluster .String ()
320
322
323
+ config .IsChinaRegion = strings .HasPrefix (config .Region , "cn" )
324
+
321
325
return & config , nil
322
326
}
323
327
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