-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change AWS::Batch::ComputeResources.Tags type to dict #867
Conversation
fccee64
to
53615f1
Compare
AWS Batch seems to use a different Tag format. Instead of the usual ``` { 'Key': 'TagKey', 'Value': 'TagValue' } ``` AWS Batch expects a regular map `{'TagKey': 'TagValue'}`. This commit also adds an example template for AWS Batch. Make AWS::Batch::ComputeEnvironment.Subnets into a list
dd9dec6
to
f0321f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I made a couple of comments...
troposphere/batch.py
Outdated
@@ -10,13 +10,13 @@ class ComputeResources(AWSProperty): | |||
"SecurityGroupIds": ([basestring], True), | |||
"BidPercentage": (positive_integer, False), | |||
"Type": (basestring, True), | |||
"Subnets": ([basestring], True), | |||
"Subnets": (list, True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why this was changed? Using [basestring] is a list of basestrings which is more specific than just using list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a previous version of this PR, the example template used a CommaDelimitedList
for the Subnets
parameter type and the build failed for Python 2.7 (see https://travis-ci.org/cloudtools/troposphere/jobs/292160894). Not sure why it failed though…
So I figured I'd use the list
property type as in AWS::RDS::DBSubnetGroup.SubnetIds
or AWS::ElasticLoadBalancing::LoadBalancer.Subnets
.
"MinvCpus": (positive_integer, True), | ||
"ImageId": (basestring, False), | ||
"InstanceRole": (basestring, True), | ||
"InstanceTypes": ([basestring], True), | ||
"Ec2KeyPair": (basestring, False), | ||
"Tags": ([basestring], False), | ||
"Tags": (dict, False), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation is all over the map on this one as it is referring to the Tags as being normal Tags. I'll have to follow up with my AWS contacts to understand why there is a discrepancy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand. It took me a while to figure out how AWS Batch tags work, but when using normal Tags CloudFormation gives the following message:
Property validation failure: [Value of property {/ComputeResources/Tags} does not match type {Map}]
which is very weird when comparing with the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any news about this?
Thanks! (Note: I did revert the Subnet change) |
AWS Batch seems to use a different Tag format. Instead of the usual
AWS Batch expects a regular map
{'TagKey': 'TagValue'}
.This commit also adds an example template for AWS Batch.