import * as pulumi from "@pulumi/pulumi"; /** * Manages a Firewall Rule for a PostgreSQL Server * * > **Note:** The `azure.postgresql.FirewallRule` resource is deprecated and will be removed in v5.0 of the AzureRM Provider. Azure Database for PostgreSQL Single Server and its sub resources have been retired as of 2025-03-28, please use the `azure.postgresql.FlexibleServerFirewallRule` resource instead. For more information, see https://techcommunity.microsoft.com/blog/adforpostgresql/retiring-azure-database-for-postgresql-single-server-in-2025/3783783. * * ## Example Usage * * ### Single IP Address) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "api-rg-pro", * location: "West Europe", * }); * const exampleServer = new azure.postgresql.Server("example", { * name: "example-postgre-server", * location: example.location, * resourceGroupName: example.name, * skuName: "GP_Gen5_2", * version: "11", * sslEnforcementEnabled: true, * }); * const exampleFirewallRule = new azure.postgresql.FirewallRule("example", { * name: "office", * resourceGroupName: example.name, * serverName: exampleServer.name, * startIpAddress: "40.112.8.12", * endIpAddress: "40.112.8.12", * }); * ``` * * ### IP Range) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "api-rg-pro", * location: "West Europe", * }); * const exampleServer = new azure.postgresql.Server("example", {}); * const exampleFirewallRule = new azure.postgresql.FirewallRule("example", { * name: "office", * resourceGroupName: example.name, * serverName: exampleServer.name, * startIpAddress: "40.112.0.0", * endIpAddress: "40.112.255.255", * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.DBforPostgreSQL` - 2017-12-01 * * ## Import * * PostgreSQL Firewall Rule's can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:postgresql/firewallRule:FirewallRule rule1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforPostgreSQL/servers/server1/firewallRules/rule1 * ``` */ export declare class FirewallRule extends pulumi.CustomResource { /** * Get an existing FirewallRule resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: FirewallRuleState, opts?: pulumi.CustomResourceOptions): FirewallRule; /** * Returns true if the given object is an instance of FirewallRule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is FirewallRule; /** * Specifies the End IP Address associated with this Firewall Rule. Changing this forces a new resource to be created. * * > **Note:** The Azure feature `Allow access to Azure services` can be enabled by setting `startIpAddress` and `endIpAddress` to `0.0.0.0` which ([is documented in the Azure API Docs](https://docs.microsoft.com/rest/api/sql/firewallrules/createorupdate)). */ readonly endIpAddress: pulumi.Output; /** * Specifies the name of the PostgreSQL Firewall Rule. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created. */ readonly resourceGroupName: pulumi.Output; /** * Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created. */ readonly serverName: pulumi.Output; /** * Specifies the Start IP Address associated with this Firewall Rule. Changing this forces a new resource to be created. */ readonly startIpAddress: pulumi.Output; /** * Create a FirewallRule resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: FirewallRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FirewallRule resources. */ export interface FirewallRuleState { /** * Specifies the End IP Address associated with this Firewall Rule. Changing this forces a new resource to be created. * * > **Note:** The Azure feature `Allow access to Azure services` can be enabled by setting `startIpAddress` and `endIpAddress` to `0.0.0.0` which ([is documented in the Azure API Docs](https://docs.microsoft.com/rest/api/sql/firewallrules/createorupdate)). */ endIpAddress?: pulumi.Input; /** * Specifies the name of the PostgreSQL Firewall Rule. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created. */ resourceGroupName?: pulumi.Input; /** * Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created. */ serverName?: pulumi.Input; /** * Specifies the Start IP Address associated with this Firewall Rule. Changing this forces a new resource to be created. */ startIpAddress?: pulumi.Input; } /** * The set of arguments for constructing a FirewallRule resource. */ export interface FirewallRuleArgs { /** * Specifies the End IP Address associated with this Firewall Rule. Changing this forces a new resource to be created. * * > **Note:** The Azure feature `Allow access to Azure services` can be enabled by setting `startIpAddress` and `endIpAddress` to `0.0.0.0` which ([is documented in the Azure API Docs](https://docs.microsoft.com/rest/api/sql/firewallrules/createorupdate)). */ endIpAddress: pulumi.Input; /** * Specifies the name of the PostgreSQL Firewall Rule. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created. */ resourceGroupName: pulumi.Input; /** * Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created. */ serverName: pulumi.Input; /** * Specifies the Start IP Address associated with this Firewall Rule. Changing this forces a new resource to be created. */ startIpAddress: pulumi.Input; }