We are repeating the same pattern across all of our lambda functions. We can extract the common parts into their own constant to save ourselves some time.
By generalizing the repeated code we have now made our app easier to refactor. Let's take advantage of that by refactoring our Lambda functions to use the Arm/Graviton2 architecture which enhances cost performance by 20%.
All you have to do is add an architecture
prop to your lambda config with a value of lambda.Architecture.ARM_64