# Azure PostgreSQL

## Example Usage

***

{% tabs %}
{% tab title="Terraform" %}
{% code title="azure-postgresql-integration.tf" %}

```tf
resource "apono_integration" "azure-postgresql-integration" {
  name                     = "Azure PostgreSQL"
  type                     = "azure-postgresql"
  connector_id             = "apono-connector-id"
  connected_resource_types = ["azure-postgresql-instance"]
  metadata = {
    hostname = "<Hostname>"
    port = "<Port>"
    dbname = "<Database Name>"
    sslmode = "<SSL Mode>"
  }
  kubernetes_secret = {
    name      = "name_template_value"
    namespace = "namespace_template_value"
  }
}
```

{% endcode %}
{% endtab %}

{% tab title="Terraform V2" %}
{% code title="azure-postgresql-integration.tf" %}

```tf
resource "apono_resource_integration" "azure-postgresql-integration" {
  name                     = "Azure PostgreSQL"
  type                     = "azure-postgresql"
  connector_id             = "apono-connector-id"
  connected_resource_types = ["azure-postgresql-instance"]
  integration_config = {
    hostname = "<Hostname>"
    port = "<Port>"
    dbname = "<Database Name>"
    sslmode = "<SSL Mode>"
  }
  secret_store_config = {
    kubernetes = {
      name      = "name_template_value"
      namespace = "namespace_template_value"
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="Public API" %}
{% code title="azure-postgresql-integration.json" %}

```json
{
    "azure-postgresql-integration": {
        "name": "Azure PostgreSQL",
        "type": "azure-postgresql",
        "connector_id": "apono-connector-id",
        "connected_resource_types": [
            "azure-postgresql-instance"
        ],
        "integration_config": {
            "hostname": "<Hostname>",
            "port": "<Port>",
            "dbname": "<Database Name>",
            "sslmode": "<SSL Mode>",
        },
	"secret_store_config": {
    	    "name": "name_template_value",
    	    "namespace": "namespace_template_value"
  	    }
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Schema

***

* `type` azure-postgresql
* `connected_resource_types` List of resource types to sync.

<details>

<summary>Available resource types you can use</summary>

* azure-postgresql-instance
* azure-postgresql-database
* azure-postgresql-table
* azure-postgresql-role

</details>

### Integration Config

***

* `hostname` (Required | String) Hostname
* `port` (Required | String) Port
  * Default value: `5432`
* `dbname` (Required | String) Database Name
  * Default value: `postgres`
* `sslmode` (Required | String) SSL Mode
  * Default value: `disable`
  * Possible values: disable, allow, prefer, require, verify-ca, verify-full
