Skip to content

Commit

Permalink
Merge pull request #4 from isotoma/fix-provider
Browse files Browse the repository at this point in the history
Fix provider
  • Loading branch information
winjer committed Nov 9, 2020
2 parents c2ab725 + d4aba50 commit 64946a6
Show file tree
Hide file tree
Showing 6 changed files with 1,219 additions and 1,124 deletions.
11 changes: 8 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as cfn from '@aws-cdk/aws-cloudformation';
import * as iam from '@aws-cdk/aws-iam';
import * as lambdaNodejs from '@aws-cdk/aws-lambda-nodejs';
import * as lambda from '@aws-cdk/aws-lambda';
import * as cdk from '@aws-cdk/core';
import * as customResource from '@aws-cdk/custom-resources';
Expand All @@ -18,10 +19,14 @@ export class SesSmtpCredentialsProvider extends cdk.Construct {
constructor(scope: cdk.Construct, id: string) {
super(scope, id);
this.provider = new customResource.Provider(this, 'ses-smtp-credentials-provider', {
onEventHandler: new lambda.Function(this, 'ses-smtp-credentials-event', {
code: lambda.Code.fromAsset(path.join(__dirname, 'provider')),
onEventHandler: new lambdaNodejs.NodejsFunction(this, 'ses-smtp-credentials-event', {
entry: path.join(__dirname, 'provider', 'index.ts'),
projectRoot: path.join(__dirname, 'provider'),
runtime: lambda.Runtime.NODEJS_12_X,
handler: 'index.onEvent',
nodeModules: [
'utf8',
],
handler: 'onEvent',
timeout: cdk.Duration.minutes(5),
initialPolicy: [
new iam.PolicyStatement({
Expand Down
Loading

0 comments on commit 64946a6

Please sign in to comment.