cloudtools / cloudtools/troposphere

Add validation for mappings

Open
#426 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.9k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

First off, this library has been a godsend. Nice work! =D

I was working on a template today, and I added a mapping like this (pardon the grossness...):

```
template.add_mapping("HyperkubeImage", {
"official": {
"v1.1.2": "gcr.io/google_containers/hyperkube:v1.1.2",
"v1.1.4": "gcr.io/google_containers/hyperkube:v1.1.4",
"v1.1.7": "gcr.io/google_containers/hyperkube:v1.1.7",
"v1.1.8": "gcr.io/google_containers/hyperkube:v1.1.8",
"v1.2.0-beta.0": "gcr.io/google_containers/hyperkube:v1.2.0-beta.0"
},
"coreos": {
"v1.1.7-coreos.1": "quay.io/coreos/hyperkube:v1.1.7-coreos.1",
"v1.1.8-coreos.0": "quay.io/coreos/hyperkube:v1.1.8-coreos.0"
}
})
```

The final JSON was generated just fine, but when I tried to pass it to CloudFormation from the AWS CLI, I got the error:

```
A client error (ValidationError) occurred when calling the CreateStack operation:
Template format error: Mappings attribute name 'v1.1.2' must contain only alphanumeric characters.
```

It would be nice if Troposphere could catch these sort of errors prior to rendering the template.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.