iann0036 / AWSConsoleRecorder

Records actions made in the AWS Management Console and outputs the equivalent CLI/SDK commands and CloudFormation/Terraform templates.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strange behavior for References to Logical IDs (CFN)

ustrahlendorf opened this issue · comments

Describe the bug
I see a strange behavior regarding values for references to logical id's. I have created a simple VPC with 2 subnets and Routing tables etc. This is an example what I got for the CFN subnet resource:
ec2733a861:
Type: "AWS::EC2::VPCGatewayAttachment"
Properties:
VpcId: !Ref ec28471949
InternetGatewayId: !Sub "${ec282e532e.Ipv6CidrBlocks}${ec282e532e.Ipv6CidrBlocks}${ec282e532e.Ipv6CidrBlocks}${ec282e532e.Ipv6CidrBlocks}${ec282e532e.Ipv6CidrBlocks}${ec282e532e.Ipv6CidrBlocks}${ec282e532e.Ipv6CidrBlocks}${ec282e532e.Ipv6CidrBlocks}${ec282e532e.Ipv6CidrBlocks}${ec282e532e.Ipv6CidrBlocks}${ec2eb0ae6e.Ipv6CidrBlocks}${ec2eb0ae6e.Ipv6CidrBlocks}${ec2eb0ae6e.Ipv6CidrBlocks}${ec2eb0ae6e.Ipv6CidrBlocks}${ec2eb0ae6e.Ipv6CidrBlocks}${ec2eb0ae6e.Ipv6CidrBlocks}${ec2eb0ae6e.Ipv6CidrBlocks}${ec2eb0ae6e.Ipv6CidrBlocks}${ec2eb0ae6e.Ipv6CidrBlocks}${ec2eb0ae6e.Ipv6CidrBlocks}${ec2320da02}"

I see this entries with Ipv6CidrBlocks at nearly every resource.
I also don't understand why the recorder is using !Sub function and not !Ref.

Thanks for raising.

I believe this is caused when a return value is an empty array, which was being handled incorrectly. I've tried to mitigate this in 0.3.21, but haven't managed to completely confirm.

Could you see if the new version helps avoid this?

Hi Ian,
top, just checked 0.3.21 and it works fine for me. The mentioned issue was gone. Found two other bugs, will raise separate new issues about them.
I take care that you have no boredum ;-).
take care
Uwe