Skip to content

Commit

Permalink
Merge pull request #70 from ramgrandhi/master
Browse files Browse the repository at this point in the history
Added support for CFN definitionSubstitutions
  • Loading branch information
ChristopheBougere authored Feb 24, 2021
2 parents 8f609c8 + 0faf53b commit e91db36
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Comment": "https://states-language.net/spec.html#parameters",
"StartAt": "X",
"States": {
"X": {
"Type": "Task",
"Resource": "${lambdaArn",
"Parameters": {
"flagged": true,
"parts": {
"first.$": "$.vals[0]",
"last3.$": "$.vals[3:]"
}
},
"End": true
}
}
}
18 changes: 18 additions & 0 deletions src/__tests__/definitions/valid-cfn-definition-substitutions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Comment": "https://states-language.net/spec.html#parameters",
"StartAt": "X",
"States": {
"X": {
"Type": "Task",
"Resource": "${lambdaArn}",
"Parameters": {
"flagged": true,
"parts": {
"first.$": "$.vals[0]",
"last3.$": "$.vals[3:]"
}
},
"End": true
}
}
}
2 changes: 1 addition & 1 deletion src/schemas/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"Resource": {
"oneOf": [{
"type": "string",
"pattern": "^arn:aws:([a-z]|-)+:([a-z]|[0-9]|-)*:[0-9]*:([a-z]|-)+:[a-zA-Z0-9-_.]+(:(\\$LATEST|[a-zA-Z0-9-_]+))?$"
"pattern": "^(arn:aws:([a-z]|-)+:([a-z]|[0-9]|-)*:[0-9]*:([a-z]|-)+:[a-zA-Z0-9-_.]+(:(\\$LATEST|[a-zA-Z0-9-_]+))?$)|(\\${.*\\})"
}, {
"type": "object"
}]
Expand Down

0 comments on commit e91db36

Please sign in to comment.