Closed scottiedog45 closed 1 year ago
Probably duplicates https://github.com/awslabs/goformation/issues/551
@scottiedog45 The issue here seems to be nested short form tags not working as expected. Also, in the template the Environment
parameter doesn't have a default. I tested with the following template:
AWSTemplateFormatVersion: 2010-09-09
Description: The AWS CloudFormation template
Parameters:
Environment:
Type: String
Description: Environment name - dev, qa, or prod
AllowedValues:
- dev
- qa
- prod
ConstraintDescription: Must be dev, qa, or prod
Mappings:
Constant:
Value:
Name: foo
Resources:
SomeQueue:
Type: AWS::SQS::Queue
Properties:
RedrivePolicy:
maxReceiveCount: 3
QueueName:
"Fn::Join":
- '-'
- - 'useast1'
- !FindInMap [ Constant, Value, Name ]
- !Ref Environment
- 'resources'
After template resolution with the library, here are my results, which conform to my expectations (after changing the top level join to a long form version):
AWSTemplateFormatVersion: "2010-09-09T00:00:00Z"
Description: The AWS CloudFormation template
Mappings:
Constant:
Value:
Name: foo
Parameters:
Environment:
AllowedValues:
- dev
- qa
- prod
ConstraintDescription: Must be dev, qa, or prod
Description: Environment name - dev, qa, or prod
Type: String
Resources:
SomeQueue:
Properties:
QueueName: useast1-foo-resources
RedrivePolicy:
maxReceiveCount: 3
Type: AWS::SQS::Queue
As there is no default value for Environment
, it is omitted in the joined output of useast1-foo-resources
. It seems as though as long as there is no nesting of short form tags within short form tags, everything remains happy.
Looking at this now, thank you so much for the great examples that help me debug the problem!
Can you please try version 7.8.1 that we just released to see if it fixes the problem?
Given the following code and template, I would expect
useast1-foo-qa-resources
, but I getuseast1-Environment-resources
. I am new to the package, so might be using it incorrectly. Or, is this a bug?