Skip to content

Commit

Permalink
feat: use addEvenSource directly
Browse files Browse the repository at this point in the history
  • Loading branch information
martin.mueller committed Oct 8, 2020
1 parent baca3d9 commit 8f34021
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/alf-cdk-lambdas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { RetentionDays } from '@aws-cdk/aws-logs';
import { AlfInstancesStackProps } from './alf-instances-stack';
import { instanceTable, cdkConfig } from '../src/statics';
import { Role, ServicePrincipal, ManagedPolicy, PolicyStatement } from '@aws-cdk/aws-iam';
import { SqsToLambda } from '@aws-solutions-constructs/aws-sqs-lambda';
import { QueueProps }from '@aws-cdk/aws-sqs';
// import { SqsToLambda } from '@aws-solutions-constructs/aws-sqs-lambda';
// import { QueueProps }from '@aws-cdk/aws-sqs';
import { BuildSpec, LinuxBuildImage, Project, Source } from '@aws-cdk/aws-codebuild';
import { CustomStack } from 'alf-cdk-app-pipeline/custom-stack';

Expand Down Expand Up @@ -311,17 +311,17 @@ export class AlfCdkLambdas implements AlfCdkLambdasInterface{
logRetention: RetentionDays.ONE_DAY
});

const queueProps: QueueProps = {
queueName: `${scope.stackName}.fifo`,
fifo: true,
contentBasedDeduplication: true
}
// const queueProps: QueueProps = {
// queueName: `${scope.stackName}.fifo`,
// fifo: true,
// contentBasedDeduplication: true
// }

const sqsToLambda = new SqsToLambda(scope, 'SqsToLambda', {
existingLambdaObj: this.executerLambda,
queueProps,
deployDeadLetterQueue: false
});
// const sqsToLambda = new SqsToLambda(scope, 'SqsToLambda', {
// existingLambdaObj: this.executerLambda,
// queueProps,
// deployDeadLetterQueue: false
// });

const lambdaSqsRole = new Role(scope, 'lambdaSqsRole', {
assumedBy: new ServicePrincipal('lambda.amazonaws.com'), // required
Expand All @@ -338,9 +338,9 @@ export class AlfCdkLambdas implements AlfCdkLambdasInterface{
handler: 'put-in-fifo-sqs.handler',
// timeout: Duration.seconds(300),
runtime: Runtime.NODEJS_12_X,
environment: {
SQS_URL: sqsToLambda.sqsQueue.queueUrl,
},
// environment: {
// SQS_URL: sqsToLambda.sqsQueue.queueUrl,
// },
role: lambdaSqsRole,
logRetention: RetentionDays.ONE_DAY
});
Expand Down

0 comments on commit 8f34021

Please sign in to comment.