Skip to content

Commit 73e9e6f

Browse files
committed
Update AWS Regions with cn-north-1 and cn-northwest-1
- Update AWS Regions with cn-north-1 and cn-northwest-1 Signed-off-by: liranmauda <liran.mauda@gmail.com> (cherry picked from commit 7bfeced) (cherry picked from commit 9426a5d) Signed-off-by: liranmauda <liran.mauda@gmail.com> (cherry picked from commit ff0f5c6) (cherry picked from commit 37309cf)
1 parent c1cabc0 commit 73e9e6f

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

pkg/system/phase2_creating.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,9 @@ func (r *Reconciler) ReconcileAWSCredentials() error {
809809
r.Logger.Errorf("Got error from util.GetAWSRegion(). will use arnPrefix=%q. error=%v", arnPrefix, err)
810810
} else if awsRegion == "us-gov-east-1" || awsRegion == "us-gov-west-1" {
811811
arnPrefix = "arn:aws-us-gov:s3:::"
812+
} else if awsRegion == "cn-north-1" || awsRegion == "cn-northwest-1" {
813+
// China regions use arn:aws-cn per https://docs.amazonaws.cn/en_us/aws/latest/userguide/ARNs.html
814+
arnPrefix = "arn:aws-cn:s3:::"
812815
}
813816
r.Logger.Info("Running in AWS. will create a CredentialsRequest resource")
814817
var bucketName string

pkg/util/util.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,10 @@ func GetAWSRegion() (string, error) {
11681168
"us-gov-east-1": "us-gov-east-1",
11691169
"af-south-1": "af-south-1",
11701170
"il-central-1": "il-central-1",
1171+
"mx-central-1": "mx-central-1",
1172+
// the following comes from https://docs.amazonaws.cn/en_us/aws/latest/userguide/ARNs.html
1173+
"cn-north-1": "cn-north-1",
1174+
"cn-northwest-1": "cn-northwest-1",
11711175
}
11721176
var awsRegion string
11731177
infrastructure := &configv1.Infrastructure{

0 commit comments

Comments
 (0)