mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Minor fixes / enhancements
This commit is contained in:
parent
4c0268eb7e
commit
dce099c0bc
@ -54,7 +54,7 @@ functions:
|
||||
- kinesis
|
||||
- Ref: AWS::Region
|
||||
- Ref: AWS::AccountId
|
||||
- MyOtherKinesisStream
|
||||
- stream/MyOtherKinesisStream
|
||||
```
|
||||
|
||||
## Setting the BatchSize and StartingPosition
|
||||
|
||||
@ -75,9 +75,9 @@ class AwsCompileStreamEvents {
|
||||
|| _.has(event.stream.arn, 'Fn::Join'))) {
|
||||
const errorMessage = [
|
||||
`Bad dynamic ARN property on stream event in function "${functionName}"`,
|
||||
' If you use a dynamic "arn" (such as with Fn::GetAtt or Fn::ImportValue)',
|
||||
' there must only be one key (either Fn::GetAtt or Fn::ImportValue) in the arn',
|
||||
' object. Please check the docs for more info.',
|
||||
' If you use a dynamic "arn" (such as with Fn::GetAtt, Fn::Join',
|
||||
' or Fn::ImportValue) there must only be one key (either Fn::GetAtt, Fn::Join',
|
||||
' or Fn::ImportValue) in the arn object. Please check the docs for more info.',
|
||||
].join('');
|
||||
throw new this.serverless.classes
|
||||
.Error(errorMessage);
|
||||
@ -112,7 +112,11 @@ class AwsCompileStreamEvents {
|
||||
return EventSourceArn['Fn::ImportValue'];
|
||||
} else if (EventSourceArn['Fn::Join']) {
|
||||
// [0] is the used delimiter, [1] is the array with values
|
||||
return EventSourceArn['Fn::Join'][1].slice(-1).pop();
|
||||
const name = EventSourceArn['Fn::Join'][1].slice(-1).pop();
|
||||
if (name.split('/').length) {
|
||||
return name.split('/').pop();
|
||||
}
|
||||
return name;
|
||||
}
|
||||
return EventSourceArn.split('/')[1];
|
||||
}());
|
||||
|
||||
@ -443,7 +443,7 @@ describe('AwsCompileStreamEvents', () => {
|
||||
}, {
|
||||
Ref: 'AWS::AccountId',
|
||||
},
|
||||
'MyStream',
|
||||
'stream/MyStream',
|
||||
],
|
||||
],
|
||||
},
|
||||
@ -510,7 +510,7 @@ describe('AwsCompileStreamEvents', () => {
|
||||
}, {
|
||||
Ref: 'AWS::AccountId',
|
||||
},
|
||||
'MyStream',
|
||||
'stream/MyStream',
|
||||
],
|
||||
],
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user