Skip to content

Commit f9ff393

Browse files
authored
Merge pull request #610 from awslabs/develop
1.6.1 develop to master merge
2 parents 11f29da + be76b28 commit f9ff393

File tree

8 files changed

+30
-19
lines changed

8 files changed

+30
-19
lines changed

CHANGELOG.rst

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
CHANGELOG
33
=========
44

5+
1.6.1
6+
=====
7+
* Fix a bug in `cfncluster configure` introduced in 1.6.0
8+
59
1.6.0
610
=====
711
* Refactor scaling up to take into account the number of pending/requested jobs/slots and instance slots.

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ Changes
108108

109109
CfnCluster 1.6 IAM Change
110110
=========================
111-
Between CfnCluster 1.5.3 and 1.6.0 we made a change to the CfnClusterInstancePolicy that adds “s3:GetObject” permissions
111+
Between CfnCluster 1.5.4 and 1.6.0 we made a change to the CfnClusterInstancePolicy that adds “s3:GetObject” permissions
112112
on objects in <REGION>-cfncluster bucket, "autoscaling:SetDesiredCapacity", "autoscaling:DescribeTags" permissions and
113-
"cloudformation:DescribeStacks" permissions on <REGION>:<ACCOUNT_NAME>:<STACK_NAME>.
113+
"cloudformation:DescribeStacks" permissions on <REGION>:<ACCOUNT_ID>:stack/cfncluster-*.
114114
115115
If you’re using a custom policy (e.g. you specify "ec2_iam_role" in your config) be sure it includes this new permission. See https://cfncluster.readthedocs.io/en/latest/iam.html
116116

cli/cfncluster/cfnconfig.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def __init__(self, args):
153153
print("ERROR: key_name set in [%s] section but not defined." % self.__cluster_section)
154154
sys.exit(1)
155155
if self.__sanity_check:
156-
config_sanity.check_resource(self.region, self.args.cluster_name, self.aws_access_key_id, self.aws_secret_access_key,
156+
config_sanity.check_resource(self.region, self.aws_access_key_id, self.aws_secret_access_key,
157157
'EC2KeyPair', self.key_name)
158158
except configparser.NoOptionError:
159159
print("ERROR: Missing key_name option in [%s] section." % self.__cluster_section)
@@ -173,7 +173,7 @@ def __init__(self, args):
173173
print("ERROR: template_url set in [%s] section but not defined." % self.__cluster_section)
174174
sys.exit(1)
175175
if self.__sanity_check:
176-
config_sanity.check_resource(self.region, self.args.cluster_name, self.aws_access_key_id, self.aws_secret_access_key,
176+
config_sanity.check_resource(self.region, self.aws_access_key_id, self.aws_secret_access_key,
177177
'URL', self.template_url)
178178
except configparser.NoOptionError:
179179
if self.region == 'us-gov-west-1':
@@ -208,7 +208,7 @@ def __init__(self, args):
208208
% (key, self.__vpc_section))
209209
sys.exit(1)
210210
if self.__sanity_check and self.__vpc_options.get(key)[1] is not None:
211-
config_sanity.check_resource(self.region, self.args.cluster_name, self.aws_access_key_id, self.aws_secret_access_key,
211+
config_sanity.check_resource(self.region, self.aws_access_key_id, self.aws_secret_access_key,
212212
self.__vpc_options.get(key)[1],__temp__)
213213
self.parameters.append((self.__vpc_options.get(key)[0],__temp__))
214214
except configparser.NoOptionError:
@@ -245,7 +245,7 @@ def __init__(self, args):
245245
% (key, self.__cluster_section))
246246
sys.exit(1)
247247
if self.__sanity_check and self.__cluster_options.get(key)[1] is not None:
248-
config_sanity.check_resource(self.region, self.args.cluster_name, self.aws_access_key_id, self.aws_secret_access_key,
248+
config_sanity.check_resource(self.region, self.aws_access_key_id, self.aws_secret_access_key,
249249
self.__cluster_options.get(key)[1],__temp__)
250250
self.parameters.append((self.__cluster_options.get(key)[0],__temp__))
251251
except configparser.NoOptionError:
@@ -294,7 +294,7 @@ def __init__(self, args):
294294
% (key, self.__ebs_section))
295295
sys.exit(1)
296296
if self.__sanity_check and self.__ebs_options.get(key)[1] is not None:
297-
config_sanity.check_resource(self.region, self.args.cluster_name, self.aws_access_key_id, self.aws_secret_access_key,
297+
config_sanity.check_resource(self.region, self.aws_access_key_id, self.aws_secret_access_key,
298298
self.__ebs_options.get(key)[1],__temp__)
299299
self.parameters.append((self.__ebs_options.get(key)[0],__temp__))
300300
except configparser.NoOptionError:
@@ -326,7 +326,7 @@ def __init__(self, args):
326326
% (key, self.__scaling_section))
327327
sys.exit(1)
328328
if self.__sanity_check and self.__scaling_options.get(key)[1] is not None:
329-
config_sanity.check_resource(self.region, self.args.cluster_name, self.aws_access_key_id, self.aws_secret_access_key,
329+
config_sanity.check_resource(self.region, self.aws_access_key_id, self.aws_secret_access_key,
330330
self.__scaling_options.get(key)[1],__temp__)
331331
self.parameters.append((self.__scaling_options.get(key)[0],__temp__))
332332
except configparser.NoOptionError:

cli/cfncluster/config_sanity.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def get_partition(region):
2525
return 'aws-us-gov'
2626
return 'aws'
2727

28-
def check_resource(region, cluster_name, aws_access_key_id, aws_secret_access_key, resource_type,resource_value):
28+
29+
def check_resource(region, aws_access_key_id, aws_secret_access_key, resource_type, resource_value):
2930

3031
# Loop over all supported resource checks
3132
# EC2 KeyPair
@@ -56,7 +57,7 @@ def check_resource(region, cluster_name, aws_access_key_id, aws_secret_access_ke
5657
(['sqs:SendMessage', 'sqs:ReceiveMessage', 'sqs:ChangeMessageVisibility', 'sqs:DeleteMessage', 'sqs:GetQueueUrl'], "arn:%s:sqs:%s:%s:cfncluster-*" % (partition, region, accountid)),
5758
(['autoscaling:DescribeAutoScalingGroups', 'autoscaling:TerminateInstanceInAutoScalingGroup', 'autoscaling:SetDesiredCapacity', 'autoscaling:DescribeTags', 'autoScaling:UpdateAutoScalingGroup'], "*"),
5859
(['dynamodb:PutItem', 'dynamodb:Query', 'dynamodb:GetItem', 'dynamodb:DeleteItem', 'dynamodb:DescribeTable'], "arn:%s:dynamodb:%s:%s:table/cfncluster-*" % (partition, region, accountid)),
59-
(['cloudformation:DescribeStacks'], "arn:%s:cloudformation:%s:%s:stack/cfncluster-%s/*" % (partition, region, accountid, cluster_name)),
60+
(['cloudformation:DescribeStacks'], "arn:%s:cloudformation:%s:%s:stack/cfncluster-*" % (partition, region, accountid)),
6061
(['s3:GetObject'], "arn:%s:s3:::%s-cfncluster/*" % (partition, region)),
6162
(['sqs:ListQueues'], "*"),
6263
(['logs:*'], "arn:%s:logs:*:*:*" % partition)]

cli/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def read(fname):
2020
return open(os.path.join(os.path.dirname(__file__), fname)).read()
2121

2222
console_scripts = ['cfncluster = cfncluster.cli:main']
23-
version = "1.6.0"
23+
version = "1.6.1"
2424
requires = ['boto3>=1.7.33', 'awscli>=1.11.175', 'future>=0.16.0']
2525

2626
if sys.version_info[:2] == (2, 6):

cloudformation/cfncluster.cfn.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@
17101710
},
17111711
"CfnClusterVersions": {
17121712
"default": {
1713-
"cfncluster": "cfncluster-1.6.0",
1713+
"cfncluster": "cfncluster-1.6.1",
17141714
"cookbook": "cfncluster-cookbook-1.6.0",
17151715
"chef": "14.2.0",
17161716
"ridley": "5.1.1",
@@ -1952,11 +1952,7 @@
19521952
{
19531953
"Ref": "AWS::AccountId"
19541954
},
1955-
":stack/",
1956-
{
1957-
"Ref": "AWS::StackName"
1958-
},
1959-
"/*"
1955+
":stack/cfncluster-*"
19601956
]
19611957
]
19621958
}

docs/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# The short X.Y version.
5353
version = '1.6'
5454
# The full version, including alpha/beta/rc tags.
55-
release = '1.6.0'
55+
release = '1.6.1'
5656

5757
# The language for content autogenerated by Sphinx. Refer to documentation
5858
# for a list of supported languages.

docs/source/iam.rst

+11-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ IAM in CfnCluster
44
========================
55

66
.. warning::
7-
Between CfnCluster 1.5.3 and 1.6.0 we added a change to the `CfnClusterInstancePolicy` that adds “s3:GetObject” permissions on objects in <REGION>-cfncluster bucket and cloudformation:DescribeStacks" permissions on <REGION>:<ACCOUNT_NAME>:<STACK_NAME>
7+
Between CfnCluster 1.5.4 and 1.6.0 we added a change to the `CfnClusterInstancePolicy` that adds “s3:GetObject” permissions on objects in <REGION>-cfncluster bucket and cloudformation:DescribeStacks" permissions on <REGION>:<ACCOUNT_ID>:stack/cfncluster-*
88
If you're using a custom policy (e.g. you specify "ec2_iam_role" in your config) be sure it includes this new permission.
99

1010
Between CfnCluster 1.4.2 and 1.5.0 we added a change to the `CfnClusterInstancePolicy` that adds "ec2:DescribeVolumes" permissions. If you're using a custom policy (e.g. you specify "ec2_iam_role" in your config) be sure it includes this new permission.
@@ -107,6 +107,16 @@ CfnClusterInstancePolicy
107107
"Sid": "S3GetObj",
108108
"Effect": "Allow"
109109
},
110+
{
111+
"Resource": [
112+
"arn:aws:cloudformation:<REGION>:<AWS ACCOUNT ID>:stack/cfncluster-*"
113+
],
114+
"Action": [
115+
"cloudformation:DescribeStacks"
116+
],
117+
"Sid": "CloudFormationDescribe",
118+
"Effect": "Allow"
119+
},
110120
{
111121
"Resource": [
112122
"*"

0 commit comments

Comments
 (0)