Skip to content

Commit

Permalink
Remove CfnBucket hack meant to appease localstack
Browse files Browse the repository at this point in the history
  • Loading branch information
brainstorm committed Dec 14, 2023
1 parent aa111ce commit bb96c15
Showing 1 changed file with 3 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { RustFunction, Settings as CargoSettings } from 'rust.aws-cdk-lambda';
import { Architecture } from 'aws-cdk-lib/aws-lambda';
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as rds from 'aws-cdk-lib/aws-rds';
import { CfnBucket } from 'aws-cdk-lib/aws-s3';
import * as sqs from 'aws-cdk-lib/aws-sqs';
import * as lambdaDestinations from 'aws-cdk-lib/aws-lambda-destinations';
import * as lambdaEventSources from 'aws-cdk-lib/aws-lambda-event-sources';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager';
import * as s3n from 'aws-cdk-lib/aws-s3-notifications';

/**
* Common settings for the filemanager stack.
Expand Down Expand Up @@ -46,22 +46,8 @@ export class FilemanagerStack extends Stack {
removalPolicy: RemovalPolicy.DESTROY,
});

const cfnBucket = testBucket.node.defaultChild as CfnBucket;
cfnBucket.notificationConfiguration = {
queueConfigurations: [
{
event: 's3:ObjectCreated:*',
queue: queue.queueArn,
},
{
event: 's3:ObjectRemoved:*',
queue: queue.queueArn,
},
],
};

// testBucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.SqsDestination(queue));
// testBucket.addEventNotification(s3.EventType.OBJECT_REMOVED, new s3n.SqsDestination(queue));
testBucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.SqsDestination(queue));
testBucket.addEventNotification(s3.EventType.OBJECT_REMOVED, new s3n.SqsDestination(queue));

lambdaRole.addManagedPolicy(
iam.ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSLambdaSQSQueueExecutionRole')
Expand Down

0 comments on commit bb96c15

Please sign in to comment.