mirror of
https://github.com/serverless/serverless.git
synced 2026-02-01 16:07:28 +00:00
Merge pull request #6624 from serverless/GetAttParserTail
Allow for tail on GetAtt parsing
This commit is contained in:
commit
573e843b6e
@ -30,7 +30,10 @@ const yamlType = (name, kind) => {
|
||||
construct: data => {
|
||||
if (name === 'GetAtt') {
|
||||
// special GetAtt dot syntax
|
||||
return { [functionName]: _.isString(data) ? _.split(data, '.', 2) : data };
|
||||
if (typeof data === 'string') {
|
||||
const [first, ...tail] = data.split('.');
|
||||
data = [first, tail.join('.')];
|
||||
}
|
||||
}
|
||||
return { [functionName]: data };
|
||||
},
|
||||
|
||||
@ -19,6 +19,11 @@ const shortHandOptions = [
|
||||
yaml: 'Item: !GetAtt MyResource.Arn',
|
||||
json: { Item: { 'Fn::GetAtt': ['MyResource', 'Arn'] } },
|
||||
},
|
||||
{
|
||||
name: 'GetAtt, dot syntax with tail',
|
||||
yaml: 'Item: !GetAtt MyResource.Outputs.Arn',
|
||||
json: { Item: { 'Fn::GetAtt': ['MyResource', 'Outputs.Arn'] } },
|
||||
},
|
||||
{
|
||||
name: 'GetAtt, array syntax',
|
||||
yaml: 'Item: !GetAtt\n- MyResource\n- Arn',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user