This repository has been archived by the owner on Apr 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Sub not throwing errors, raised in issue #39
- Loading branch information
1 parent
6bf362f
commit 068edd3
Showing
7 changed files
with
130 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Resources: | ||
MyMisspeltBucket: | ||
Type: AWS::S3::Bucket | ||
|
||
MyLogBucket: | ||
Type: AWS::S3::Bucket | ||
Properties: | ||
BucketName: !Sub "${MyBucket.DomainName}-Logs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Resources: | ||
MyMisspeltBucket: | ||
Type: AWS::S3::Bucket | ||
|
||
MyLogBucket: | ||
Type: AWS::S3::Bucket | ||
Properties: | ||
BucketName: !Sub "${MyBucket}-Logs" |
13 changes: 13 additions & 0 deletions
13
test/data/invalid/yaml/issue-39-output-reference-invalid.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Resources: | ||
MyBucket: | ||
Type: AWS::S3::Bucket | ||
|
||
Outputs: | ||
SomeOutput: | ||
Value: !Ref SomethingMissing | ||
|
||
SomeOtherOutput: | ||
Value: !Sub "Something-${SomethingMissing}" | ||
|
||
YetAnotherOutput: | ||
Value: !Join [" ", ["A", !Ref SomethingMissing]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Resources: | ||
MyBucket: | ||
Type: AWS::S3::Bucket | ||
|
||
Outputs: | ||
SomeOtherOutput: | ||
Value: !Ref MyBucket | ||
|
||
Output2: | ||
Value: !Sub "Output-${MyBucket}" | ||
|
||
Output3: | ||
Value: !GetAtt MyBucket.DomainName | ||
|
||
Output4: | ||
Value: !Join ["", [!Ref MyBucket, "Something"]] | ||
|
||
Output5: | ||
Value: | ||
Fn::Sub: | ||
- "Some ${Param1} or {$Param2} string" | ||
- {Param1: "a", Param2: !Ref "MyBucket"} |
51 changes: 27 additions & 24 deletions
51
...ta/valid/yaml/valid_sub_with_var_map.yaml → ...data/valid/yaml/valid_sub_operations.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
|
||
Resources: | ||
WebServerSecurityGroup: | ||
Type: AWS::EC2::SecurityGroup | ||
Properties: | ||
GroupDescription: "Enable HTTP access via port 80 locked down to the load balancer + SSH access" | ||
SecurityGroupIngress: | ||
- CidrIp: 0.0.0.0/0 | ||
FromPort: '80' | ||
IpProtocol: tcp | ||
ToPort: '80' | ||
|
||
Outputs: | ||
Output2: | ||
Description: Output2 | ||
Value: !Sub "${WebServerSecurityGroup}" | ||
|
||
Output3: | ||
Description: Output1 | ||
Value: | ||
Fn::Sub: | ||
- "Some ${Param1} or {$Param2} string" | ||
- {Param1: "a", Param2: !Ref "WebServerSecurityGroup"} | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
|
||
Resources: | ||
WebServerSecurityGroup: | ||
Type: AWS::EC2::SecurityGroup | ||
Properties: | ||
GroupDescription: "Enable HTTP access via port 80 locked down to the load balancer + SSH access" | ||
SecurityGroupIngress: | ||
- CidrIp: 0.0.0.0/0 | ||
FromPort: '80' | ||
IpProtocol: tcp | ||
ToPort: '80' | ||
|
||
Outputs: | ||
Output2: | ||
Description: Output2 | ||
Value: !Sub "${WebServerSecurityGroup}" | ||
|
||
Output3: | ||
Description: Output1 | ||
Value: | ||
Fn::Sub: | ||
- "Some ${Param1} or {$Param2} string" | ||
- {Param1: "a", Param2: !Ref "WebServerSecurityGroup"} | ||
|
||
Output1: | ||
Value: !Sub "${WebServerSecurityGroup.GroupId}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters