Infra as Code to spin up resources on aws to run the serverless user-application, that allows to register and verify the user
- git
brew install git
- terraform
brew tap hashicorp/tap brew install hashicorp/tap/terraform
- aws-cli
brew install awscli
- tflint
brew install tflint
- tfsec
brew install tfsec
- terraform-docs
brew install terraform-docs
- Sign-in to aws,
aws sso login --profile {profile} && export AWS_PROFILE={profile}- Create pre-requisite resources,
cd tf_prerequisites/
terraform apply- Create the remaining resources manually or via pipeline,
terraform init
terraform validate
terraform plan --var-file=environments/dev.tfvars
# terraform apply --var-file=environments/dev.tfvars
# terraform output
# terraform destroy- Execute tf-tools commands - to be used prior to every commit,
terraform fmt -recursive
terraform-docs markdown table --output-file README.md .
tflint --recursive
tfsec .Register user ->
curl -X POST '{user_app_url_from_terraform_output}/register?UserId=Raj7'Verify user ->
curl -X POST '{user_app_url_from_terraform_output}/?UserId=Raj7' > verified_user.htmlRegister user ->
Verify user ->
Refer the detailed cost estimates file for detailed rough cost estimates generated via Cost calculator
"Total Cost": {
"monthly": "21.29",
"upfront": "0.00",
"12 months": "255.48"
}########################## Terraform docs generated using terraform-docs ##########################
| Name | Version |
|---|---|
| terraform | >= 1.9.8 |
| aws | = 5.72.1 |
No providers.
| Name | Source | Version |
|---|---|---|
| api_gateway | ./modules/apigateway | n/a |
| dynamodb_table | ./modules/dynamodb | n/a |
| lambda_function | ./modules/lambda | n/a |
| s3 | ./modules/s3 | n/a |
No resources.
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| bucket_name | bucket name for storing static html contents | string |
n/a | yes |
| db_name | Database name for storing users | string |
n/a | yes |
| environment | environment to deploy the resources | string |
n/a | yes |
| lambda_functions | map of functions and the source code path that needs to be deployed | map(string) |
n/a | yes |
| prefix | prefix used for naming resources | string |
"iac-serverless-raj" |
no |
| region | region for creating all resources | string |
n/a | yes |
| Name | Description |
|---|---|
| database_arn | arn of dynamodb used for storing users |
| s3_arn | arn of s3 store that contains static html contents |
| user_app_url | url of the user app |


