Skip to content

azurermPostgresqlFlexibleServerFirewallRule

Manages a PostgreSQL Flexible Server Firewall Rule.

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 azurermPostgresqlFlexibleServerFirewallRuleExample =
  new azurerm.postgresqlFlexibleServerFirewallRule.PostgresqlFlexibleServerFirewallRule(
    this,
    "example_3",
    {
      end_ip_address: "122.122.0.0",
      name: "example-fw",
      server_id: azurermPostgresqlFlexibleServerExample.id,
      start_ip_address: "122.122.0.0",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermPostgresqlFlexibleServerFirewallRuleExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • name - (Required) The name which should be used for this PostgreSQL Flexible Server Firewall Rule. Changing this forces a new PostgreSQL Flexible Server Firewall Rule to be created.

  • serverId - (Required) The ID of the PostgreSQL Flexible Server from which to create this PostgreSQL Flexible Server Firewall Rule. Changing this forces a new PostgreSQL Flexible Server Firewall Rule to be created.

  • startIpAddress - (Required) The Start IP Address associated with this PostgreSQL Flexible Server Firewall Rule.

  • endIpAddress - (Required) The End IP Address associated with this PostgreSQL Flexible Server Firewall Rule.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the PostgreSQL Flexible Server Firewall Rule.

Timeouts

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

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

Import

PostgreSQL Flexible Server Firewall Rules can be imported using the resourceId, e.g.

terraform import azurerm_postgresql_flexible_server_firewall_rule.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServer1/firewallRules/firewallRule1