Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Fixes validation of AWS::URLSuffix #174

Merged
merged 6 commits into from
Jun 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion data/aws_ref_override.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"AWS::NotificationARNs": ["arn:aws:sns:us-east-1:123456789012:MyTopic"],
"AWS::Region": "eu-west-1",
"AWS::StackId": "AWSREFSTACKID",
"AWS::StackName": "AWSREFSTACKNAME"
"AWS::StackName": "AWSREFSTACKNAME",
"AWS::URLSuffix": "amazonaws.com"
}
1 change: 1 addition & 0 deletions src/awsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ type RefOverrides = {
"AWS::Region": string,
"AWS::StackId": string,
"AWS::StackName": string,
"AWS::URLSuffix": string,
[refOverride: string]: any
};

Expand Down
8 changes: 8 additions & 0 deletions src/test/validatorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,14 @@ describe('validator', () => {
expect(result['errors']['crit']).to.have.lengthOf(0);
expect(result['errors']['warn']).to.have.lengthOf(0);
});

it('using the pseudo parameter AWS::URLSuffix should result in validTemplate = true, no crit errors, no warnings', () => {
const input = 'testData/valid/yaml/issue-173-url-suffix-pseudo-parameter.yaml';
let result = validator.validateFile(input);
expect(result).to.have.deep.property('templateValid', true);
expect(result['errors']['crit']).to.have.lengthOf(0);
expect(result['errors']['warn']).to.have.lengthOf(0);
});
});

describe('custom-resource-attributes', () => {
Expand Down
12 changes: 12 additions & 0 deletions testData/valid/yaml/issue-173-url-suffix-pseudo-parameter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Resources:
TestLambdaPermissionEventsRuleSchedule1:
Type: AWS::Lambda::Permission
Properties:
FunctionName: test
Action: lambda:InvokeFunction
Principal:
Fn::Join:
- ''
- - events.
- Ref: AWS::URLSuffix
SourceArn: arn:aws:lambda:us-east-1:123456789012:function:Test