Modules for provisioning Cloud SQL instances on Google Cloud Platform.
A PostgreSQL module that uses the init module as minimum input, while allowing overrides and additional configuration.
module "postgresql" {
source = "github.com/entur/terraform-google-sql-db//modules/postgresql?ref=v1.7.4"
...
}
See the README.md
under each module's subfolder for a list of supported inputs and outputs. For examples showing how they're implemented, check the examples subfolder.
You can control the version of a module dependency by adding ?ref=TAG
at the end of the source argument, as shown in the example above. This is highly recommended. You can find a list of available versions here.
Dependency automation tools such as Renovate Bot will be able to discover new releases and suggest updates automatically.
If a desired machine size and/or availability type is not explicitly set, defaults will be used:
Environment | Type | CPU | Memory | Highly available |
---|---|---|---|---|
non-production | Shared vCPU | <1 | 600 MB | No |
production | Dedicated vCPU | 1 | 3840 MB | Yes |
Changing this will cause a database restart on existing instances. Choosing Enterprise Plus (ENTERPRISE_PLUS
) over Enterprise (ENTERPRISE
) can also increase costs. Carefully evaluate your requirements before choosing this edition.
Ensure you select the appropriate tier for your use case. For more details about instance editions, refer to the official documentation.
To specify the size of a database instance, supply the cpu
and memory
attributes in var.machine_size
(recommended):
module "postgresql" {
...
machine_size = {
cpu = 1
memory = 3840
}
}
Tiers can also be set explicitly using the tier
attribute:
module "postgresql" {
...
machine_size = {
tier = "db-f1-micro"
}
}
Run local integration tests in test/integration folder.
Important
Only Team-Plattform has rights to do this locally. Contributors can create a PR which will run the tests as well.
Make sure you are connected to the dev kubernetes cluster in GKE (kub-ent-dev-001)
cd test/integration
go test -v -tags=integration -timeout 30m ./...