Skip to content

Commit

Permalink
Merge pull request #22 from RenovoSolutions/19-add-dry-run-support
Browse files Browse the repository at this point in the history
Set lambda timeout to 90 seconds by default
  • Loading branch information
bmiller08 authored Oct 13, 2021
2 parents b44da28 + ca995e2 commit 09c62d7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,15 @@ The SNS topic to notify when a new cert is issued.

---

##### `timeout`<sup>Optional</sup> <a name="@renovosolutions/cdk-library-certbot.ICertbotProps.property.timeout"></a>

```typescript
public readonly timeout: Duration;
```

- *Type:* [`@aws-cdk/core.Duration`](#@aws-cdk/core.Duration)

The timeout duration for Lambda function.

---

6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export interface ICertbotProps {
* Insights layer ARN for your region. Defaults to US-EAST-1
*/
insightsARN?: string;
/**
* The timeout duration for Lambda function
*/
timeout?: cdk.Duration;
}

export class Certbot extends cdk.Construct {
Expand Down Expand Up @@ -86,6 +90,7 @@ export class Certbot extends cdk.Construct {
}

props.layers = (props.layers === undefined) ? [] : props.layers;
props.timeout = (props.timeout === undefined) ? cdk.Duration.seconds(90) : props.timeout;
props.enableInsights = (props.enableInsights === undefined) ? false : props.enableInsights;
props.insightsARN = (props.insightsARN === undefined) ? 'arn:aws:lambda:' + cdk.Stack.of(this).region + ':580247275435:layer:LambdaInsightsExtension:14' : props.insightsARN;

Expand Down Expand Up @@ -204,6 +209,7 @@ export class Certbot extends cdk.Construct {
NOTIFICATION_SNS_ARN: props.snsTopic.topicArn,
},
layers: props.layers,
timeout: props.timeout,
});

new events.Rule(this, 'trigger', {
Expand Down

0 comments on commit 09c62d7

Please sign in to comment.