azurermMysqlFlexibleServerFirewallRule
Manages a Firewall Rule for a MySQL Flexible Server.
Example Usage (Single IP Address)
/*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.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "api-rg-pro",
}
);
const azurermMysqlFlexibleServerExample =
new azurerm.mysqlFlexibleServer.MysqlFlexibleServer(this, "example_1", {
location: azurermResourceGroupExample.location,
name: "example",
resource_group_name: azurermResourceGroupExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMysqlFlexibleServerExample.overrideLogicalId("example");
const azurermMysqlFlexibleServerFirewallRuleExample =
new azurerm.mysqlFlexibleServerFirewallRule.MysqlFlexibleServerFirewallRule(
this,
"example_2",
{
end_ip_address: "40.112.8.12",
name: "office",
resource_group_name: azurermResourceGroupExample.name,
server_name: azurermMysqlFlexibleServerExample.name,
start_ip_address: "40.112.8.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.*/
azurermMysqlFlexibleServerFirewallRuleExample.overrideLogicalId("example");
Example Usage (IP Range)
/*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.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "api-rg-pro",
}
);
const azurermMysqlFlexibleServerExample =
new azurerm.mysqlFlexibleServer.MysqlFlexibleServer(this, "example_1", {
location: azurermResourceGroupExample.location,
name: "example",
resource_group_name: azurermResourceGroupExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMysqlFlexibleServerExample.overrideLogicalId("example");
const azurermMysqlFlexibleServerFirewallRuleExample =
new azurerm.mysqlFlexibleServerFirewallRule.MysqlFlexibleServerFirewallRule(
this,
"example_2",
{
end_ip_address: "40.112.255.255",
name: "office",
resource_group_name: azurermResourceGroupExample.name,
server_name: azurermMysqlFlexibleServerExample.name,
start_ip_address: "40.112.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.*/
azurermMysqlFlexibleServerFirewallRuleExample.overrideLogicalId("example");
Example Usage (Allow access to Azure services)
/*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.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "api-rg-pro",
}
);
const azurermMysqlFlexibleServerExample =
new azurerm.mysqlFlexibleServer.MysqlFlexibleServer(this, "example_1", {
location: azurermResourceGroupExample.location,
name: "example",
resource_group_name: azurermResourceGroupExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMysqlFlexibleServerExample.overrideLogicalId("example");
const azurermMysqlFlexibleServerFirewallRuleExample =
new azurerm.mysqlFlexibleServerFirewallRule.MysqlFlexibleServerFirewallRule(
this,
"example_2",
{
end_ip_address: "0.0.0.0",
name: "office",
resource_group_name: azurermResourceGroupExample.name,
server_name: azurermMysqlFlexibleServerExample.name,
start_ip_address: "0.0.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.*/
azurermMysqlFlexibleServerFirewallRuleExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
-
name
- (Required) Specifies the name of the MySQL Firewall Rule. Changing this forces a new resource to be created. -
serverName
- (Required) Specifies the name of the MySQL Flexible Server. Changing this forces a new resource to be created. -
resourceGroupName
- (Required) The name of the resource group in which the MySQL Flexible Server exists. Changing this forces a new resource to be created. -
startIpAddress
- (Required) Specifies the Start IP Address associated with this Firewall Rule. -
endIpAddress
- (Required) Specifies the End IP Address associated with this Firewall Rule.
-> NOTE: The Azure feature allowAccessToAzureServices
can be enabled by setting startIpAddress
and endIpAddress
to 0000
which (is documented in the Azure API Docs).
Attributes Reference
The following attributes are exported:
id
- The ID of the MySQL Firewall Rule.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the MySQL Firewall Rule.update
- (Defaults to 30 minutes) Used when updating the MySQL Firewall Rule.read
- (Defaults to 5 minutes) Used when retrieving the MySQL Firewall Rule.delete
- (Defaults to 30 minutes) Used when deleting the MySQL Firewall Rule.
Import
MySQL Firewall Rule's can be imported using the resourceId
, e.g.