raul
1
In a serverless.ts file, how can I define the Stream ARN in a Lambda?
hello: {
handler: "src/handler.hello",
events: [
{
stream: {
arn: { "Fn::GetAtt": ["UsersTable", "StreamArn"] },
},
},
],
},
Doing it the way above returns an error since the ARN object is being parsed as an array, which is not valid as the ARN requires a string.
any luck ?? looking for the same
Using the typescript node.js serverless template, I was able to use a Kinesis Stream Arn using the following syntax:
functions: {
ingestion: {
handler: 'handler.ingestStream',
events: [
{
stream: {
type: 'kinesis',
arn: { 'Fn::GetAtt': ['SuperSweetStream', 'Arn'] },
},
}
]
}
},
resources: {
Resources: {
'SuperSweetStream': {
'Type' : 'AWS::Kinesis::Stream',
'Properties' : {
'Name' : '${self:service}-stream',
'RetentionPeriodHours' : 24,
'ShardCount' : 3,
}
}
}
}