Table: azure_postgresql_flexible_server - Query Azure PostgreSQL Flexible Servers using SQL
Azure PostgreSQL Flexible Server is a fully managed relational database service, based on the open-source Postgres database engine. It provides capabilities for intelligent performance, high availability, and dynamic scalability, enabling you to focus on application development and business logic rather than database management tasks. This service helps you to securely manage, monitor, and scale your PostgreSQL databases in the cloud.
Table Usage Guide
The azure_postgresql_flexible_server
table provides insights into the configuration and status of Azure PostgreSQL Flexible Server instances. As a database administrator, you can leverage this table to explore server-specific details, including the server's state, version, location, and more. Utilize it to monitor and manage your PostgreSQL databases in Azure, ensuring optimal performance, security, and compliance.
Examples
Basic info
Uncover the details of your Azure PostgreSQL flexible servers including their names, IDs, and configurations. This information is essential for managing your cloud environment effectively and understanding where your servers are located.
select name, id, cloud_environment, flexible_server_configurations, locationfrom azure_postgresql_flexible_server;
select name, id, cloud_environment, flexible_server_configurations, locationfrom azure_postgresql_flexible_server;
List SKU details of the flexible servers
Identify the specific details of flexible servers, such as their unique identifiers and SKU details. This information can be beneficial in managing resources and understanding the tier level of each server.
select name, id, sku ->> 'name' as sku_name, sku ->> 'tier' as sku_tierfrom azure_postgresql_flexible_server;
select name, id, json_extract(sku, '$.name') as sku_name, json_extract(sku, '$.tier') as sku_tierfrom azure_postgresql_flexible_server;
List flexible servers that have geo-redundant backup enabled
Identify instances where flexible servers have geo-redundant backup enabled to ensure data redundancy and disaster recovery for your Azure PostgreSQL databases.
select name, id, cloud_environment, flexible_server_configurations, server_properties -> 'backup' ->> 'geoRedundantBackup', locationfrom azure_postgresql_flexible_serverwhere server_properties -> 'backup' ->> 'geoRedundantBackup' = 'Enabled';
select name, id, cloud_environment, flexible_server_configurations, json_extract( json_extract(server_properties, '$.backup'), '$.geoRedundantBackup' ) as geoRedundantBackup, locationfrom azure_postgresql_flexible_serverwhere json_extract( json_extract(server_properties, '$.backup'), '$.geoRedundantBackup' ) = 'Enabled';
List flexible servers configured in more than one availability zones
Determine the areas in which flexible servers are configured across multiple availability zones. This is useful for understanding the distribution and redundancy of your servers, which can impact service availability and disaster recovery strategies.
select name, id, cloud_environment, flexible_server_configurations, server_properties ->> 'availabilityZone', locationfrom azure_postgresql_flexible_serverwhere (server_properties ->> 'availabilityZone') :: int > 1;
select name, id, cloud_environment, flexible_server_configurations, json_extract(server_properties, '$.availabilityZone'), locationfrom azure_postgresql_flexible_serverwhere CAST( json_extract(server_properties, '$.availabilityZone') AS INTEGER ) > 1;
Control examples
- All Controls > PostgreSQL > Ensure 'Allow public access from any Azure service within Azure to this server' for PostgreSQL flexible server is disabled
- All Controls > PostgreSQL > Ensure server parameter 'connection_throttle.enable' is set to 'ON' for PostgreSQL flexible Server
- All Controls > PostgreSQL > Ensure server parameter 'log_checkpoints' is set to 'ON' for PostgreSQL flexible Server
- All Controls > PostgreSQL > Ensure Server Parameter 'logfiles.retention_days' is greater than 3 days for PostgreSQL flexible Server
- All Controls > PostgreSQL > Ensure server parameter 'require_secure_transport' is set to 'ON' for PostgreSQL flexible server
- CIS v3.0.0 > 5 Database Services > 5.2 Azure Database for PostgreSQL > 5.2.1 Ensure server parameter 'require_secure_transport' is set to 'ON' for PostgreSQL flexible server
- CIS v3.0.0 > 5 Database Services > 5.2 Azure Database for PostgreSQL > 5.2.2 Ensure server parameter 'log_checkpoints' is set to 'ON' for PostgreSQL flexible Server
- CIS v3.0.0 > 5 Database Services > 5.2 Azure Database for PostgreSQL > 5.2.3 Ensure server parameter 'connection_throttle.enable' is set to 'ON' for PostgreSQL flexible Server
- CIS v3.0.0 > 5 Database Services > 5.2 Azure Database for PostgreSQL > 5.2.4 Ensure Server Parameter 'logfiles.retention_days' is greater than 3 days for PostgreSQL flexible Server
- CIS v3.0.0 > 5 Database Services > 5.2 Azure Database for PostgreSQL > 5.2.5 Ensure 'Allow public access from any Azure service within Azure to this server' for PostgreSQL flexible server is disabled
Schema for azure_postgresql_flexible_server
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
administrator_login | text | The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
auth_config | jsonb | AuthConfig properties of a server. | |
availability_zone | text | Availability zone information of the server. | |
backup | jsonb | Backup properties of a server. | |
cloud_environment | text | The Azure Cloud Environment. | |
create_mode | text | The mode to create a new PostgreSQL server. | |
data_encryption | jsonb | Data encryption properties of a server. | |
firewall_rules | jsonb | The list of firewall rules in a server. | |
flexible_server_configurations | jsonb | The server configurations(parameters) details of the server. | |
fully_qualified_domain_name | text | The fully qualified domain name of a server. | |
high_availability | jsonb | High availability properties of a server. | |
id | text | Fully qualified resource ID for the resource. | |
location | text | The geo-location where the resource lives. | |
maintenance_window | jsonb | Maintenance window properties of a server. | |
minor_version | text | The minor version of the server. | |
name | text | = | The name of the resource. |
network | jsonb | Network properties of a server. | |
point_in_time_utc | timestamp with time zone | Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore'. | |
public_network_access | text | Public network access is enabled or not. | |
region | text | The Azure region/location in which the resource is located. | |
replica_capacity | bigint | Replicas allowed for a server. | |
replication_role | text | Replication role of the server. | |
resource_group | text | = | The resource group which holds this resource. |
server_properties | jsonb | Properties of the server. | |
sku | jsonb | The SKU (pricing tier) of the server. | |
source_server_resource_id | text | The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state | text | A state of a server that is visible to user. | |
storage | jsonb | Storage properties of a server. | |
subscription_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Azure Subscription ID in which the resource is located. |
system_data | jsonb | The system metadata relating to this server. | |
tags | jsonb | A map of tags for the resource. | |
title | text | Title of the resource. | |
type | text | The type of the resource. | |
version | text | PostgreSQL Server version. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- azure
You can pass the configuration to the command with the --config
argument:
steampipe_export_azure --config '<your_config>' azure_postgresql_flexible_server