-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add az auth to postgres flexible (#1801)
* Update modules/databases/postgresql_flexible_server/server.tf * Update modules/databases/postgresql_flexible_server/server.tf * Fix review * Fix review * Update examples/postgresql_flexible_server/103-simple-postgresql-flexible-with-az-auth/configuration.tfvars --------- Co-authored-by: Arnaud Lheureux <[email protected]>
- Loading branch information
Showing
2 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
110 changes: 110 additions & 0 deletions
110
...stgresql_flexible_server/103-simple-postgresql-flexible-with-az-auth/configuration.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
global_settings = { | ||
default_region = "region1" | ||
regions = { | ||
region1 = "uksouth" | ||
} | ||
} | ||
|
||
resource_groups = { | ||
postgresql_region1 = { | ||
name = "postgresql-region1" | ||
region = "region1" | ||
} | ||
security_region1 = { | ||
name = "security-region1" | ||
} | ||
} | ||
|
||
postgresql_flexible_servers = { | ||
primary_region1 = { | ||
name = "primary-region1" | ||
region = "region1" | ||
version = "12" | ||
sku_name = "MO_Standard_E4s_v3" | ||
zone = 2 | ||
storage_mb = 131072 | ||
|
||
resource_group = { | ||
key = "postgresql_region1" | ||
# lz_key = "" # Set the lz_key if the resource group is remote. | ||
} | ||
|
||
authentication = { | ||
# (Optional) Whether or not Active Directory authentication is allowed to access the PostgreSQL Flexible Server. Defaults to false. | ||
active_directory_auth_enabled = true | ||
|
||
# (Optional) Whether or not password authentication is allowed to access the PostgreSQL Flexible Server. Defaults to true. | ||
password_auth_enabled = true | ||
|
||
# (Optional) The Tenant ID of the Azure Active Directory which is used by the Active Directory authentication. active_directory_auth_enabled must be set to true. | ||
#tenant_id = "00000-ee35-4265-95f6-46e9a9b4ec96" | ||
} | ||
|
||
|
||
# Auto-generated administrator credentials stored in azure keyvault when not set (recommended). | ||
# administrator_username = "postgresqladmin" | ||
# administrator_password = "ComplxP@ssw0rd!" | ||
keyvault = { | ||
key = "postgresql_region1" # (Required) when auto-generated administrator credentials needed. | ||
# lz_key = "" # Set the lz_key if the keyvault is remote. | ||
} | ||
|
||
# [Optional] Firewall Rules | ||
postgresql_firewall_rules = { | ||
postgresql-firewall-rule1 = { | ||
name = "postgresql-firewall-rule1" | ||
start_ip_address = "10.0.1.10" | ||
end_ip_address = "10.0.1.11" | ||
} | ||
postgresql-firewall-rule2 = { | ||
name = "postgresql-firewall-rule2" | ||
start_ip_address = "10.0.2.10" | ||
end_ip_address = "10.0.2.11" | ||
} | ||
} | ||
|
||
# [Optional] Server Configurations | ||
postgresql_configurations = { | ||
backslash_quote = { | ||
name = "backslash_quote" | ||
value = "on" | ||
} | ||
bgwriter_delay = { | ||
name = "bgwriter_delay" | ||
value = "25" | ||
} | ||
} | ||
|
||
|
||
postgresql_databases = { | ||
sampledb1 = { | ||
name = "sampledb1" | ||
} | ||
sampledb2 = { | ||
name = "sampledb2" | ||
passthrough = true | ||
} | ||
} | ||
|
||
tags = { | ||
segment = "sales" | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
# Store the postgresql_flexible_server administrator credentials into keyvault if the attribute keyvault{} block is defined. | ||
keyvaults = { | ||
postgresql_region1 = { | ||
name = "akv" | ||
resource_group_key = "security_region1" | ||
sku_name = "standard" | ||
soft_delete_enabled = true | ||
creation_policies = { | ||
logged_in_user = { | ||
secret_permissions = ["Set", "Get", "List", "Delete", "Purge"] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters