Skip to content
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

Merged
merged 2 commits into from
Dec 2, 2017

Conversation

flou
Copy link
Contributor

@flou flou commented Oct 24, 2017

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.

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
Copy link
Member

@markpeek markpeek left a 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...

@@ -10,13 +10,13 @@ class ComputeResources(AWSProperty):
"SecurityGroupIds": ([basestring], True),
"BidPercentage": (positive_integer, False),
"Type": (basestring, True),
"Subnets": ([basestring], True),
"Subnets": (list, True),
Copy link
Member

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.

Copy link
Contributor Author

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),
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

@markpeek markpeek merged commit 8003a80 into cloudtools:master Dec 2, 2017
@markpeek
Copy link
Member

markpeek commented Dec 2, 2017

Thanks! (Note: I did revert the Subnet change)

@markpeek markpeek mentioned this pull request Dec 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants