This page documents the language specification for the azure package. If you're looking for help working with the inputs, outputs, or functions of azure resources in a Pulumi program, please see the resource documentation for examples and API reference.

postgresql

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-azure repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-azurerm repo.

class pulumi_azure.postgresql.AwaitableGetServerResult(administrator_login=None, fqdn=None, id=None, location=None, name=None, resource_group_name=None, tags=None, version=None)
class pulumi_azure.postgresql.Configuration(resource_name, opts=None, name=None, resource_group_name=None, server_name=None, value=None, __props__=None, __name__=None, __opts__=None)

Sets a PostgreSQL Configuration value on a PostgreSQL Server.

Note: Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it.

import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_server = azure.postgresql.Server("exampleServer",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku_name="B_Gen5_2",
    storage_mb=5120,
    backup_retention_days=7,
    geo_redundant_backup_enabled=False,
    auto_grow_enabled=True,
    administrator_login="psqladminun",
    administrator_login_password="H@Sh1CoR3!",
    version="9.5",
    ssl_enforcement_enabled=True)
example_configuration = azure.postgresql.Configuration("exampleConfiguration",
    resource_group_name=example_resource_group.name,
    server_name=example_server.name,
    value="on")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • name (pulumi.Input[str]) – Specifies the name of the PostgreSQL Configuration, which needs to be a valid PostgreSQL configuration name. Changing this forces a new resource to be created.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.

  • server_name (pulumi.Input[str]) – Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

  • value (pulumi.Input[str]) – Specifies the value of the PostgreSQL Configuration. See the PostgreSQL documentation for valid values.

name: pulumi.Output[str] = None

Specifies the name of the PostgreSQL Configuration, which needs to be a valid PostgreSQL configuration name. Changing this forces a new resource to be created.

resource_group_name: pulumi.Output[str] = None

The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.

server_name: pulumi.Output[str] = None

Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

value: pulumi.Output[str] = None

Specifies the value of the PostgreSQL Configuration. See the PostgreSQL documentation for valid values.

static get(resource_name, id, opts=None, name=None, resource_group_name=None, server_name=None, value=None)

Get an existing Configuration resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • name (pulumi.Input[str]) –

    Specifies the name of the PostgreSQL Configuration, which needs to be a valid PostgreSQL configuration name. Changing this forces a new resource to be created.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.

  • server_name (pulumi.Input[str]) – Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

  • value (pulumi.Input[str]) – Specifies the value of the PostgreSQL Configuration. See the PostgreSQL documentation for valid values.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_azure.postgresql.Database(resource_name, opts=None, charset=None, collation=None, name=None, resource_group_name=None, server_name=None, __props__=None, __name__=None, __opts__=None)

Manages a PostgreSQL Database within a PostgreSQL Server

import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_server = azure.postgresql.Server("exampleServer",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku_name="B_Gen5_2",
    storage_mb=5120,
    backup_retention_days=7,
    geo_redundant_backup_enabled=False,
    auto_grow_enabled=True,
    administrator_login="psqladminun",
    administrator_login_password="H@Sh1CoR3!",
    version="9.5",
    ssl_enforcement_enabled=True)
example_database = azure.postgresql.Database("exampleDatabase",
    resource_group_name=example_resource_group.name,
    server_name=example_server.name,
    charset="UTF8",
    collation="English_United States.1252")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • charset (pulumi.Input[str]) – Specifies the Charset for the PostgreSQL Database, which needs to be a valid PostgreSQL Charset. Changing this forces a new resource to be created.

  • collation (pulumi.Input[str]) – Specifies the Collation for the PostgreSQL Database, which needs to be a valid PostgreSQL Collation. Note that Microsoft uses different notation - en-US instead of en_US. Changing this forces a new resource to be created.

  • name (pulumi.Input[str]) – Specifies the name of the PostgreSQL Database, which needs to be a valid PostgreSQL identifier. Changing this forces a new resource to be created.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.

  • server_name (pulumi.Input[str]) – Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

charset: pulumi.Output[str] = None

Specifies the Charset for the PostgreSQL Database, which needs to be a valid PostgreSQL Charset. Changing this forces a new resource to be created.

collation: pulumi.Output[str] = None

Specifies the Collation for the PostgreSQL Database, which needs to be a valid PostgreSQL Collation. Note that Microsoft uses different notation - en-US instead of en_US. Changing this forces a new resource to be created.

name: pulumi.Output[str] = None

Specifies the name of the PostgreSQL Database, which needs to be a valid PostgreSQL identifier. Changing this forces a new resource to be created.

resource_group_name: pulumi.Output[str] = None

The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.

server_name: pulumi.Output[str] = None

Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

static get(resource_name, id, opts=None, charset=None, collation=None, name=None, resource_group_name=None, server_name=None)

Get an existing Database resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • charset (pulumi.Input[str]) –

    Specifies the Charset for the PostgreSQL Database, which needs to be a valid PostgreSQL Charset. Changing this forces a new resource to be created.

  • collation (pulumi.Input[str]) –

    Specifies the Collation for the PostgreSQL Database, which needs to be a valid PostgreSQL Collation. Note that Microsoft uses different notation - en-US instead of en_US. Changing this forces a new resource to be created.

  • name (pulumi.Input[str]) –

    Specifies the name of the PostgreSQL Database, which needs to be a valid PostgreSQL identifier. Changing this forces a new resource to be created.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.

  • server_name (pulumi.Input[str]) – Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_azure.postgresql.FirewallRule(resource_name, opts=None, end_ip_address=None, name=None, resource_group_name=None, server_name=None, start_ip_address=None, __props__=None, __name__=None, __opts__=None)

Manages a Firewall Rule for a PostgreSQL Server

import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_server = azure.postgresql.Server("exampleServer")
# ...
example_firewall_rule = azure.postgresql.FirewallRule("exampleFirewallRule",
    resource_group_name=example_resource_group.name,
    server_name=example_server.name,
    start_ip_address="40.112.8.12",
    end_ip_address="40.112.8.12")
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_server = azure.postgresql.Server("exampleServer")
# ...
example_firewall_rule = azure.postgresql.FirewallRule("exampleFirewallRule",
    resource_group_name=example_resource_group.name,
    server_name=example_server.name,
    start_ip_address="40.112.0.0",
    end_ip_address="40.112.255.255")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • end_ip_address (pulumi.Input[str]) – Specifies the End IP Address associated with this Firewall Rule. Changing this forces a new resource to be created.

  • name (pulumi.Input[str]) – Specifies the name of the PostgreSQL Firewall Rule. Changing this forces a new resource to be created.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.

  • server_name (pulumi.Input[str]) – Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

  • start_ip_address (pulumi.Input[str]) – Specifies the Start IP Address associated with this Firewall Rule. Changing this forces a new resource to be created.

end_ip_address: pulumi.Output[str] = None

Specifies the End IP Address associated with this Firewall Rule. Changing this forces a new resource to be created.

name: pulumi.Output[str] = None

Specifies the name of the PostgreSQL Firewall Rule. Changing this forces a new resource to be created.

resource_group_name: pulumi.Output[str] = None

The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.

server_name: pulumi.Output[str] = None

Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

start_ip_address: pulumi.Output[str] = None

Specifies the Start IP Address associated with this Firewall Rule. Changing this forces a new resource to be created.

static get(resource_name, id, opts=None, end_ip_address=None, name=None, resource_group_name=None, server_name=None, start_ip_address=None)

Get an existing FirewallRule resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • end_ip_address (pulumi.Input[str]) – Specifies the End IP Address associated with this Firewall Rule. Changing this forces a new resource to be created.

  • name (pulumi.Input[str]) – Specifies the name of the PostgreSQL Firewall Rule. Changing this forces a new resource to be created.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.

  • server_name (pulumi.Input[str]) – Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

  • start_ip_address (pulumi.Input[str]) – Specifies the Start IP Address associated with this Firewall Rule. Changing this forces a new resource to be created.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_azure.postgresql.GetServerResult(administrator_login=None, fqdn=None, id=None, location=None, name=None, resource_group_name=None, tags=None, version=None)

A collection of values returned by getServer.

administrator_login = None

The administrator username of the PostgreSQL Server.

fqdn = None

The fully qualified domain name of the PostgreSQL Server.

id = None

The provider-assigned unique ID for this managed resource.

location = None

The location of the Resource Group in which the PostgreSQL Server exists.

tags = None

A mapping of tags assigned to the resource.

version = None

The version of the PostgreSQL Server.

class pulumi_azure.postgresql.Server(resource_name, opts=None, administrator_login=None, administrator_login_password=None, auto_grow_enabled=None, backup_retention_days=None, create_mode=None, creation_source_server_id=None, geo_redundant_backup_enabled=None, infrastructure_encryption_enabled=None, location=None, name=None, public_network_access_enabled=None, resource_group_name=None, restore_point_in_time=None, sku_name=None, ssl_enforcement=None, ssl_enforcement_enabled=None, ssl_minimal_tls_version_enforced=None, storage_mb=None, storage_profile=None, tags=None, threat_detection_policy=None, version=None, __props__=None, __name__=None, __opts__=None)

Manages a PostgreSQL Server.

import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_server = azure.postgresql.Server("exampleServer",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    administrator_login="psqladminun",
    administrator_login_password="H@Sh1CoR3!",
    sku_name="GP_Gen5_4",
    version="9.6",
    storage_mb=640000,
    backup_retention_days=7,
    geo_redundant_backup_enabled=True,
    auto_grow_enabled=True,
    public_network_access_enabled=False,
    ssl_enforcement_enabled=True,
    ssl_minimal_tls_version_enforced="TLS1_2")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • administrator_login (pulumi.Input[str]) – The Administrator Login for the PostgreSQL Server. Required when create_mode is Default. Changing this forces a new resource to be created.

  • administrator_login_password (pulumi.Input[str]) – The Password associated with the administrator_login for the PostgreSQL Server. Required when create_mode is Default.

  • auto_grow_enabled (pulumi.Input[bool]) – Enable/Disable auto-growing of the storage. Storage auto-grow prevents your server from running out of storage and becoming read-only. If storage auto grow is enabled, the storage automatically grows without impacting the workload. The default value if not explicitly specified is true.

  • backup_retention_days (pulumi.Input[float]) – Backup retention days for the server, supported values are between 7 and 35 days.

  • create_mode (pulumi.Input[str]) – The creation mode. Can be used to restore or replicate existing servers. Possible values are Default, Replica, GeoRestore, and PointInTimeRestore. Defaults to Default.

  • creation_source_server_id (pulumi.Input[str]) – For creation modes other then default the source server ID to use.

  • geo_redundant_backup_enabled (pulumi.Input[bool]) – Turn Geo-redundant server backups on/off. This allows you to choose between locally redundant or geo-redundant backup storage in the General Purpose and Memory Optimized tiers. When the backups are stored in geo-redundant backup storage, they are not only stored within the region in which your server is hosted, but are also replicated to a paired data center. This provides better protection and ability to restore your server in a different region in the event of a disaster. This is not support for the Basic tier.

  • infrastructure_encryption_enabled (pulumi.Input[bool]) – Whether or not infrastructure is encrypted for this server. Defaults to false. Changing this forces a new resource to be created.

  • location (pulumi.Input[str]) – Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • name (pulumi.Input[str]) – Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

  • public_network_access_enabled (pulumi.Input[bool]) – Whether or not public network access is allowed for this server. Defaults to true.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which to create the PostgreSQL Server. Changing this forces a new resource to be created.

  • restore_point_in_time (pulumi.Input[str]) – When create_mode is PointInTimeRestore the point in time to restore from creation_source_server_id.

  • sku_name (pulumi.Input[str]) – Specifies the SKU Name for this PostgreSQL Server. The name of the SKU, follows the tier + family + cores pattern (e.g. B_Gen4_1, GP_Gen5_8). For more information see the product documentation.

  • ssl_enforcement_enabled (pulumi.Input[bool]) – Specifies if SSL should be enforced on connections. Possible values are true and false.

  • ssl_minimal_tls_version_enforced (pulumi.Input[str]) – The mimimun TLS version to support on the sever. Possible values are TLSEnforcementDisabled, TLS1_0, TLS1_1, and TLS1_2. Defaults to TLSEnforcementDisabled.

  • storage_mb (pulumi.Input[float]) –

    Max storage allowed for a server. Possible values are between 5120 MB(5GB) and 1048576 MB(1TB) for the Basic SKU and between 5120 MB(5GB) and 4194304 MB(4TB) for General Purpose/Memory Optimized SKUs. For more information see the product documentation.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

  • threat_detection_policy (pulumi.Input[dict]) – Threat detection policy configuration, known in the API as Server Security Alerts Policy. The threat_detection_policy block supports fields documented below.

  • version (pulumi.Input[str]) – Specifies the version of PostgreSQL to use. Valid values are 9.5, 9.6, 10, 10.0, and 11. Changing this forces a new resource to be created.

The storage_profile object supports the following:

  • autoGrow (pulumi.Input[str])

  • backup_retention_days (pulumi.Input[float]) - Backup retention days for the server, supported values are between 7 and 35 days.

  • geoRedundantBackup (pulumi.Input[str])

  • storage_mb (pulumi.Input[float]) - Max storage allowed for a server. Possible values are between 5120 MB(5GB) and 1048576 MB(1TB) for the Basic SKU and between 5120 MB(5GB) and 4194304 MB(4TB) for General Purpose/Memory Optimized SKUs. For more information see the product documentation.

The threat_detection_policy object supports the following:

  • disabled_alerts (pulumi.Input[list]) - Specifies a list of alerts which should be disabled. Possible values include Access_Anomaly, Sql_Injection and Sql_Injection_Vulnerability.

  • email_account_admins (pulumi.Input[bool]) - Should the account administrators be emailed when this alert is triggered?

  • email_addresses (pulumi.Input[list]) - A list of email addresses which alerts should be sent to.

  • enabled (pulumi.Input[bool]) - Is the policy enabled?

  • retention_days (pulumi.Input[float]) - Specifies the number of days to keep in the Threat Detection audit logs.

  • storage_account_access_key (pulumi.Input[str]) - Specifies the identifier key of the Threat Detection audit storage account.

  • storage_endpoint (pulumi.Input[str]) - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.

administrator_login: pulumi.Output[str] = None

The Administrator Login for the PostgreSQL Server. Required when create_mode is Default. Changing this forces a new resource to be created.

administrator_login_password: pulumi.Output[str] = None

The Password associated with the administrator_login for the PostgreSQL Server. Required when create_mode is Default.

auto_grow_enabled: pulumi.Output[bool] = None

Enable/Disable auto-growing of the storage. Storage auto-grow prevents your server from running out of storage and becoming read-only. If storage auto grow is enabled, the storage automatically grows without impacting the workload. The default value if not explicitly specified is true.

backup_retention_days: pulumi.Output[float] = None

Backup retention days for the server, supported values are between 7 and 35 days.

create_mode: pulumi.Output[str] = None

The creation mode. Can be used to restore or replicate existing servers. Possible values are Default, Replica, GeoRestore, and PointInTimeRestore. Defaults to Default.

creation_source_server_id: pulumi.Output[str] = None

For creation modes other then default the source server ID to use.

fqdn: pulumi.Output[str] = None

The FQDN of the PostgreSQL Server.

geo_redundant_backup_enabled: pulumi.Output[bool] = None

Turn Geo-redundant server backups on/off. This allows you to choose between locally redundant or geo-redundant backup storage in the General Purpose and Memory Optimized tiers. When the backups are stored in geo-redundant backup storage, they are not only stored within the region in which your server is hosted, but are also replicated to a paired data center. This provides better protection and ability to restore your server in a different region in the event of a disaster. This is not support for the Basic tier.

infrastructure_encryption_enabled: pulumi.Output[bool] = None

Whether or not infrastructure is encrypted for this server. Defaults to false. Changing this forces a new resource to be created.

location: pulumi.Output[str] = None

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

name: pulumi.Output[str] = None

Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

public_network_access_enabled: pulumi.Output[bool] = None

Whether or not public network access is allowed for this server. Defaults to true.

resource_group_name: pulumi.Output[str] = None

The name of the resource group in which to create the PostgreSQL Server. Changing this forces a new resource to be created.

restore_point_in_time: pulumi.Output[str] = None

When create_mode is PointInTimeRestore the point in time to restore from creation_source_server_id.

sku_name: pulumi.Output[str] = None

Specifies the SKU Name for this PostgreSQL Server. The name of the SKU, follows the tier + family + cores pattern (e.g. B_Gen4_1, GP_Gen5_8). For more information see the product documentation.

ssl_enforcement_enabled: pulumi.Output[bool] = None

Specifies if SSL should be enforced on connections. Possible values are true and false.

ssl_minimal_tls_version_enforced: pulumi.Output[str] = None

The mimimun TLS version to support on the sever. Possible values are TLSEnforcementDisabled, TLS1_0, TLS1_1, and TLS1_2. Defaults to TLSEnforcementDisabled.

storage_mb: pulumi.Output[float] = None

Max storage allowed for a server. Possible values are between 5120 MB(5GB) and 1048576 MB(1TB) for the Basic SKU and between 5120 MB(5GB) and 4194304 MB(4TB) for General Purpose/Memory Optimized SKUs. For more information see the product documentation.

tags: pulumi.Output[dict] = None

A mapping of tags to assign to the resource.

threat_detection_policy: pulumi.Output[dict] = None

Threat detection policy configuration, known in the API as Server Security Alerts Policy. The threat_detection_policy block supports fields documented below.

  • disabled_alerts (list) - Specifies a list of alerts which should be disabled. Possible values include Access_Anomaly, Sql_Injection and Sql_Injection_Vulnerability.

  • email_account_admins (bool) - Should the account administrators be emailed when this alert is triggered?

  • email_addresses (list) - A list of email addresses which alerts should be sent to.

  • enabled (bool) - Is the policy enabled?

  • retention_days (float) - Specifies the number of days to keep in the Threat Detection audit logs.

  • storage_account_access_key (str) - Specifies the identifier key of the Threat Detection audit storage account.

  • storage_endpoint (str) - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.

version: pulumi.Output[str] = None

Specifies the version of PostgreSQL to use. Valid values are 9.5, 9.6, 10, 10.0, and 11. Changing this forces a new resource to be created.

static get(resource_name, id, opts=None, administrator_login=None, administrator_login_password=None, auto_grow_enabled=None, backup_retention_days=None, create_mode=None, creation_source_server_id=None, fqdn=None, geo_redundant_backup_enabled=None, infrastructure_encryption_enabled=None, location=None, name=None, public_network_access_enabled=None, resource_group_name=None, restore_point_in_time=None, sku_name=None, ssl_enforcement=None, ssl_enforcement_enabled=None, ssl_minimal_tls_version_enforced=None, storage_mb=None, storage_profile=None, tags=None, threat_detection_policy=None, version=None)

Get an existing Server resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • administrator_login (pulumi.Input[str]) – The Administrator Login for the PostgreSQL Server. Required when create_mode is Default. Changing this forces a new resource to be created.

  • administrator_login_password (pulumi.Input[str]) – The Password associated with the administrator_login for the PostgreSQL Server. Required when create_mode is Default.

  • auto_grow_enabled (pulumi.Input[bool]) – Enable/Disable auto-growing of the storage. Storage auto-grow prevents your server from running out of storage and becoming read-only. If storage auto grow is enabled, the storage automatically grows without impacting the workload. The default value if not explicitly specified is true.

  • backup_retention_days (pulumi.Input[float]) – Backup retention days for the server, supported values are between 7 and 35 days.

  • create_mode (pulumi.Input[str]) – The creation mode. Can be used to restore or replicate existing servers. Possible values are Default, Replica, GeoRestore, and PointInTimeRestore. Defaults to Default.

  • creation_source_server_id (pulumi.Input[str]) – For creation modes other then default the source server ID to use.

  • fqdn (pulumi.Input[str]) – The FQDN of the PostgreSQL Server.

  • geo_redundant_backup_enabled (pulumi.Input[bool]) – Turn Geo-redundant server backups on/off. This allows you to choose between locally redundant or geo-redundant backup storage in the General Purpose and Memory Optimized tiers. When the backups are stored in geo-redundant backup storage, they are not only stored within the region in which your server is hosted, but are also replicated to a paired data center. This provides better protection and ability to restore your server in a different region in the event of a disaster. This is not support for the Basic tier.

  • infrastructure_encryption_enabled (pulumi.Input[bool]) – Whether or not infrastructure is encrypted for this server. Defaults to false. Changing this forces a new resource to be created.

  • location (pulumi.Input[str]) – Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • name (pulumi.Input[str]) – Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

  • public_network_access_enabled (pulumi.Input[bool]) – Whether or not public network access is allowed for this server. Defaults to true.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which to create the PostgreSQL Server. Changing this forces a new resource to be created.

  • restore_point_in_time (pulumi.Input[str]) – When create_mode is PointInTimeRestore the point in time to restore from creation_source_server_id.

  • sku_name (pulumi.Input[str]) –

    Specifies the SKU Name for this PostgreSQL Server. The name of the SKU, follows the tier + family + cores pattern (e.g. B_Gen4_1, GP_Gen5_8). For more information see the product documentation.

  • ssl_enforcement_enabled (pulumi.Input[bool]) – Specifies if SSL should be enforced on connections. Possible values are true and false.

  • ssl_minimal_tls_version_enforced (pulumi.Input[str]) – The mimimun TLS version to support on the sever. Possible values are TLSEnforcementDisabled, TLS1_0, TLS1_1, and TLS1_2. Defaults to TLSEnforcementDisabled.

  • storage_mb (pulumi.Input[float]) –

    Max storage allowed for a server. Possible values are between 5120 MB(5GB) and 1048576 MB(1TB) for the Basic SKU and between 5120 MB(5GB) and 4194304 MB(4TB) for General Purpose/Memory Optimized SKUs. For more information see the product documentation.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

  • threat_detection_policy (pulumi.Input[dict]) – Threat detection policy configuration, known in the API as Server Security Alerts Policy. The threat_detection_policy block supports fields documented below.

  • version (pulumi.Input[str]) – Specifies the version of PostgreSQL to use. Valid values are 9.5, 9.6, 10, 10.0, and 11. Changing this forces a new resource to be created.

The storage_profile object supports the following:

  • autoGrow (pulumi.Input[str])

  • backup_retention_days (pulumi.Input[float]) - Backup retention days for the server, supported values are between 7 and 35 days.

  • geoRedundantBackup (pulumi.Input[str])

  • storage_mb (pulumi.Input[float]) - Max storage allowed for a server. Possible values are between 5120 MB(5GB) and 1048576 MB(1TB) for the Basic SKU and between 5120 MB(5GB) and 4194304 MB(4TB) for General Purpose/Memory Optimized SKUs. For more information see the product documentation.

The threat_detection_policy object supports the following:

  • disabled_alerts (pulumi.Input[list]) - Specifies a list of alerts which should be disabled. Possible values include Access_Anomaly, Sql_Injection and Sql_Injection_Vulnerability.

  • email_account_admins (pulumi.Input[bool]) - Should the account administrators be emailed when this alert is triggered?

  • email_addresses (pulumi.Input[list]) - A list of email addresses which alerts should be sent to.

  • enabled (pulumi.Input[bool]) - Is the policy enabled?

  • retention_days (pulumi.Input[float]) - Specifies the number of days to keep in the Threat Detection audit logs.

  • storage_account_access_key (pulumi.Input[str]) - Specifies the identifier key of the Threat Detection audit storage account.

  • storage_endpoint (pulumi.Input[str]) - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_azure.postgresql.VirtualNetworkRule(resource_name, opts=None, ignore_missing_vnet_service_endpoint=None, name=None, resource_group_name=None, server_name=None, subnet_id=None, __props__=None, __name__=None, __opts__=None)

Manages a PostgreSQL Virtual Network Rule.

NOTE: PostgreSQL Virtual Network Rules can only be used with SKU Tiers of ``GeneralPurpose` or MemoryOptimized <https://docs.microsoft.com/en-us/azure/postgresql/concepts-data-access-and-security-vnet>`_

import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
    address_spaces=["10.7.29.0/29"],
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name)
internal = azure.network.Subnet("internal",
    resource_group_name=example_resource_group.name,
    virtual_network_name=example_virtual_network.name,
    address_prefix="10.7.29.0/29",
    service_endpoints=["Microsoft.Sql"])
example_server = azure.postgresql.Server("exampleServer",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku_name="B_Gen5_2",
    storage_profile={
        "storage_mb": 5120,
        "backup_retention_days": 7,
        "geoRedundantBackup": "Disabled",
    },
    administrator_login="psqladminun",
    administrator_login_password="H@Sh1CoR3!",
    version="9.5",
    ssl_enforcement="Enabled")
example_virtual_network_rule = azure.postgresql.VirtualNetworkRule("exampleVirtualNetworkRule",
    resource_group_name=example_resource_group.name,
    server_name=example_server.name,
    subnet_id=internal.id,
    ignore_missing_vnet_service_endpoint=True)
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • ignore_missing_vnet_service_endpoint (pulumi.Input[bool]) – Should the Virtual Network Rule be created before the Subnet has the Virtual Network Service Endpoint enabled? Defaults to false.

  • name (pulumi.Input[str]) – The name of the PostgreSQL virtual network rule. Cannot be empty and must only contain alphanumeric characters and hyphens. Cannot start with a number, and cannot start or end with a hyphen. Changing this forces a new resource to be created.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group where the PostgreSQL server resides. Changing this forces a new resource to be created.

  • server_name (pulumi.Input[str]) – The name of the SQL Server to which this PostgreSQL virtual network rule will be applied to. Changing this forces a new resource to be created.

  • subnet_id (pulumi.Input[str]) – The ID of the subnet that the PostgreSQL server will be connected to.

ignore_missing_vnet_service_endpoint: pulumi.Output[bool] = None

Should the Virtual Network Rule be created before the Subnet has the Virtual Network Service Endpoint enabled? Defaults to false.

name: pulumi.Output[str] = None

The name of the PostgreSQL virtual network rule. Cannot be empty and must only contain alphanumeric characters and hyphens. Cannot start with a number, and cannot start or end with a hyphen. Changing this forces a new resource to be created.

resource_group_name: pulumi.Output[str] = None

The name of the resource group where the PostgreSQL server resides. Changing this forces a new resource to be created.

server_name: pulumi.Output[str] = None

The name of the SQL Server to which this PostgreSQL virtual network rule will be applied to. Changing this forces a new resource to be created.

subnet_id: pulumi.Output[str] = None

The ID of the subnet that the PostgreSQL server will be connected to.

static get(resource_name, id, opts=None, ignore_missing_vnet_service_endpoint=None, name=None, resource_group_name=None, server_name=None, subnet_id=None)

Get an existing VirtualNetworkRule resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • ignore_missing_vnet_service_endpoint (pulumi.Input[bool]) – Should the Virtual Network Rule be created before the Subnet has the Virtual Network Service Endpoint enabled? Defaults to false.

  • name (pulumi.Input[str]) – The name of the PostgreSQL virtual network rule. Cannot be empty and must only contain alphanumeric characters and hyphens. Cannot start with a number, and cannot start or end with a hyphen. Changing this forces a new resource to be created.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group where the PostgreSQL server resides. Changing this forces a new resource to be created.

  • server_name (pulumi.Input[str]) – The name of the SQL Server to which this PostgreSQL virtual network rule will be applied to. Changing this forces a new resource to be created.

  • subnet_id (pulumi.Input[str]) – The ID of the subnet that the PostgreSQL server will be connected to.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

pulumi_azure.postgresql.get_server(name=None, resource_group_name=None, opts=None)

Use this data source to access information about an existing PostgreSQL Azure Database Server.

import pulumi
import pulumi_azure as azure

example = azure.postgresql.get_server(name="postgresql-server-1",
    resource_group_name="api-rg-pro")
pulumi.export("postgresqlServerId", example.id)
Parameters
  • name (str) – The name of the PostgreSQL Server.

  • resource_group_name (str) – Specifies the name of the Resource Group where the PostgreSQL Server exists.