Skip to content

azurermMysqlServer

Use this data source to access information about an existing MySQL Server.

Example Usage

import * as cdktf from "cdktf";
/*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 dataAzurermMysqlServerExample =
  new azurerm.dataAzurermMysqlServer.DataAzurermMysqlServer(this, "example", {
    name: "existingMySqlServer",
    resource_group_name: "existingResGroup",
  });
new cdktf.TerraformOutput(this, "id", {
  value: dataAzurermMysqlServerExample.id,
});

Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the MySQL Server.

  • resourceGroupName - (Required) The name of the resource group for the MySQL Server.

Attributes Reference

  • id - The ID of the MySQL Server.

  • fqdn - The FQDN of the MySQL Server.

  • location - The Azure location where the resource exists.

  • skuName - The SKU Name for this MySQL Server.

  • version - The version of this MySQL Server.

  • administratorLogin - The Administrator login for the MySQL Server.

  • autoGrowEnabled - The auto grow setting for this MySQL Server.

  • backupRetentionDays - The backup retention days for this MySQL server.

  • geoRedundantBackupEnabled - The geo redundant backup setting for this MySQL Server.

  • identity - An identity block as defined below.

  • infrastructureEncryptionEnabled - Whether or not infrastructure is encrypted for this MySQL Server.

  • publicNetworkAccessEnabled - Whether or not public network access is allowed for this MySQL Server.

  • sslEnforcementEnabled - Specifies if SSL should be enforced on connections for this MySQL Server.

  • sslMinimalTlsVersionEnforced - The minimum TLS version to support for this MySQL Server.

  • storageMb - Max storage allowed for this MySQL Server.

  • threatDetectionPolicy - Threat detection policy configuration, known in the API as Server Security Alerts Policy. The threatDetectionPolicy block exports fields documented below.

  • tags - A mapping of tags to assign to the resource.


An identity block exports the following:

  • principalId - The Principal ID associated with this Managed Service Identity.

  • tenantId - The Tenant ID associated with this Managed Service Identity.

  • type - The identity type of this Managed Service Identity.


A threatDetectionPolicy block exports the following:

  • enabled - Is the policy enabled?

  • disabledAlerts - Specifies a list of alerts which should be disabled. Possible values include accessAnomaly, sqlInjection and sqlInjectionVulnerability.

  • emailAccountAdmins - Should the account administrators be emailed when this alert is triggered?

  • emailAddresses - A list of email addresses which alerts should be sent to.

  • retentionDays - Specifies the number of days to keep in the Threat Detection audit logs.

  • storageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account.

  • storageEndpoint - Specifies the blob storage endpoint (e.g. https://example.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.

Timeouts

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

  • read - (Defaults to 5 minutes) Used when retrieving the MySQL Server.