Skip to content

Commit

Permalink
fix(cdk): circumvent Rate limit exceeded when deploying
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Aug 21, 2023
1 parent 03220ee commit 115a528
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cdk/constructs/APIAuthorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ abstract class APIAuthorizer extends Construct {
code: new LambdaSource(this, source).code,
layers: [layer],
logRetention: Logs.RetentionDays.ONE_WEEK,
logRetentionRetryOptions: {
base: Duration.millis(200),
},
initialPolicy: [readKeyPolicy(stack, 'publicKey')],
environment: {
STACK_NAME: stack.stackName,
Expand Down
3 changes: 3 additions & 0 deletions cdk/constructs/CoreLambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ export class CoreLambda extends Construct {
code: new LambdaSource(this, source).code,
layers: [layer],
logRetention: Logs.RetentionDays.ONE_WEEK,
logRetentionRetryOptions: {
base: Duration.millis(200),
},
initialPolicy: [
readKeyPolicy(stack, 'privateKey'),
readKeyPolicy(stack, 'publicKey'),
Expand Down
3 changes: 3 additions & 0 deletions cdk/constructs/EmailReceiving.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export class EmailReceiving extends Construct {
memorySize: 256,
code: new LambdaSource(this, lambdaSources.emailForwarding).code,
logRetention: Logs.RetentionDays.ONE_DAY,
logRetentionRetryOptions: {
base: Duration.millis(200),

Check failure on line 40 in cdk/constructs/EmailReceiving.ts

View workflow job for this annotation

GitHub Actions / test-and-release

Cannot find name 'Duration'.
},
initialPolicy: [
new IAM.PolicyStatement({
actions: ['ses:SendEmail'],
Expand Down
3 changes: 3 additions & 0 deletions cdk/constructs/EventEmailNotifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export class EventEmailNotifications extends Construct {
memorySize: 256,
code: new LambdaSource(this, lambdaSources.eventEmailNotifications).code,
logRetention: Logs.RetentionDays.ONE_DAY,
logRetentionRetryOptions: {
base: Duration.millis(200),

Check failure on line 34 in cdk/constructs/EventEmailNotifications.ts

View workflow job for this annotation

GitHub Actions / test-and-release

Cannot find name 'Duration'.
},
initialPolicy: [
new IAM.PolicyStatement({
actions: ['ses:SendEmail'],
Expand Down
3 changes: 3 additions & 0 deletions cdk/constructs/Onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export class Onboarding extends Construct {
code: new LambdaSource(this, lambdaSources.onboarding).code,
layers: [layer],
logRetention: Logs.RetentionDays.ONE_DAY,
logRetentionRetryOptions: {
base: Duration.millis(200),

Check failure on line 41 in cdk/constructs/Onboarding.ts

View workflow job for this annotation

GitHub Actions / test-and-release

Cannot find name 'Duration'.
},
initialPolicy: [
new IAM.PolicyStatement({
actions: ['ses:SendEmail'],
Expand Down
9 changes: 9 additions & 0 deletions cdk/constructs/RESTAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export class RESTAPI extends Construct {
code: new LambdaSource(this, lambdaSources.loginRequest).code,
layers: [layer],
logRetention: Logs.RetentionDays.ONE_WEEK,
logRetentionRetryOptions: {
base: Duration.millis(200),
},
initialPolicy: [
new IAM.PolicyStatement({
actions: ['ses:SendEmail'],
Expand All @@ -72,6 +75,9 @@ export class RESTAPI extends Construct {
code: new LambdaSource(this, lambdaSources.pinLogin).code,
layers: [layer],
logRetention: Logs.RetentionDays.ONE_WEEK,
logRetentionRetryOptions: {
base: Duration.millis(200),
},
initialPolicy: [readKeyPolicy(parent, 'privateKey')],
environment: {
STACK_NAME: parent.stackName,
Expand Down Expand Up @@ -320,6 +326,9 @@ export class RESTAPI extends Construct {
memorySize: 256,
code: new LambdaSource(this, lambdaSources.cors).code,
logRetention: Logs.RetentionDays.ONE_DAY,
logRetentionRetryOptions: {
base: Duration.millis(200),
},
})

const stage = new HttpApi.CfnStage(this, 'stage', {
Expand Down

0 comments on commit 115a528

Please sign in to comment.