diff --git a/src/__tests__/definitions/invalid-cfn-definition-substitutions.json b/src/__tests__/definitions/invalid-cfn-definition-substitutions.json new file mode 100644 index 0000000..9bdd23b --- /dev/null +++ b/src/__tests__/definitions/invalid-cfn-definition-substitutions.json @@ -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 + } + } +} diff --git a/src/__tests__/definitions/valid-cfn-definition-substitutions.json b/src/__tests__/definitions/valid-cfn-definition-substitutions.json new file mode 100644 index 0000000..7bc55cb --- /dev/null +++ b/src/__tests__/definitions/valid-cfn-definition-substitutions.json @@ -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 + } + } +} diff --git a/src/schemas/task.json b/src/schemas/task.json index e60fecc..fa03445 100644 --- a/src/schemas/task.json +++ b/src/schemas/task.json @@ -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" }]