import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages a MySQL Flexible Server. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "example-resources", * location: "West Europe", * }); * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", { * name: "example-vn", * location: example.location, * resourceGroupName: example.name, * addressSpaces: ["10.0.0.0/16"], * }); * const exampleSubnet = new azure.network.Subnet("example", { * name: "example-sn", * resourceGroupName: example.name, * virtualNetworkName: exampleVirtualNetwork.name, * addressPrefixes: ["10.0.2.0/24"], * serviceEndpoints: ["Microsoft.Storage"], * delegations: [{ * name: "fs", * serviceDelegation: { * name: "Microsoft.DBforMySQL/flexibleServers", * actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"], * }, * }], * }); * const exampleZone = new azure.privatedns.Zone("example", { * name: "example.mysql.database.azure.com", * resourceGroupName: example.name, * }); * const exampleZoneVirtualNetworkLink = new azure.privatedns.ZoneVirtualNetworkLink("example", { * name: "exampleVnetZone.com", * privateDnsZoneName: exampleZone.name, * virtualNetworkId: exampleVirtualNetwork.id, * resourceGroupName: example.name, * }); * const exampleFlexibleServer = new azure.mysql.FlexibleServer("example", { * name: "example-fs", * resourceGroupName: example.name, * location: example.location, * administratorLogin: "psqladmin", * administratorPassword: "H@Sh1CoR3!", * backupRetentionDays: 7, * delegatedSubnetId: exampleSubnet.id, * privateDnsZoneId: exampleZone.id, * skuName: "GP_Standard_D2ds_v4", * }, { * dependsOn: [exampleZoneVirtualNetworkLink], * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.DBforMySQL` - 2023-12-30 * * ## Import * * MySQL Flexible Servers can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:mysql/flexibleServer:FlexibleServer example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServer1 * ``` */ export declare class FlexibleServer extends pulumi.CustomResource { /** * Get an existing FlexibleServer 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?: FlexibleServerState, opts?: pulumi.CustomResourceOptions): FlexibleServer; /** * Returns true if the given object is an instance of FlexibleServer. 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 FlexibleServer; /** * The Administrator login for the MySQL Flexible Server. Required when `createMode` is `Default`. Changing this forces a new MySQL Flexible Server to be created. */ readonly administratorLogin: pulumi.Output; /** * The Password associated with the `administratorLogin` for the MySQL Flexible Server. */ readonly administratorPassword: pulumi.Output; /** * An integer value used to trigger an update for `administratorPasswordWo`. This property should be incremented when updating `administratorPasswordWo`. * * > **Note:** Either `administratorPassword` or `administratorPasswordWo` is required when `createMode` is `Default`. */ readonly administratorPasswordWoVersion: pulumi.Output; /** * The backup retention days for the MySQL Flexible Server. Possible values are between `1` and `35` days. Defaults to `7`. */ readonly backupRetentionDays: pulumi.Output; /** * The creation mode which can be used to restore or replicate existing servers. Possible values are `Default`, `PointInTimeRestore`, `GeoRestore`, and `Replica`. Changing this forces a new MySQL Flexible Server to be created. * * > **Note:** Creating a `GeoRestore` server requires the source server with `geoRedundantBackupEnabled` enabled. * * > **Note:** When a server is first created it may not be immediately available for `geo restore` or `replica`. It may take a few minutes to several hours for the necessary metadata to be populated. Please see the [Geo Restore](https://learn.microsoft.com/azure/mysql/single-server/how-to-restore-server-portal#geo-restore) and the [Replica](https://learn.microsoft.com/azure/mysql/flexible-server/concepts-read-replicas#create-a-replica) for more information. * * > **Note:** When importing a MySQL Flexible Server, `createMode` is not returned by the api so you will see a diff if `createMode` is specified in your config. To prevent recreation, use the `ignoreChanges` lifecycle meta-argument. */ readonly createMode: pulumi.Output; /** * A `customerManagedKey` block as defined below. * * > **Note:** `identity` is required when `customerManagedKey` is specified. */ readonly customerManagedKey: pulumi.Output; /** * The ID of the virtual network subnet to create the MySQL Flexible Server. Changing this forces a new MySQL Flexible Server to be created. */ readonly delegatedSubnetId: pulumi.Output; /** * The fully qualified domain name of the MySQL Flexible Server. */ readonly fqdn: pulumi.Output; /** * Should geo redundant backup enabled? Defaults to `false`. Changing this forces a new MySQL Flexible Server to be created. */ readonly geoRedundantBackupEnabled: pulumi.Output; /** * A `highAvailability` block as defined below. */ readonly highAvailability: pulumi.Output; /** * An `identity` block as defined below. */ readonly identity: pulumi.Output; /** * The Azure Region where the MySQL Flexible Server should exist. Changing this forces a new MySQL Flexible Server to be created. */ readonly location: pulumi.Output; /** * A `maintenanceWindow` block as defined below. */ readonly maintenanceWindow: pulumi.Output; /** * The name which should be used for this MySQL Flexible Server. Changing this forces a new MySQL Flexible Server to be created. */ readonly name: pulumi.Output; /** * The point in time to restore from `creationSourceServerId` when `createMode` is `PointInTimeRestore`. Changing this forces a new MySQL Flexible Server to be created. */ readonly pointInTimeRestoreTimeInUtc: pulumi.Output; /** * The ID of the private DNS zone to create the MySQL Flexible Server. Changing this forces a new MySQL Flexible Server to be created. * * > **Note:** The `privateDnsZoneId` is required when setting a `delegatedSubnetId`. The `azure.privatedns.Zone` should end with suffix `.mysql.database.azure.com`. */ readonly privateDnsZoneId: pulumi.Output; /** * Whether approved public traffic is allowed through the firewall to this server. Possible values are `Enabled` and `Disabled`. * * > **Note:** `publicNetworkAccess` is automatically set to `Disabled` if the server is created with VNet Integration (i.e. values are provided for `delegatedSubnetId` and `privateDnsZoneId`"). */ readonly publicNetworkAccess: pulumi.Output; readonly publicNetworkAccessEnabled: pulumi.Output; /** * The maximum number of replicas that a primary MySQL Flexible Server can have. */ readonly replicaCapacity: pulumi.Output; /** * The replication role. Possible value is `None`. * * > **Note:** The `replicationRole` cannot be set while creating and only can be updated from `Replica` to `None`. */ readonly replicationRole: pulumi.Output; /** * The name of the Resource Group where the MySQL Flexible Server should exist. Changing this forces a new MySQL Flexible Server to be created. */ readonly resourceGroupName: pulumi.Output; /** * The SKU Name for the MySQL Flexible Server. * * > **Note:** `skuName` should start with SKU tier `B (Burstable)`, `GP (General Purpose)`, `MO (Memory Optimized)` like `B_Standard_B1ms`. */ readonly skuName: pulumi.Output; /** * The resource ID of the source MySQL Flexible Server to be restored. Required when `createMode` is `PointInTimeRestore`, `GeoRestore`, and `Replica`. Changing this forces a new MySQL Flexible Server to be created. * * > **Note:** The replica server is always created in the same resource group and subscription as the source server. */ readonly sourceServerId: pulumi.Output; /** * A `storage` block as defined below. */ readonly storage: pulumi.Output; /** * A mapping of tags which should be assigned to the MySQL Flexible Server. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The version of the MySQL Flexible Server to use. Possible values are `5.7`, `8.0.21` and `8.4`. */ readonly version: pulumi.Output; /** * Specifies the Availability Zone in which this MySQL Flexible Server should be located. Possible values are `1`, `2` and `3`. * * > **Note:** Azure will automatically assign an Availability Zone if one is not specified. If the MySQL Flexible Server fails-over to the Standby Availability Zone, the `zone` will be updated to reflect the current Primary Availability Zone. You can use Terraform's `ignoreChanges` functionality to ignore changes to the `zone` and `high_availability[0].standby_availability_zone` fields should you wish for Terraform to not migrate the MySQL Flexible Server back to it's primary Availability Zone after a fail-over. * * > **Note:** The Availability Zones available depend on the Azure Region that the MySQL Flexible Server is being deployed into - see [the Azure Availability Zones documentation](https://azure.microsoft.com/global-infrastructure/geographies/#geographies) for more information on which Availability Zones are available in each Azure Region. */ readonly zone: pulumi.Output; /** * Create a FlexibleServer 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: FlexibleServerArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FlexibleServer resources. */ export interface FlexibleServerState { /** * The Administrator login for the MySQL Flexible Server. Required when `createMode` is `Default`. Changing this forces a new MySQL Flexible Server to be created. */ administratorLogin?: pulumi.Input; /** * The Password associated with the `administratorLogin` for the MySQL Flexible Server. */ administratorPassword?: pulumi.Input; /** * An integer value used to trigger an update for `administratorPasswordWo`. This property should be incremented when updating `administratorPasswordWo`. * * > **Note:** Either `administratorPassword` or `administratorPasswordWo` is required when `createMode` is `Default`. */ administratorPasswordWoVersion?: pulumi.Input; /** * The backup retention days for the MySQL Flexible Server. Possible values are between `1` and `35` days. Defaults to `7`. */ backupRetentionDays?: pulumi.Input; /** * The creation mode which can be used to restore or replicate existing servers. Possible values are `Default`, `PointInTimeRestore`, `GeoRestore`, and `Replica`. Changing this forces a new MySQL Flexible Server to be created. * * > **Note:** Creating a `GeoRestore` server requires the source server with `geoRedundantBackupEnabled` enabled. * * > **Note:** When a server is first created it may not be immediately available for `geo restore` or `replica`. It may take a few minutes to several hours for the necessary metadata to be populated. Please see the [Geo Restore](https://learn.microsoft.com/azure/mysql/single-server/how-to-restore-server-portal#geo-restore) and the [Replica](https://learn.microsoft.com/azure/mysql/flexible-server/concepts-read-replicas#create-a-replica) for more information. * * > **Note:** When importing a MySQL Flexible Server, `createMode` is not returned by the api so you will see a diff if `createMode` is specified in your config. To prevent recreation, use the `ignoreChanges` lifecycle meta-argument. */ createMode?: pulumi.Input; /** * A `customerManagedKey` block as defined below. * * > **Note:** `identity` is required when `customerManagedKey` is specified. */ customerManagedKey?: pulumi.Input; /** * The ID of the virtual network subnet to create the MySQL Flexible Server. Changing this forces a new MySQL Flexible Server to be created. */ delegatedSubnetId?: pulumi.Input; /** * The fully qualified domain name of the MySQL Flexible Server. */ fqdn?: pulumi.Input; /** * Should geo redundant backup enabled? Defaults to `false`. Changing this forces a new MySQL Flexible Server to be created. */ geoRedundantBackupEnabled?: pulumi.Input; /** * A `highAvailability` block as defined below. */ highAvailability?: pulumi.Input; /** * An `identity` block as defined below. */ identity?: pulumi.Input; /** * The Azure Region where the MySQL Flexible Server should exist. Changing this forces a new MySQL Flexible Server to be created. */ location?: pulumi.Input; /** * A `maintenanceWindow` block as defined below. */ maintenanceWindow?: pulumi.Input; /** * The name which should be used for this MySQL Flexible Server. Changing this forces a new MySQL Flexible Server to be created. */ name?: pulumi.Input; /** * The point in time to restore from `creationSourceServerId` when `createMode` is `PointInTimeRestore`. Changing this forces a new MySQL Flexible Server to be created. */ pointInTimeRestoreTimeInUtc?: pulumi.Input; /** * The ID of the private DNS zone to create the MySQL Flexible Server. Changing this forces a new MySQL Flexible Server to be created. * * > **Note:** The `privateDnsZoneId` is required when setting a `delegatedSubnetId`. The `azure.privatedns.Zone` should end with suffix `.mysql.database.azure.com`. */ privateDnsZoneId?: pulumi.Input; /** * Whether approved public traffic is allowed through the firewall to this server. Possible values are `Enabled` and `Disabled`. * * > **Note:** `publicNetworkAccess` is automatically set to `Disabled` if the server is created with VNet Integration (i.e. values are provided for `delegatedSubnetId` and `privateDnsZoneId`"). */ publicNetworkAccess?: pulumi.Input; publicNetworkAccessEnabled?: pulumi.Input; /** * The maximum number of replicas that a primary MySQL Flexible Server can have. */ replicaCapacity?: pulumi.Input; /** * The replication role. Possible value is `None`. * * > **Note:** The `replicationRole` cannot be set while creating and only can be updated from `Replica` to `None`. */ replicationRole?: pulumi.Input; /** * The name of the Resource Group where the MySQL Flexible Server should exist. Changing this forces a new MySQL Flexible Server to be created. */ resourceGroupName?: pulumi.Input; /** * The SKU Name for the MySQL Flexible Server. * * > **Note:** `skuName` should start with SKU tier `B (Burstable)`, `GP (General Purpose)`, `MO (Memory Optimized)` like `B_Standard_B1ms`. */ skuName?: pulumi.Input; /** * The resource ID of the source MySQL Flexible Server to be restored. Required when `createMode` is `PointInTimeRestore`, `GeoRestore`, and `Replica`. Changing this forces a new MySQL Flexible Server to be created. * * > **Note:** The replica server is always created in the same resource group and subscription as the source server. */ sourceServerId?: pulumi.Input; /** * A `storage` block as defined below. */ storage?: pulumi.Input; /** * A mapping of tags which should be assigned to the MySQL Flexible Server. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The version of the MySQL Flexible Server to use. Possible values are `5.7`, `8.0.21` and `8.4`. */ version?: pulumi.Input; /** * Specifies the Availability Zone in which this MySQL Flexible Server should be located. Possible values are `1`, `2` and `3`. * * > **Note:** Azure will automatically assign an Availability Zone if one is not specified. If the MySQL Flexible Server fails-over to the Standby Availability Zone, the `zone` will be updated to reflect the current Primary Availability Zone. You can use Terraform's `ignoreChanges` functionality to ignore changes to the `zone` and `high_availability[0].standby_availability_zone` fields should you wish for Terraform to not migrate the MySQL Flexible Server back to it's primary Availability Zone after a fail-over. * * > **Note:** The Availability Zones available depend on the Azure Region that the MySQL Flexible Server is being deployed into - see [the Azure Availability Zones documentation](https://azure.microsoft.com/global-infrastructure/geographies/#geographies) for more information on which Availability Zones are available in each Azure Region. */ zone?: pulumi.Input; } /** * The set of arguments for constructing a FlexibleServer resource. */ export interface FlexibleServerArgs { /** * The Administrator login for the MySQL Flexible Server. Required when `createMode` is `Default`. Changing this forces a new MySQL Flexible Server to be created. */ administratorLogin?: pulumi.Input; /** * The Password associated with the `administratorLogin` for the MySQL Flexible Server. */ administratorPassword?: pulumi.Input; /** * An integer value used to trigger an update for `administratorPasswordWo`. This property should be incremented when updating `administratorPasswordWo`. * * > **Note:** Either `administratorPassword` or `administratorPasswordWo` is required when `createMode` is `Default`. */ administratorPasswordWoVersion?: pulumi.Input; /** * The backup retention days for the MySQL Flexible Server. Possible values are between `1` and `35` days. Defaults to `7`. */ backupRetentionDays?: pulumi.Input; /** * The creation mode which can be used to restore or replicate existing servers. Possible values are `Default`, `PointInTimeRestore`, `GeoRestore`, and `Replica`. Changing this forces a new MySQL Flexible Server to be created. * * > **Note:** Creating a `GeoRestore` server requires the source server with `geoRedundantBackupEnabled` enabled. * * > **Note:** When a server is first created it may not be immediately available for `geo restore` or `replica`. It may take a few minutes to several hours for the necessary metadata to be populated. Please see the [Geo Restore](https://learn.microsoft.com/azure/mysql/single-server/how-to-restore-server-portal#geo-restore) and the [Replica](https://learn.microsoft.com/azure/mysql/flexible-server/concepts-read-replicas#create-a-replica) for more information. * * > **Note:** When importing a MySQL Flexible Server, `createMode` is not returned by the api so you will see a diff if `createMode` is specified in your config. To prevent recreation, use the `ignoreChanges` lifecycle meta-argument. */ createMode?: pulumi.Input; /** * A `customerManagedKey` block as defined below. * * > **Note:** `identity` is required when `customerManagedKey` is specified. */ customerManagedKey?: pulumi.Input; /** * The ID of the virtual network subnet to create the MySQL Flexible Server. Changing this forces a new MySQL Flexible Server to be created. */ delegatedSubnetId?: pulumi.Input; /** * Should geo redundant backup enabled? Defaults to `false`. Changing this forces a new MySQL Flexible Server to be created. */ geoRedundantBackupEnabled?: pulumi.Input; /** * A `highAvailability` block as defined below. */ highAvailability?: pulumi.Input; /** * An `identity` block as defined below. */ identity?: pulumi.Input; /** * The Azure Region where the MySQL Flexible Server should exist. Changing this forces a new MySQL Flexible Server to be created. */ location?: pulumi.Input; /** * A `maintenanceWindow` block as defined below. */ maintenanceWindow?: pulumi.Input; /** * The name which should be used for this MySQL Flexible Server. Changing this forces a new MySQL Flexible Server to be created. */ name?: pulumi.Input; /** * The point in time to restore from `creationSourceServerId` when `createMode` is `PointInTimeRestore`. Changing this forces a new MySQL Flexible Server to be created. */ pointInTimeRestoreTimeInUtc?: pulumi.Input; /** * The ID of the private DNS zone to create the MySQL Flexible Server. Changing this forces a new MySQL Flexible Server to be created. * * > **Note:** The `privateDnsZoneId` is required when setting a `delegatedSubnetId`. The `azure.privatedns.Zone` should end with suffix `.mysql.database.azure.com`. */ privateDnsZoneId?: pulumi.Input; /** * Whether approved public traffic is allowed through the firewall to this server. Possible values are `Enabled` and `Disabled`. * * > **Note:** `publicNetworkAccess` is automatically set to `Disabled` if the server is created with VNet Integration (i.e. values are provided for `delegatedSubnetId` and `privateDnsZoneId`"). */ publicNetworkAccess?: pulumi.Input; /** * The replication role. Possible value is `None`. * * > **Note:** The `replicationRole` cannot be set while creating and only can be updated from `Replica` to `None`. */ replicationRole?: pulumi.Input; /** * The name of the Resource Group where the MySQL Flexible Server should exist. Changing this forces a new MySQL Flexible Server to be created. */ resourceGroupName: pulumi.Input; /** * The SKU Name for the MySQL Flexible Server. * * > **Note:** `skuName` should start with SKU tier `B (Burstable)`, `GP (General Purpose)`, `MO (Memory Optimized)` like `B_Standard_B1ms`. */ skuName?: pulumi.Input; /** * The resource ID of the source MySQL Flexible Server to be restored. Required when `createMode` is `PointInTimeRestore`, `GeoRestore`, and `Replica`. Changing this forces a new MySQL Flexible Server to be created. * * > **Note:** The replica server is always created in the same resource group and subscription as the source server. */ sourceServerId?: pulumi.Input; /** * A `storage` block as defined below. */ storage?: pulumi.Input; /** * A mapping of tags which should be assigned to the MySQL Flexible Server. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The version of the MySQL Flexible Server to use. Possible values are `5.7`, `8.0.21` and `8.4`. */ version?: pulumi.Input; /** * Specifies the Availability Zone in which this MySQL Flexible Server should be located. Possible values are `1`, `2` and `3`. * * > **Note:** Azure will automatically assign an Availability Zone if one is not specified. If the MySQL Flexible Server fails-over to the Standby Availability Zone, the `zone` will be updated to reflect the current Primary Availability Zone. You can use Terraform's `ignoreChanges` functionality to ignore changes to the `zone` and `high_availability[0].standby_availability_zone` fields should you wish for Terraform to not migrate the MySQL Flexible Server back to it's primary Availability Zone after a fail-over. * * > **Note:** The Availability Zones available depend on the Azure Region that the MySQL Flexible Server is being deployed into - see [the Azure Availability Zones documentation](https://azure.microsoft.com/global-infrastructure/geographies/#geographies) for more information on which Availability Zones are available in each Azure Region. */ zone?: pulumi.Input; }