Skip to content

azurermMariadbServer

Manages a MariaDB 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 azurermMariadbServerExample = new azurerm.mariadbServer.MariadbServer(
  this,
  "example_2",
  {
    administrator_login: "mariadbadmin",
    administrator_login_password: "H@Sh1CoR3!",
    auto_grow_enabled: true,
    backup_retention_days: 7,
    geo_redundant_backup_enabled: false,
    location: azurermResourceGroupExample.location,
    name: "example-mariadb-server",
    public_network_access_enabled: false,
    resource_group_name: azurermResourceGroupExample.name,
    sku_name: "B_Gen5_2",
    ssl_enforcement_enabled: true,
    ssl_minimal_tls_version_enforced: "TLS1_2",
    storage_mb: 5120,
    version: "10.2",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMariadbServerExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the MariaDB Server. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the resource group in which to create the MariaDB Server. Changing this forces a new resource to be created.

  • location - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • skuName - (Required) Specifies the SKU Name for this MariaDB Server. The name of the SKU, follows the tier + family + cores pattern (e.g. bGen41, gpGen58). For more information see the product documentation. Possible values are bGen51, bGen52, gpGen52, gpGen54, gpGen58, gpGen516, gpGen532, moGen52, moGen54, moGen58 and moGen516.

  • version - (Required) Specifies the version of MariaDB to use. Possible values are 102 and 103. Changing this forces a new resource to be created.

  • administratorLogin - (Optional) The Administrator login for the MariaDB Server. Changing this forces a new resource to be created.

  • administratorLoginPassword - (Optional) The Password associated with the administratorLogin for the MariaDB Server.

  • autoGrowEnabled - (Optional) Enable/Disable auto-growing of the storage. Storage auto-grow prevents your server from running out of storage and becoming read-only. If storage auto grow is enabled, the storage automatically grows without impacting the workload. The default value if not explicitly specified is true.

  • backupRetentionDays - (Optional) Backup retention days for the server, supported values are between 7 and 35 days.

  • createMode - (Optional) The creation mode. Can be used to restore or replicate existing servers. Possible values are default, replica, geoRestore, and pointInTimeRestore. Defaults to default.

  • creationSourceServerId - (Optional) For creation modes other than default, the source server ID to use.

  • geoRedundantBackupEnabled - (Optional) Turn Geo-redundant server backups on/off. This allows you to choose between locally redundant or geo-redundant backup storage in the General Purpose and Memory Optimized tiers. When the backups are stored in geo-redundant backup storage, they are not only stored within the region in which your server is hosted, but are also replicated to a paired data center. This provides better protection and ability to restore your server in a different region in the event of a disaster. This is not supported for the Basic tier.

  • publicNetworkAccessEnabled - (Optional) Whether or not public network access is allowed for this server. Defaults to true.

  • restorePointInTime - (Optional) When createMode is pointInTimeRestore, specifies the point in time to restore from creationSourceServerId. It should be provided in RFC3339 format, e.g. 20131108T22:00:40Z.

  • sslEnforcementEnabled - (Required) Specifies if SSL should be enforced on connections. Possible values are true and false.

-> NOTE: sslMinimalTlsVersionEnforced must be set to tlsEnforcementDisabled when sslEnforcementEnabled is set to false.

  • sslMinimalTlsVersionEnforced - (Optional) The minimum TLS version to support on the sever. Possible values are tlsEnforcementDisabled, tls10, tls11, and tls12. Defaults to tls12.

  • storageMb - (Optional) Max storage allowed for a server. Possible values are between 5120 MB (5GB) and 1024000MB (1TB) for the Basic SKU and between 5120 MB (5GB) and 4096000 MB (4TB) for General Purpose/Memory Optimized SKUs. For more information see the product documentation.

  • tags - (Optional) A mapping of tags to assign to the resource.

Attributes Reference

The following attributes are exported:

  • id - The ID of the MariaDB Server.

  • fqdn - The FQDN of the MariaDB Server.

Timeouts

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

  • create - (Defaults to 90 minutes) Used when creating the MariaDB Server.
  • update - (Defaults to 60 minutes) Used when updating the MariaDB Server.
  • read - (Defaults to 5 minutes) Used when retrieving the MariaDB Server.
  • delete - (Defaults to 60 minutes) Used when deleting the MariaDB Server.

Import

MariaDB Server's can be imported using the resourceId, e.g.

terraform import azurerm_mariadb_server.server1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforMariaDB/servers/server1