Skip to content

terraform-ibm-modules/terraform-ibm-icd-postgresql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IBM Cloud Databases for ICD Postgresql module

Stable (With quality checks) Build status pre-commit latest release Renovate enabled semantic-release

Usage

WARNING: This module does not support major version upgrade or updates to encryption and backup encryption keys: To upgrade version create a new postgresql instance with the updated version and follow the Upgrading PostgreSQL docs

module "postgresql_db" { # replace main with version source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql?ref=main" admin_password = var.admin_password resource_group_id = module.resource_group.resource_group_id name = var.name }

Required IAM access policies

You need the following permissions to run this module.

  • Account Management
    • Databases for PostgreSQL service
      • Editor role access

Examples

Requirements

Name Version
terraform >= 1.3.0
ibm >= 1.49.0

Modules

Name Source Version
cbr_rule git::https://github.com/terraform-ibm-modules/terraform-ibm-cbr//cbr-rule-module v1.1.4

Resources

Name Type
ibm_database.postgresql_db resource

Inputs

Name Description Type Default Required
allowlist Set of IP address and description to allowlist in database
list(object({
address = optional(string)
description = optional(string)
}))
[] no
auto_scaling (Optional) Configure rules to allow your database to automatically increase its resources. Single block of autoscaling is allowed at once.
object({
cpu = object({
rate_increase_percent = optional(number)
rate_limit_count_per_member = optional(number)
rate_period_seconds = optional(number)
rate_units = optional(string)
})
disk = object({
capacity_enabled = optional(bool)
free_space_less_than_percent = optional(number)
io_above_percent = optional(number)
io_enabled = optional(bool)
io_over_period = optional(string)
rate_increase_percent = optional(number)
rate_limit_mb_per_member = optional(number)
rate_period_seconds = optional(number)
rate_units = optional(string)
})
memory = object({
io_above_percent = optional(number)
io_enabled = optional(bool)
io_over_period = optional(string)
rate_increase_percent = optional(number)
rate_limit_mb_per_member = optional(number)
rate_period_seconds = optional(number)
rate_units = optional(string)
})
})
{
"cpu": {},
"disk": {},
"memory": {}
}
no
backup_crn The CRN of a backup resource to restore from. The backup is created by a database deployment with the same service ID. The backup is loaded after provisioning and the new deployment starts up that uses that data. A backup CRN is in the format crn:v1:<…>:backup:. If omitted, the database is provisioned empty. string null no
backup_encryption_key_crn (Optional) The CRN of a key protect key, that you want to use for encrypting disk that holds deployment backups. If null, will use 'key_protect_key_crn' as encryption key. If 'key_protect_key_crn' is also null database is encrypted by using randomly generated keys. string null no
cbr_rules (Optional, list) List of CBR rules to create
list(object({
description = string
account_id = string
rule_contexts = list(object({
attributes = optional(list(object({
name = string
value = string
}))) }))
enforcement_mode = string
}))
[] no
configuration (Optional, Json String) Database Configuration in JSON format.
object({
max_connections = optional(number)
max_prepared_transactions = optional(number)
deadlock_timeout = optional(number)
effective_io_concurrency = optional(number)
max_replication_slots = optional(number)
max_wal_senders = optional(number)
shared_buffers = optional(number)
synchronous_commit = optional(string)
wal_level = optional(string)
archive_timeout = optional(number)
log_min_duration_statement = optional(number)
})
null no
key_protect_key_crn (Optional) The root key CRN of a Key Management Service like Key Protect or Hyper Protect Crypto Service (HPCS) that you want to use for disk encryption. If null, database is encrypted by using randomly generated keys. See https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect&interface=ui#key-byok for current list of supported regions for BYOK string null no
member_cpu_count CPU allocation required for postgresql database string "3" no
member_disk_mb Disk allocation required for postgresql database string "5120" no
member_memory_mb Memory allocation required for postgresql database string "1024" no
members Number of members number 3 no
name Name of the Postgresql instance string n/a yes
pg_version Version of the postgresql instance string null no
plan_validation Enable or disable validating the database parameters for postgres during the plan phase bool true no
region The region postgresql is to be created on. The region must support BYOK if key_protect_key_crn is used string "us-south" no
resource_group_id The resource group ID where the postgresql will be created string n/a yes
resource_tags Optional list of tags to be added to created resources list(string) [] no
service_endpoints Sets the endpoint of the Postgresql instance, valid values are 'public', 'private', or 'public-and-private' string "private" no

Outputs

Name Description
guid Postgresql instance guid
id Postgresql instance id
version Postgresql instance version

Contributing

You can report issues and request features for this module in GitHub issues in the module repo. See Report an issue or request a feature.

To set up your local development environment, see Local development setup in the project documentation.