cloudtools / cloudtools/troposphere

cfn2py crashes on nested functions

Open
#229 1 comment 2 reactions 0 assignees View on GitHub
cfn2py
Dominant language
Python
Stars
4.9k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

I have a template that stands up a VPC, subnets and, route tables, IGW, etc. Running it through cnf2py causes the following crash:

```
Traceback (most recent call last):
File "/usr/local/bin/cfn2py", line 332, in
globals()["do_" + s.lower()](d)
File "/usr/local/bin/cfn2py", line 232, in do_resources
print ' %s=%s,' % (pk, output_value(pv))
File "/usr/local/bin/cfn2py", line 286, in output_value
return handler(shortname, fv)
File "/usr/local/bin/cfn2py", line 251, in handle_one_object
ret += objects.lookup(param)
File "/usr/local/bin/cfn2py", line 23, in lookup
if o in self.objects:
TypeError: unhashable type: 'dict'
```

Here is the block it's choking on, specifically when processing the Availability zone block:

```
"SubPubLb3": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"VpcId": {
"Ref": "Vpc"
},
"AvailabilityZone": {
"Fn::Select": [
{
"Ref": "SegmentAz3"
},
{
"Fn::GetAZs": ""
}
]
},
"CidrBlock": {
"Fn::Join": [
".",
[
{
"Ref": "VpcCidrPrefixThis"
},
"0.128/26"
]
]
},
"Tags": [
{
"Value": {
"Fn::Join": [
"",
[
{
"Ref": "NameTagPrefix"
},
"SubPubLb3"
]
]
},
"Key": "Name"
}
]
}
},
```

It appears that nested intrinsic functions may not be processed correctly.

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.