This project has 3 repositories:
- saas-core
- saas-client
- saas-infra (this repo)
SaaS-Infra is multi-tenant SaaS infrastructure built on AWS, provisioned by terraform. This infrastructure supports both SaaS-Client and SaaS-Core.
Available environments include local
and dev
. The dev environment is expensive and not necessary for local development.
It deploys an AWS EKS cluster, 3 RDS Postgres instances and more.
- aws account
- install terraform <= 1.4.6
-
Configure your
~/.bashrc
or~/.zshrc
with AWS credentials.export AWS_ACCESS_KEY_ID=<YourAccessKeyID> export AWS_SECRET_ACCESS_KEY=<YourSecretAccessKey> export AWS_DEFAULT_REGION=<YourDefaultRegion>
Apply the changes by executing
source ~/.bashrc
orsource ~/.zshrc
in your terminal. -
Create a named profile.
aws configure --profile <name>
Terraform scripts should use the profile for AWS authentication instead of hard coded credentials.
-
Create
terraform.tfvars
file for the local/saas modules (use sample file).cp local/saas/terraform.tfvars.sample local/saas/terraform.tfvars
Update the contents with sensible values. Don't forget to use your AWS profile.
-
profile = "" region = "eu-central-1" stage = "local" hostname = "devpie.local" email = ""
-
Provision infrastructure for your desired environment.
cd local
make init
make plan
make apply
See dev setup.