deploy directly every update and enhancement without using the AWS console<\/strong>.<\/p>\n\n\n\nThanks to this approach, the risk of misalignment between the code and the underlying infrastructure is avoided<\/strong>. Also, thanks to Git, both the infrastructure and applicative code are monitorable, versioned, and historicized.<\/p>\n\n\n\nThrough the<\/p>\n\n\n\n
cdk deploy<\/code><\/pre>\n\n\n\ncommand we\u2019ll deploy on our AWS account the CDK Pipeline<\/strong>. <\/p>\n\n\n\nThis pipeline, translating our CDK Typescript into Cloudformation, will be the one actually deploying our infrastructure as well as the source code.<\/p>\n\n\n\n
With the automatic Pipeline connected to AWS Codecommit (or Github in this case), the release of a new update is triggered from a push on a repository\u2019s branch<\/strong>. The deployment will update\/create new resources as described in CDK and, subsequently, the applicative code. (eg.: lambda = resource, lambda handler = applicative).<\/p>\n\n\n\nInfrastructure Stack<\/h3>\n\n\n\n
In the infrastructure-stack.ts we\u2019ll be defining the configuration of our resources, in our case Lambda function and API Gateway. <\/p>\n\n\n\n
We\u2019re defining the name of the function, memory allocated, Lambda layer, and the already cited custom runtime.<\/p>\n\n\n\n
The API Gateway is very simple in this project and is used to expose the Lambda code through an endpoint.<\/p>\n\n\n\n
<\/p>\n\n\n
\n