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 lint
to lint TS code using both ESLint and Prettier working together - Run
yarn script:build-dependency-layer
this will run a bash script to zip up production dependencies and add them to the lamba as a layer - Run
yarn build
to run TSC to compile TS code to plain JS - Run
yarn cleanup
to remove generated files after deployment steps - Run
yarn tf:init
to get aws provider plugin downloaded - Run
yarn tf:plan
to see changes that will be made - Run
yarn tf:apply
to actually make those changes to your provider - Visit AWS and see all your services provisioned via terraform
- Run
yarn tf:destroy
to 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.