Documentation Index
Fetch the complete documentation index at: https://mintlify.com/azfar-imtiaz/PayPulse-Cloud/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before running any Terraform commands, make sure you have the following in place:- Terraform
>= 1.5.0— required by therequired_versionconstraint inmain.tf - AWS CLI configured with credentials that have sufficient permissions (see IAM roles)
- AWS region:
eu-west-1(default; overridable viaterraform.tfvars) - A
terraform.tfvarsfile with all required sensitive variables (see below)
Module structure
The Terraform configuration lives inaws-infra-terraform/ and is organized into three layers:
main.tf) calls the iam and lambdas child modules and wires their inputs and outputs together. Resources that are not Lambda- or IAM-specific (DynamoDB, S3, CloudWatch, etc.) are defined directly in the root module.
Required providers
klayers provider is used to fetch the latest ARN of the community-maintained KLayers Lambda layer for bcrypt.
terraform.tfvars
Sensitive and environment-specific values are passed throughterraform.tfvars. This file is not committed to version control.
terraform.tfvars is listed in .gitignore. Never commit this file — it contains secrets such as Gmail credentials, the Google OAuth client ID, and the Gemini API key.terraform.tfvars:
| Variable | Type | Description |
|---|---|---|
gmail_secret_credentials | string (sensitive) | JSON credentials for Gmail API access |
google_oauth_client_id | string (sensitive) | iOS OAuth client ID for Gmail API |
gemini_api_key | string (sensitive) | API key for Gemini Flash (retail invoice parsing) |
variables.tf and can optionally be overridden here (e.g., aws_region, bucket names, table names).
Example structure (do not include real values):
Deploying the infrastructure
Review the plan
Preview all changes before applying them. Inspect the output carefully — especially for destructive actions (replacements or deletions).
State management and resource migrations
Terraform state is stored locally inaws-infra-terraform/terraform.tfstate. This file is not committed to version control.
When resources are refactored — for example, moved from the root module into the iam or lambdas child modules — their state addresses change. The moved.tf file records these address renames so Terraform can reconcile existing state without destroying and re-creating resources.
Example entry from moved.tf:
moved block it updates the state in-place and plans no infrastructure changes. This makes module refactoring safe to apply.
To inspect current state or diagnose issues: