Skip to content

Commit

Permalink
Add support for cn-northwest-1.
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeboo committed Dec 27, 2017
1 parent 4876009 commit c52472c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/model/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ func (b *IAMModelBuilder) buildAWSIAMRolePolicy() (fi.Resource, error) {
switch b.Region {
case "cn-north-1":
return "ec2.amazonaws.com.cn"
case "cn-northwest-1":
return "ec2.amazonaws.com.cn"
default:
return "ec2.amazonaws.com"
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/model/iam/iam_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ func (b *PolicyBuilder) IAMPrefix() string {
switch b.Region {
case "cn-north-1":
return "arn:aws-cn"
case "cn-northwest-1":
return "arn:aws-cn"
case "us-gov-west-1":
return "arn:aws-us-gov"
default:
Expand Down
3 changes: 3 additions & 0 deletions upup/pkg/fi/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ var zonesToCloud = map[string]kops.CloudProviderID{
"cn-north-1a": kops.CloudProviderAWS,
"cn-north-1b": kops.CloudProviderAWS,

"cn-northwest-1a": kops.CloudProviderAWS,
"cn-northwest-1b": kops.CloudProviderAWS,

"us-gov-west-1a": kops.CloudProviderAWS,
"us-gov-west-1b": kops.CloudProviderAWS,

Expand Down

2 comments on commit c52472c

@chooop
Copy link

@chooop chooop commented on c52472c Sep 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ec2-user@k1m1 ~]$ aws ec2 describe-availability-zones
{
"AvailabilityZones": [
{
"State": "available",
"ZoneName": "cn-northwest-1a",
"Messages": [],
"RegionName": "cn-northwest-1"
},
{
"State": "available",
"ZoneName": "cn-northwest-1b",
"Messages": [],
"RegionName": "cn-northwest-1"
},
{
"State": "available",
"ZoneName": "cn-northwest-1c",
"Messages": [],
"RegionName": "cn-northwest-1"
}
]
}

@leeeboo
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chooop thank you for your comment.
There was no cn-northwest-1c when I make this commit.
I will make a new pr.

Please sign in to comment.