Skip to content

Commit fcf4acc

Browse files
author
Sean Smith
committed
Add Support for GovCloud East
Signed-off-by: Sean Smith <[email protected]>
1 parent ceacecf commit fcf4acc

File tree

7 files changed

+9
-13
lines changed

7 files changed

+9
-13
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CHANGELOG
44

55
2.0.2
66
=====
7+
* Add support for GovCloud East, us-gov-east-1 region
78
* Fix regression with `shared_dir` parameter in the cluster configuration section.
89
* bugfix:``cfncluster-cookbook``: Fix issue with jq on ubuntu1404 and centos6. Now using version 1.4.
910
* bugfix:``cfncluster-cookbook``: Fix dependency issue with AWS CLI package on ubuntu1404.

cli/awsbatch/awsbstat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def _compose_log_stream_url(region, log_stream):
6060
:param log_stream: the log stream name
6161
:return: an url
6262
"""
63-
domain = 'amazonaws-us-gov' if region == 'us-gov-west-1' else 'aws'
63+
domain = 'amazonaws-us-gov' if region.startswith('us-gov') else 'aws'
6464
return "https://console.{0}.amazon.com/cloudwatch/home?" \
6565
"region={1}#logEventViewer:group=/aws/batch/job;stream={2}".format(domain, region, log_stream)
6666

cli/pcluster/cfnconfig.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,7 @@ def __init__(self, args):
290290
config_sanity.check_resource(self.region, self.aws_access_key_id, self.aws_secret_access_key,
291291
'URL', self.template_url)
292292
except configparser.NoOptionError:
293-
if self.region == 'us-gov-west-1':
294-
self.template_url = ('https://s3-%s.amazonaws.com/%s-aws-parallelcluster/templates/aws-parallelcluster-%s.cfn.json'
295-
% (self.region, self.region, self.version))
296-
elif self.region == 'us-east-1':
293+
if self.region == 'us-east-1':
297294
self.template_url = ('https://s3.amazonaws.com/%s-aws-parallelcluster/templates/aws-parallelcluster-%s.cfn.json'
298295
% (self.region, self.version))
299296
else:

cli/pcluster/config_sanity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from botocore.exceptions import ClientError
2323

2424
def get_partition(region):
25-
if region == 'us-gov-west-1':
25+
if region.startswith('us-gov'):
2626
return 'aws-us-gov'
2727
return 'aws'
2828

@@ -183,7 +183,7 @@ def check_resource(region, aws_access_key_id, aws_secret_access_key, resource_ty
183183
# Batch Parameters
184184
elif resource_type == 'AWSBatch_Parameters':
185185
# Check region
186-
if region in ['us-gov-west-1', 'eu-west-3', 'ap-northeast-3']:
186+
if region in ['us-gov-west-1', 'us-gov-east-1', 'eu-west-3', 'ap-northeast-3']:
187187
print ("ERROR: %s region is not supported with awsbatch" % region)
188188
sys.exit(1)
189189

cli/pcluster/pcluster.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,7 @@ def get_cookbook_url(config, tmpdir):
617617
return config.args.custom_ami_cookbook
618618
else:
619619
cookbook_version = get_cookbook_version(config, tmpdir)
620-
if config.region == 'us-gov-west-1':
621-
return ('https://s3-%s.amazonaws.com/%s-aws-parallelcluster/cookbooks/%s.tgz'
622-
% (config.region, config.region, cookbook_version))
623-
elif config.region == 'us-east-1':
620+
if config.region == 'us-east-1':
624621
return ('https://s3.amazonaws.com/%s-aws-parallelcluster/cookbooks/%s.tgz'
625622
% (config.region, cookbook_version))
626623
else:
@@ -774,7 +771,7 @@ def create_ami(args):
774771
if config.aws_secret_access_key:
775772
packer_env['AWS_SECRET_ACCESS_KEY'] = config.aws_secret_access_key
776773

777-
if config.region == 'us-gov-west-1':
774+
if config.region.startswith('us-gov'):
778775
partition = 'govcloud'
779776
else:
780777
partition = 'commercial'

docs/getting_started.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ cluster to run.
102102
ap-southeast-2
103103
us-west-2
104104
us-gov-west-1
105+
us-gov-east-1
105106
us-west-1
106107
eu-central-1
107108
sa-east-1

util/generate-ami-list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_ami_list(regions, date, version, owner):
4646
else:
4747
amis_json[region_name] = OrderedDict(sorted(amis.items()))
4848
except ClientError:
49-
# skip regions on which we are not authorized (cn-north-1 and us-gov-west-1)
49+
# skip regions on which we are not authorized (cn-north-1)
5050
pass
5151

5252
return amis_json

0 commit comments

Comments
 (0)