Daniel Gato
01/15/2022, 7:11 PM'POST /collect': {
function: {
handler: 'src/analytics/create.main',
environment: {
ANALYTICS_DELIVERY_STREAM_NAME: analyticsDeliveryStream.deliveryStreamName,
},
permissions: [analyticsDeliveryStream],
},
},
When I add it, it says Error: The specified permissions are not supported.
Is there a way to go around it?Daniel Gato
01/15/2022, 7:27 PMFrank
analyticsDeliveryStream
?Daniel Gato
01/15/2022, 8:48 PMexport default class AnalyticsStack extends sst.Stack {
constructor(scope, id, props) {
super(scope, id, props);
this.analyticsBucket = new sst.Bucket(this, 'Analytics');
this.deliveryStream = new firehose.DeliveryStream(this, 'Delivery Stream', {
destinations: [new destinations.S3Bucket(this.analyticsBucket.s3Bucket)],
});
}
}
Daniel Gato
01/15/2022, 8:53 PMPOST /collect': {
function: {
handler: 'src/analytics/create.main',
environment: {
ANALYTICS_DELIVERY_STREAM_NAME: analyticsDeliveryStream.deliveryStreamName,
},
permissions: [
new iam.PolicyStatement({
actions: ['firehose:PutRecord'],
effect: iam.Effect.ALLOW,
resources: [analyticsDeliveryStream.deliveryStreamArn],
}),
// 'firehose:PutRecord',
],
},
Frank
DeliverStream
wasn’t supported by the shorthand permission syntax - https://docs.serverless-stack.com/util/Permissions#supported-constructsFrank
Frank
permissions: [analyticsDeliveryStream],
Daniel Gato
01/16/2022, 10:57 PM