From faba5c7192c2ff37b5912d7d37178718cabc3daa Mon Sep 17 00:00:00 2001 From: nbailey Date: Fri, 26 Jan 2018 12:41:35 +0000 Subject: [PATCH 1/3] Support AWS cn-northwest-1 Ningxia (fixes #3053) --- aws/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/config.go b/aws/config.go index c9a1081e2e7..8c8d2a7bd35 100644 --- a/aws/config.go +++ b/aws/config.go @@ -224,6 +224,9 @@ func (c *AWSClient) IsChinaCloud() bool { if c.region == "cn-north-1" { return true } + if c.region == "cn-northwest-1" { + return true + } return false } @@ -503,6 +506,7 @@ func (c *Config) ValidateRegion() error { "ap-southeast-2", "ca-central-1", "cn-north-1", + "cn-northwest-1", "eu-central-1", "eu-west-1", "eu-west-2", From ff22562b5215b8ae608e0206b19fd08501c14b18 Mon Sep 17 00:00:00 2001 From: nbailey Date: Fri, 26 Jan 2018 14:03:00 +0000 Subject: [PATCH 2/3] Add service account IDs --- aws/data_source_aws_cloudtrail_service_account.go | 1 + aws/data_source_aws_elb_hosted_zone_id.go | 1 + aws/data_source_aws_elb_service_account.go | 1 + aws/data_source_aws_redshift_service_account.go | 1 + aws/hosted_zones.go | 1 + 5 files changed, 5 insertions(+) diff --git a/aws/data_source_aws_cloudtrail_service_account.go b/aws/data_source_aws_cloudtrail_service_account.go index 88818fcdc2d..b7129bbfa97 100644 --- a/aws/data_source_aws_cloudtrail_service_account.go +++ b/aws/data_source_aws_cloudtrail_service_account.go @@ -23,6 +23,7 @@ var cloudTrailServiceAccountPerRegionMap = map[string]string{ "eu-west-2": "282025262664", "eu-west-3": "262312530599", "sa-east-1": "814480443879", + "cn-northwest-1": "681348832753", } func dataSourceAwsCloudTrailServiceAccount() *schema.Resource { diff --git a/aws/data_source_aws_elb_hosted_zone_id.go b/aws/data_source_aws_elb_hosted_zone_id.go index 6bcf74bdf99..7957059a570 100644 --- a/aws/data_source_aws_elb_hosted_zone_id.go +++ b/aws/data_source_aws_elb_hosted_zone_id.go @@ -25,6 +25,7 @@ var elbHostedZoneIdPerRegionMap = map[string]string{ "sa-east-1": "Z2P70J7HTTTPLU", "us-gov-west-1": "048591011584", "cn-north-1": "638102146993", + "cn-northwest-1": "", // Not supported as of January 2018 } func dataSourceAwsElbHostedZoneId() *schema.Resource { diff --git a/aws/data_source_aws_elb_service_account.go b/aws/data_source_aws_elb_service_account.go index 6034ee55c57..5d2da674727 100644 --- a/aws/data_source_aws_elb_service_account.go +++ b/aws/data_source_aws_elb_service_account.go @@ -15,6 +15,7 @@ var elbAccountIdPerRegionMap = map[string]string{ "ap-southeast-2": "783225319266", "ca-central-1": "985666609251", "cn-north-1": "638102146993", + "cn-northwest-1": "037604701340", "eu-central-1": "054676820928", "eu-west-1": "156460612806", "eu-west-2": "652711504416", diff --git a/aws/data_source_aws_redshift_service_account.go b/aws/data_source_aws_redshift_service_account.go index 029f8fe029c..d5db68d5502 100644 --- a/aws/data_source_aws_redshift_service_account.go +++ b/aws/data_source_aws_redshift_service_account.go @@ -18,6 +18,7 @@ var redshiftServiceAccountPerRegionMap = map[string]string{ "ap-southeast-2": "762762565011", "ap-northeast-1": "404641285394", "ca-central-1": "907379612154", + "cn-northwest-1": "660998842044", "eu-central-1": "053454850223", "eu-west-1": "210876761215", "eu-west-2": "307160386991", diff --git a/aws/hosted_zones.go b/aws/hosted_zones.go index 9550e46d60b..464a43b9f03 100644 --- a/aws/hosted_zones.go +++ b/aws/hosted_zones.go @@ -20,6 +20,7 @@ var hostedZoneIDsMap = map[string]string{ "ca-central-1": "Z1QDHH18159H29", "sa-east-1": "Z7KQH4QJS55SO", "us-gov-west-1": "Z31GFT0UA1I2HV", + "cn-northwest-1": "", // Not supported as of January 2018 } // Returns the hosted zone ID for an S3 website endpoint region. This can be From e11c7dfd9d34a26a48982564bdcd8b545bd09869 Mon Sep 17 00:00:00 2001 From: nbailey Date: Fri, 26 Jan 2018 16:32:16 +0000 Subject: [PATCH 3/3] Removed empty strings --- aws/data_source_aws_elb_hosted_zone_id.go | 1 - aws/hosted_zones.go | 1 - 2 files changed, 2 deletions(-) diff --git a/aws/data_source_aws_elb_hosted_zone_id.go b/aws/data_source_aws_elb_hosted_zone_id.go index 7957059a570..6bcf74bdf99 100644 --- a/aws/data_source_aws_elb_hosted_zone_id.go +++ b/aws/data_source_aws_elb_hosted_zone_id.go @@ -25,7 +25,6 @@ var elbHostedZoneIdPerRegionMap = map[string]string{ "sa-east-1": "Z2P70J7HTTTPLU", "us-gov-west-1": "048591011584", "cn-north-1": "638102146993", - "cn-northwest-1": "", // Not supported as of January 2018 } func dataSourceAwsElbHostedZoneId() *schema.Resource { diff --git a/aws/hosted_zones.go b/aws/hosted_zones.go index 464a43b9f03..9550e46d60b 100644 --- a/aws/hosted_zones.go +++ b/aws/hosted_zones.go @@ -20,7 +20,6 @@ var hostedZoneIDsMap = map[string]string{ "ca-central-1": "Z1QDHH18159H29", "sa-east-1": "Z7KQH4QJS55SO", "us-gov-west-1": "Z31GFT0UA1I2HV", - "cn-northwest-1": "", // Not supported as of January 2018 } // Returns the hosted zone ID for an S3 website endpoint region. This can be