It demonstrates how to create and manage a PostgreSQL database, roles, schemas, and associated resources on AWS.
In the example folder, you will see how this module should be called in downstream and how we can pass the values.
required_providers {
postgresql = {
version = "~> 1.21"
source = "cyrilgdn/postgresql"
}
aws = {
version = "~> 5.0"
source = "hashicorp/aws"
}
}
- Initialize Terraform with the backend config
terraform init -backend-config=config.dev.hcl
- Plan Terraform
terraform plan -var-file .\tfvars\dev.tfvars
- Apply Terraform
terraform apply -var-file .\tfvars\dev.tfvars
Name | Version |
---|---|
terraform | ~> 1.4 |
aws | ~> 5.0 |
postgresql | ~> 1.21 |
Name | Version |
---|---|
aws | 5.28.0 |
postgresql | 1.21.0 |
No modules.
Name | Type |
---|---|
aws_ssm_parameter.this | resource |
postgresql_database.pg_db | resource |
postgresql_default_privileges.pg_default_privileges | resource |
postgresql_role.pg_role | resource |
postgresql_schema.pg_schema | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
pg_roles | A map of objects where each key-value pair represents a PostgreSQL role | map(object({ |
n/a | yes |
pg_ssm_parameters | postgresql SSM parameters | map(object({ |
n/a | yes |
postgresql_database | A map where each key-value pair represents a PostgreSQL database configuration | map(object({ |
n/a | yes |
postgresql_default_privileges | configuration block for postgresql default privileges | map(object({ |
n/a | yes |
postgresql_schema | configuration block for postgresql schema | map(object({ |
n/a | yes |
Name | Description |
---|---|
arn | ARN of the parameter |
- Configure pre-commit hooks
pre-commit install
while Contributing or doing git commit please specify the breaking change in your commit message whether its major,minor or patch
For Example
git commit -m "your commit message #major"
By specifying this , it will bump the version and if you dont specify this in your commit message then by default it will consider patch and will bump that accordingly
- Tests are available in
test
directory - Configure the dependencies
cd test
go mod init github.com/sourcefuse/terraform-aws-ref-arch-db
go get github.com/gruntwork-io/terratest/modules/terraform
- Now execute the test
cd test/
go test
This project is authored by:
- SourceFuse ARC Team