steampipe plugin install azure

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,
location
from
azure_postgresql_flexible_server;
select
name,
id,
cloud_environment,
flexible_server_configurations,
location
from
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_tier
from
azure_postgresql_flexible_server;
select
name,
id,
json_extract(sku, '$.name') as sku_name,
json_extract(sku, '$.tier') as sku_tier
from
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',
location
from
azure_postgresql_flexible_server
where
server_properties -> 'backup' ->> 'geoRedundantBackup' = 'Enabled';
select
name,
id,
cloud_environment,
flexible_server_configurations,
json_extract(
json_extract(server_properties, '$.backup'),
'$.geoRedundantBackup'
) as geoRedundantBackup,
location
from
azure_postgresql_flexible_server
where
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',
location
from
azure_postgresql_flexible_server
where
(server_properties ->> 'availabilityZone') :: int > 1;
select
name,
id,
cloud_environment,
flexible_server_configurations,
json_extract(server_properties, '$.availabilityZone'),
location
from
azure_postgresql_flexible_server
where
CAST(
json_extract(server_properties, '$.availabilityZone') AS INTEGER
) > 1;

Control examples

Schema for azure_postgresql_flexible_server

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
administrator_logintextThe administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
auth_configjsonbAuthConfig properties of a server.
availability_zonetextAvailability zone information of the server.
backupjsonbBackup properties of a server.
cloud_environmenttextThe Azure Cloud Environment.
create_modetextThe mode to create a new PostgreSQL server.
data_encryptionjsonbData encryption properties of a server.
firewall_rulesjsonbThe list of firewall rules in a server.
flexible_server_configurationsjsonbThe server configurations(parameters) details of the server.
fully_qualified_domain_nametextThe fully qualified domain name of a server.
high_availabilityjsonbHigh availability properties of a server.
idtextFully qualified resource ID for the resource.
locationtextThe geo-location where the resource lives.
maintenance_windowjsonbMaintenance window properties of a server.
minor_versiontextThe minor version of the server.
nametext=The name of the resource.
networkjsonbNetwork properties of a server.
point_in_time_utctimestamp with time zoneRestore point creation time (ISO8601 format), specifying the time to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore'.
public_network_accesstextPublic network access is enabled or not.
regiontextThe Azure region/location in which the resource is located.
replica_capacitybigintReplicas allowed for a server.
replication_roletextReplication role of the server.
resource_grouptext=The resource group which holds this resource.
server_propertiesjsonbProperties of the server.
skujsonbThe SKU (pricing tier) of the server.
source_server_resource_idtextThe source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statetextA state of a server that is visible to user.
storagejsonbStorage properties of a server.
subscription_idtext=, !=, ~~, ~~*, !~~, !~~*The Azure Subscription ID in which the resource is located.
system_datajsonbThe system metadata relating to this server.
tagsjsonbA map of tags for the resource.
titletextTitle of the resource.
typetextThe type of the resource.
versiontextPostgreSQL 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