Create a CodeCommit repository and deploy an Amplify web application from a local folder.
This sample pattern demonstrates how to deploy an AWS Amplify web application from a local folder or repository using an AWS CodeCommit repository. This pattern is useful for quickly deploying and hosting a web application on AWS from your local machine.
This pattern first creates a CodeCommit repository from the web application code in the local folder 'local-webapp-code'. Then it creates an Amplify app using the CodeCommit repository as the source repository. Finally, it creates a custom resource that creates an Amplify job to build and deploy the Amplify app.
Without this custom resource, your Amplify app will not build or deploy. If your web application communicates with a backend, the pattern demonstrates how to pass an API endpoint from the CDK to the Amplify app as an environment variable.