Skip to content

azurermPostgresqlFlexibleServerConfiguration

Sets a PostgreSQL Configuration value on a Azure PostgreSQL Flexible Server.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
  features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermPostgresqlFlexibleServerExample =
  new azurerm.postgresqlFlexibleServer.PostgresqlFlexibleServer(
    this,
    "example_2",
    {
      administrator_login: "psqladmin",
      administrator_password: "H@Sh1CoR3!",
      location: azurermResourceGroupExample.location,
      name: "example-psqlflexibleserver",
      resource_group_name: azurermResourceGroupExample.name,
      sku_name: "GP_Standard_D4s_v3",
      storage_mb: 32768,
      version: "12",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermPostgresqlFlexibleServerExample.overrideLogicalId("example");
const azurermPostgresqlFlexibleServerConfigurationExample =
  new azurerm.postgresqlFlexibleServerConfiguration.PostgresqlFlexibleServerConfiguration(
    this,
    "example_3",
    {
      name: "backslash_quote",
      server_id: azurermPostgresqlFlexibleServerExample.id,
      value: "on",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermPostgresqlFlexibleServerConfigurationExample.overrideLogicalId(
  "example"
);

Example Usage - Azure Extensions

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
  features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermPostgresqlFlexibleServerExample =
  new azurerm.postgresqlFlexibleServer.PostgresqlFlexibleServer(
    this,
    "example_2",
    {
      administrator_login: "psqladmin",
      administrator_password: "H@Sh1CoR3!",
      location: azurermResourceGroupExample.location,
      name: "example-psqlflexibleserver",
      resource_group_name: azurermResourceGroupExample.name,
      sku_name: "GP_Standard_D4s_v3",
      storage_mb: 32768,
      version: "12",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermPostgresqlFlexibleServerExample.overrideLogicalId("example");
const azurermPostgresqlFlexibleServerConfigurationExample =
  new azurerm.postgresqlFlexibleServerConfiguration.PostgresqlFlexibleServerConfiguration(
    this,
    "example_3",
    {
      name: "azure.extensions",
      server_id: azurermPostgresqlFlexibleServerExample.id,
      value: "CUBE,CITEXT,BTREE_GIST",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermPostgresqlFlexibleServerConfigurationExample.overrideLogicalId(
  "example"
);

Argument Reference

The following arguments are supported:

-> Note: PostgreSQL provides the ability to extend the functionality using azure extensions, with PostgreSQL azure extensions you should specify the name value as azureExtensions and the value you wish to allow in the extensions list.

  • serverId - (Required) The ID of the PostgreSQL Flexible Server where we want to change configuration. Changing this forces a new PostgreSQL Flexible Server Configuration resource.

  • value - (Required) Specifies the value of the PostgreSQL Configuration. See the PostgreSQL documentation for valid values.

Attributes Reference

The following attributes are exported:

  • id - The ID of the PostgreSQL Configuration.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the PostgreSQL Configuration.
  • update - (Defaults to 30 minutes) Used when updating the PostgreSQL Configuration.
  • read - (Defaults to 5 minutes) Used when retrieving the PostgreSQL Configuration.
  • delete - (Defaults to 30 minutes) Used when deleting the PostgreSQL Configuration.

Import

PostgreSQL Configurations can be imported using the resourceId, e.g.

terraform import azurerm_postgresql_flexible_server_configuration.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforPostgreSQL/flexibleServers/server1/configurations/configuration1