azure-native.sql.FirewallRule
Explore with Pulumi AI
A server firewall rule. Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2020-11-01-preview.
Other available API versions: 2014-04-01, 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview.
Example Usage
Create a firewall rule max/min
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var firewallRule = new AzureNative.Sql.FirewallRule("firewallRule", new()
{
EndIpAddress = "0.0.0.3",
FirewallRuleName = "firewallrulecrudtest-5370",
ResourceGroupName = "firewallrulecrudtest-12",
ServerName = "firewallrulecrudtest-6285",
StartIpAddress = "0.0.0.3",
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewFirewallRule(ctx, "firewallRule", &sql.FirewallRuleArgs{
EndIpAddress: pulumi.String("0.0.0.3"),
FirewallRuleName: pulumi.String("firewallrulecrudtest-5370"),
ResourceGroupName: pulumi.String("firewallrulecrudtest-12"),
ServerName: pulumi.String("firewallrulecrudtest-6285"),
StartIpAddress: pulumi.String("0.0.0.3"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.FirewallRule;
import com.pulumi.azurenative.sql.FirewallRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var firewallRule = new FirewallRule("firewallRule", FirewallRuleArgs.builder()
.endIpAddress("0.0.0.3")
.firewallRuleName("firewallrulecrudtest-5370")
.resourceGroupName("firewallrulecrudtest-12")
.serverName("firewallrulecrudtest-6285")
.startIpAddress("0.0.0.3")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
firewall_rule = azure_native.sql.FirewallRule("firewallRule",
end_ip_address="0.0.0.3",
firewall_rule_name="firewallrulecrudtest-5370",
resource_group_name="firewallrulecrudtest-12",
server_name="firewallrulecrudtest-6285",
start_ip_address="0.0.0.3")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const firewallRule = new azure_native.sql.FirewallRule("firewallRule", {
endIpAddress: "0.0.0.3",
firewallRuleName: "firewallrulecrudtest-5370",
resourceGroupName: "firewallrulecrudtest-12",
serverName: "firewallrulecrudtest-6285",
startIpAddress: "0.0.0.3",
});
resources:
firewallRule:
type: azure-native:sql:FirewallRule
properties:
endIpAddress: 0.0.0.3
firewallRuleName: firewallrulecrudtest-5370
resourceGroupName: firewallrulecrudtest-12
serverName: firewallrulecrudtest-6285
startIpAddress: 0.0.0.3
Update a firewall rule max/min
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var firewallRule = new AzureNative.Sql.FirewallRule("firewallRule", new()
{
EndIpAddress = "0.0.0.1",
FirewallRuleName = "firewallrulecrudtest-3927",
ResourceGroupName = "firewallrulecrudtest-12",
ServerName = "firewallrulecrudtest-6285",
StartIpAddress = "0.0.0.1",
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewFirewallRule(ctx, "firewallRule", &sql.FirewallRuleArgs{
EndIpAddress: pulumi.String("0.0.0.1"),
FirewallRuleName: pulumi.String("firewallrulecrudtest-3927"),
ResourceGroupName: pulumi.String("firewallrulecrudtest-12"),
ServerName: pulumi.String("firewallrulecrudtest-6285"),
StartIpAddress: pulumi.String("0.0.0.1"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.FirewallRule;
import com.pulumi.azurenative.sql.FirewallRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var firewallRule = new FirewallRule("firewallRule", FirewallRuleArgs.builder()
.endIpAddress("0.0.0.1")
.firewallRuleName("firewallrulecrudtest-3927")
.resourceGroupName("firewallrulecrudtest-12")
.serverName("firewallrulecrudtest-6285")
.startIpAddress("0.0.0.1")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
firewall_rule = azure_native.sql.FirewallRule("firewallRule",
end_ip_address="0.0.0.1",
firewall_rule_name="firewallrulecrudtest-3927",
resource_group_name="firewallrulecrudtest-12",
server_name="firewallrulecrudtest-6285",
start_ip_address="0.0.0.1")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const firewallRule = new azure_native.sql.FirewallRule("firewallRule", {
endIpAddress: "0.0.0.1",
firewallRuleName: "firewallrulecrudtest-3927",
resourceGroupName: "firewallrulecrudtest-12",
serverName: "firewallrulecrudtest-6285",
startIpAddress: "0.0.0.1",
});
resources:
firewallRule:
type: azure-native:sql:FirewallRule
properties:
endIpAddress: 0.0.0.1
firewallRuleName: firewallrulecrudtest-3927
resourceGroupName: firewallrulecrudtest-12
serverName: firewallrulecrudtest-6285
startIpAddress: 0.0.0.1
Create FirewallRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FirewallRule(name: string, args: FirewallRuleArgs, opts?: CustomResourceOptions);
@overload
def FirewallRule(resource_name: str,
args: FirewallRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FirewallRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_group_name: Optional[str] = None,
server_name: Optional[str] = None,
end_ip_address: Optional[str] = None,
firewall_rule_name: Optional[str] = None,
name: Optional[str] = None,
start_ip_address: Optional[str] = None)
func NewFirewallRule(ctx *Context, name string, args FirewallRuleArgs, opts ...ResourceOption) (*FirewallRule, error)
public FirewallRule(string name, FirewallRuleArgs args, CustomResourceOptions? opts = null)
public FirewallRule(String name, FirewallRuleArgs args)
public FirewallRule(String name, FirewallRuleArgs args, CustomResourceOptions options)
type: azure-native:sql:FirewallRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args FirewallRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args FirewallRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FirewallRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FirewallRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FirewallRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var examplefirewallRuleResourceResourceFromSql = new AzureNative.Sql.FirewallRule("examplefirewallRuleResourceResourceFromSql", new()
{
ResourceGroupName = "string",
ServerName = "string",
EndIpAddress = "string",
FirewallRuleName = "string",
Name = "string",
StartIpAddress = "string",
});
example, err := sql.NewFirewallRule(ctx, "examplefirewallRuleResourceResourceFromSql", &sql.FirewallRuleArgs{
ResourceGroupName: pulumi.String("string"),
ServerName: pulumi.String("string"),
EndIpAddress: pulumi.String("string"),
FirewallRuleName: pulumi.String("string"),
Name: pulumi.String("string"),
StartIpAddress: pulumi.String("string"),
})
var examplefirewallRuleResourceResourceFromSql = new FirewallRule("examplefirewallRuleResourceResourceFromSql", FirewallRuleArgs.builder()
.resourceGroupName("string")
.serverName("string")
.endIpAddress("string")
.firewallRuleName("string")
.name("string")
.startIpAddress("string")
.build());
examplefirewall_rule_resource_resource_from_sql = azure_native.sql.FirewallRule("examplefirewallRuleResourceResourceFromSql",
resource_group_name="string",
server_name="string",
end_ip_address="string",
firewall_rule_name="string",
name="string",
start_ip_address="string")
const examplefirewallRuleResourceResourceFromSql = new azure_native.sql.FirewallRule("examplefirewallRuleResourceResourceFromSql", {
resourceGroupName: "string",
serverName: "string",
endIpAddress: "string",
firewallRuleName: "string",
name: "string",
startIpAddress: "string",
});
type: azure-native:sql:FirewallRule
properties:
endIpAddress: string
firewallRuleName: string
name: string
resourceGroupName: string
serverName: string
startIpAddress: string
FirewallRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The FirewallRule resource accepts the following input properties:
- Resource
Group stringName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
- Server
Name string - The name of the server.
- End
Ip stringAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' for all Azure-internal IP addresses.
- Firewall
Rule stringName - The name of the firewall rule.
- Name string
- Resource name.
- Start
Ip stringAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' for all Azure-internal IP addresses.
- Resource
Group stringName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
- Server
Name string - The name of the server.
- End
Ip stringAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' for all Azure-internal IP addresses.
- Firewall
Rule stringName - The name of the firewall rule.
- Name string
- Resource name.
- Start
Ip stringAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' for all Azure-internal IP addresses.
- resource
Group StringName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
- server
Name String - The name of the server.
- end
Ip StringAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' for all Azure-internal IP addresses.
- firewall
Rule StringName - The name of the firewall rule.
- name String
- Resource name.
- start
Ip StringAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' for all Azure-internal IP addresses.
- resource
Group stringName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
- server
Name string - The name of the server.
- end
Ip stringAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' for all Azure-internal IP addresses.
- firewall
Rule stringName - The name of the firewall rule.
- name string
- Resource name.
- start
Ip stringAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' for all Azure-internal IP addresses.
- resource_
group_ strname - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
- server_
name str - The name of the server.
- end_
ip_ straddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' for all Azure-internal IP addresses.
- firewall_
rule_ strname - The name of the firewall rule.
- name str
- Resource name.
- start_
ip_ straddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' for all Azure-internal IP addresses.
- resource
Group StringName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
- server
Name String - The name of the server.
- end
Ip StringAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' for all Azure-internal IP addresses.
- firewall
Rule StringName - The name of the firewall rule.
- name String
- Resource name.
- start
Ip StringAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' for all Azure-internal IP addresses.
Outputs
All input properties are implicitly available as output properties. Additionally, the FirewallRule resource produces the following output properties:
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:sql:FirewallRule firewallrulecrudtest-3927 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0