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

Commit

Permalink
Added support for "Fn::ImportValue" to "Fn::Split" intrinsic function. (
Browse files Browse the repository at this point in the history
  • Loading branch information
RazzM13 authored and martysweet committed Jun 30, 2018
1 parent 0f6f1b5 commit 645ce2a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data/aws_intrinsic_functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"Fn::Select": {},
"Fn::Select::Index": {"supportedFunctions": ["Ref", "Fn::FindInMap"]},
"Fn::Select::List": {"supportedFunctions" : ["Fn::FindInMap", "Fn::GetAtt", "Fn::GetAZs", "Fn::If", "Fn::Split", "Ref"] },
"Fn::Split": {"supportedFunctions": ["Fn::Base64", "Fn::FindInMap", "Fn::GetAtt", "Fn::If", "Fn::Join", "Fn::Select", "Ref"]},
"Fn::Split": {"supportedFunctions": ["Fn::Base64", "Fn::FindInMap", "Fn::GetAtt", "Fn::If", "Fn::Join", "Fn::Select", "Fn::ImportValue", "Ref"]},
"Fn::Sub": { "supportedFunctions": ["Fn::Base64", "Fn::FindInMap", "Fn::GetAtt", "Fn::GetAZs", "Fn::If", "Fn::Join", "Fn::Select", "Ref"]},
"Ref": {}
}
7 changes: 7 additions & 0 deletions src/test/validatorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,13 @@ describe('validator', () => {
expect(result['errors']['crit']).to.have.lengthOf(1);
expect(result['errors']['crit'][0]).to.have.property('message', 'Expecting a list, got null');
});

it('Fn::Split should support function "Fn::ImportValue"', () => {
const input = 'testData/valid/yaml/issue-170.yaml';
let result = validator.validateFile(input);
expect(result).to.have.deep.property('templateValid', true);
expect(result['errors']['crit']).to.have.lengthOf(0);
});
});

describe('parameters-validation', () => {
Expand Down
10 changes: 10 additions & 0 deletions testData/valid/yaml/issue-170.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Parameters:
SomeParameterValue:
Type: String

Resources:
MyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName:
!Select [0, !Split [',', !ImportValue SomeParameterValue]]

0 comments on commit 645ce2a

Please sign in to comment.