A movie search engine that utilises Terraform for provisioning cloud resources and hosted on the AWS Cloud with AWS Lambda function and Amazon API Gateway stack.
- Terraform is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage hundreds of cloud services.
- Typescript is an open-source language which builds on JavaScript, one of the world’s most used tools, by adding static type definitions.
- AWS Lambda is a serverless compute service that lets you run code without provisioning or managing servers, creating workload-aware cluster scaling logic, maintaining event integrations, or managing runtimes.
- Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale.
Before going to deploy step, you need to request an ACM Public Cerfiticate, read the AWS docs for more details:
After that, you need to create API Gateway > Custom domain name with the ACM Public Certificate on the previous step, read the AWS Docs for more details:
- Run
yarn lintto lint TS code using both ESLint and Prettier working together - Run
yarn script:build-dependency-layerthis will run a bash script to zip up production dependencies and add them to the lamba as a layer - Run
yarn buildto run TSC to compile TS code to plain JS - Run
yarn cleanupto remove generated files after deployment steps - Run
yarn tf:initto get aws provider plugin downloaded - Run
yarn tf:planto see changes that will be made - Run
yarn tf:applyto actually make those changes to your provider - Visit AWS and see all your services provisioned via terraform
- Run
yarn tf:destroyto destroy all the services that were built
You can also simply call yarn deploy:all to both zip up an archive and provision the resources together. Similarly you could run yarn update:all to destroy all resources and re-provision them.
- Terraform Lambda Typescript Starter This is a basic Hello World starter template that utilises terraform for provisioning cloud resources. It is an opionanted starter which uses TypeScript, ESlint, Prettier and Husky.