1. Packages
  2. Azure Classic
  3. API Docs
  4. mysql
  5. getFlexibleServer

We recommend using Azure Native.

Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi

azure.mysql.getFlexibleServer

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.mysql.getFlexibleServer({
    name: "existingMySqlFlexibleServer",
    resourceGroupName: "existingResGroup",
});
export const id = example.then(example => example.id);
Copy
import pulumi
import pulumi_azure as azure

example = azure.mysql.get_flexible_server(name="existingMySqlFlexibleServer",
    resource_group_name="existingResGroup")
pulumi.export("id", example.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/mysql"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := mysql.LookupFlexibleServer(ctx, &mysql.LookupFlexibleServerArgs{
			Name:              "existingMySqlFlexibleServer",
			ResourceGroupName: "existingResGroup",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", example.Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.MySql.GetFlexibleServer.Invoke(new()
    {
        Name = "existingMySqlFlexibleServer",
        ResourceGroupName = "existingResGroup",
    });

    return new Dictionary<string, object?>
    {
        ["id"] = example.Apply(getFlexibleServerResult => getFlexibleServerResult.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.mysql.MysqlFunctions;
import com.pulumi.azure.mysql.inputs.GetFlexibleServerArgs;
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) {
        final var example = MysqlFunctions.getFlexibleServer(GetFlexibleServerArgs.builder()
            .name("existingMySqlFlexibleServer")
            .resourceGroupName("existingResGroup")
            .build());

        ctx.export("id", example.applyValue(getFlexibleServerResult -> getFlexibleServerResult.id()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:mysql:getFlexibleServer
      arguments:
        name: existingMySqlFlexibleServer
        resourceGroupName: existingResGroup
outputs:
  id: ${example.id}
Copy

Using getFlexibleServer

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getFlexibleServer(args: GetFlexibleServerArgs, opts?: InvokeOptions): Promise<GetFlexibleServerResult>
function getFlexibleServerOutput(args: GetFlexibleServerOutputArgs, opts?: InvokeOptions): Output<GetFlexibleServerResult>
Copy
def get_flexible_server(name: Optional[str] = None,
                        resource_group_name: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetFlexibleServerResult
def get_flexible_server_output(name: Optional[pulumi.Input[str]] = None,
                        resource_group_name: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetFlexibleServerResult]
Copy
func LookupFlexibleServer(ctx *Context, args *LookupFlexibleServerArgs, opts ...InvokeOption) (*LookupFlexibleServerResult, error)
func LookupFlexibleServerOutput(ctx *Context, args *LookupFlexibleServerOutputArgs, opts ...InvokeOption) LookupFlexibleServerResultOutput
Copy

> Note: This function is named LookupFlexibleServer in the Go SDK.

public static class GetFlexibleServer 
{
    public static Task<GetFlexibleServerResult> InvokeAsync(GetFlexibleServerArgs args, InvokeOptions? opts = null)
    public static Output<GetFlexibleServerResult> Invoke(GetFlexibleServerInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetFlexibleServerResult> getFlexibleServer(GetFlexibleServerArgs args, InvokeOptions options)
public static Output<GetFlexibleServerResult> getFlexibleServer(GetFlexibleServerArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:mysql/getFlexibleServer:getFlexibleServer
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Specifies the name of the MySQL Flexible Server.
ResourceGroupName This property is required. string
The name of the resource group for the MySQL Flexible Server.
Name This property is required. string
Specifies the name of the MySQL Flexible Server.
ResourceGroupName This property is required. string
The name of the resource group for the MySQL Flexible Server.
name This property is required. String
Specifies the name of the MySQL Flexible Server.
resourceGroupName This property is required. String
The name of the resource group for the MySQL Flexible Server.
name This property is required. string
Specifies the name of the MySQL Flexible Server.
resourceGroupName This property is required. string
The name of the resource group for the MySQL Flexible Server.
name This property is required. str
Specifies the name of the MySQL Flexible Server.
resource_group_name This property is required. str
The name of the resource group for the MySQL Flexible Server.
name This property is required. String
Specifies the name of the MySQL Flexible Server.
resourceGroupName This property is required. String
The name of the resource group for the MySQL Flexible Server.

getFlexibleServer Result

The following output properties are available:

AdministratorLogin string
The Administrator login of the MySQL Flexible Server.
BackupRetentionDays int
The backup retention days of the MySQL Flexible Server.
DelegatedSubnetId string
The ID of the virtual network subnet the MySQL Flexible Server is created in.
Fqdn string
The fully qualified domain name of the MySQL Flexible Server.
GeoRedundantBackupEnabled bool
Is geo redundant backup enabled?
HighAvailabilities List<GetFlexibleServerHighAvailability>
A high_availability block for this MySQL Flexible Server as defined below.
Id string
The provider-assigned unique ID for this managed resource.
Location string
The Azure Region of the MySQL Flexible Server.
MaintenanceWindows List<GetFlexibleServerMaintenanceWindow>
A maintenance_window block for this MySQL Flexible Server as defined below.
Name string
PrivateDnsZoneId string
The ID of the Private DNS zone of the MySQL Flexible Server.
PublicNetworkAccessEnabled bool
Is the public network access enabled?
ReplicaCapacity int
The maximum number of replicas that a primary MySQL Flexible Server can have.
ReplicationRole string
The replication role of the MySQL Flexible Server.
ResourceGroupName string
RestorePointInTime string
SkuName string
The SKU Name of the MySQL Flexible Server.
Storages List<GetFlexibleServerStorage>
A storage block for this MySQL Flexible Server as defined below.
Tags Dictionary<string, string>
A mapping of tags which are assigned to the MySQL Flexible Server.
Version string
The version of the MySQL Flexible Server.
Zone string
The Availability Zones where this MySQL Flexible Server is located.
AdministratorLogin string
The Administrator login of the MySQL Flexible Server.
BackupRetentionDays int
The backup retention days of the MySQL Flexible Server.
DelegatedSubnetId string
The ID of the virtual network subnet the MySQL Flexible Server is created in.
Fqdn string
The fully qualified domain name of the MySQL Flexible Server.
GeoRedundantBackupEnabled bool
Is geo redundant backup enabled?
HighAvailabilities []GetFlexibleServerHighAvailability
A high_availability block for this MySQL Flexible Server as defined below.
Id string
The provider-assigned unique ID for this managed resource.
Location string
The Azure Region of the MySQL Flexible Server.
MaintenanceWindows []GetFlexibleServerMaintenanceWindow
A maintenance_window block for this MySQL Flexible Server as defined below.
Name string
PrivateDnsZoneId string
The ID of the Private DNS zone of the MySQL Flexible Server.
PublicNetworkAccessEnabled bool
Is the public network access enabled?
ReplicaCapacity int
The maximum number of replicas that a primary MySQL Flexible Server can have.
ReplicationRole string
The replication role of the MySQL Flexible Server.
ResourceGroupName string
RestorePointInTime string
SkuName string
The SKU Name of the MySQL Flexible Server.
Storages []GetFlexibleServerStorage
A storage block for this MySQL Flexible Server as defined below.
Tags map[string]string
A mapping of tags which are assigned to the MySQL Flexible Server.
Version string
The version of the MySQL Flexible Server.
Zone string
The Availability Zones where this MySQL Flexible Server is located.
administratorLogin String
The Administrator login of the MySQL Flexible Server.
backupRetentionDays Integer
The backup retention days of the MySQL Flexible Server.
delegatedSubnetId String
The ID of the virtual network subnet the MySQL Flexible Server is created in.
fqdn String
The fully qualified domain name of the MySQL Flexible Server.
geoRedundantBackupEnabled Boolean
Is geo redundant backup enabled?
highAvailabilities List<GetFlexibleServerHighAvailability>
A high_availability block for this MySQL Flexible Server as defined below.
id String
The provider-assigned unique ID for this managed resource.
location String
The Azure Region of the MySQL Flexible Server.
maintenanceWindows List<GetFlexibleServerMaintenanceWindow>
A maintenance_window block for this MySQL Flexible Server as defined below.
name String
privateDnsZoneId String
The ID of the Private DNS zone of the MySQL Flexible Server.
publicNetworkAccessEnabled Boolean
Is the public network access enabled?
replicaCapacity Integer
The maximum number of replicas that a primary MySQL Flexible Server can have.
replicationRole String
The replication role of the MySQL Flexible Server.
resourceGroupName String
restorePointInTime String
skuName String
The SKU Name of the MySQL Flexible Server.
storages List<GetFlexibleServerStorage>
A storage block for this MySQL Flexible Server as defined below.
tags Map<String,String>
A mapping of tags which are assigned to the MySQL Flexible Server.
version String
The version of the MySQL Flexible Server.
zone String
The Availability Zones where this MySQL Flexible Server is located.
administratorLogin string
The Administrator login of the MySQL Flexible Server.
backupRetentionDays number
The backup retention days of the MySQL Flexible Server.
delegatedSubnetId string
The ID of the virtual network subnet the MySQL Flexible Server is created in.
fqdn string
The fully qualified domain name of the MySQL Flexible Server.
geoRedundantBackupEnabled boolean
Is geo redundant backup enabled?
highAvailabilities GetFlexibleServerHighAvailability[]
A high_availability block for this MySQL Flexible Server as defined below.
id string
The provider-assigned unique ID for this managed resource.
location string
The Azure Region of the MySQL Flexible Server.
maintenanceWindows GetFlexibleServerMaintenanceWindow[]
A maintenance_window block for this MySQL Flexible Server as defined below.
name string
privateDnsZoneId string
The ID of the Private DNS zone of the MySQL Flexible Server.
publicNetworkAccessEnabled boolean
Is the public network access enabled?
replicaCapacity number
The maximum number of replicas that a primary MySQL Flexible Server can have.
replicationRole string
The replication role of the MySQL Flexible Server.
resourceGroupName string
restorePointInTime string
skuName string
The SKU Name of the MySQL Flexible Server.
storages GetFlexibleServerStorage[]
A storage block for this MySQL Flexible Server as defined below.
tags {[key: string]: string}
A mapping of tags which are assigned to the MySQL Flexible Server.
version string
The version of the MySQL Flexible Server.
zone string
The Availability Zones where this MySQL Flexible Server is located.
administrator_login str
The Administrator login of the MySQL Flexible Server.
backup_retention_days int
The backup retention days of the MySQL Flexible Server.
delegated_subnet_id str
The ID of the virtual network subnet the MySQL Flexible Server is created in.
fqdn str
The fully qualified domain name of the MySQL Flexible Server.
geo_redundant_backup_enabled bool
Is geo redundant backup enabled?
high_availabilities Sequence[GetFlexibleServerHighAvailability]
A high_availability block for this MySQL Flexible Server as defined below.
id str
The provider-assigned unique ID for this managed resource.
location str
The Azure Region of the MySQL Flexible Server.
maintenance_windows Sequence[GetFlexibleServerMaintenanceWindow]
A maintenance_window block for this MySQL Flexible Server as defined below.
name str
private_dns_zone_id str
The ID of the Private DNS zone of the MySQL Flexible Server.
public_network_access_enabled bool
Is the public network access enabled?
replica_capacity int
The maximum number of replicas that a primary MySQL Flexible Server can have.
replication_role str
The replication role of the MySQL Flexible Server.
resource_group_name str
restore_point_in_time str
sku_name str
The SKU Name of the MySQL Flexible Server.
storages Sequence[GetFlexibleServerStorage]
A storage block for this MySQL Flexible Server as defined below.
tags Mapping[str, str]
A mapping of tags which are assigned to the MySQL Flexible Server.
version str
The version of the MySQL Flexible Server.
zone str
The Availability Zones where this MySQL Flexible Server is located.
administratorLogin String
The Administrator login of the MySQL Flexible Server.
backupRetentionDays Number
The backup retention days of the MySQL Flexible Server.
delegatedSubnetId String
The ID of the virtual network subnet the MySQL Flexible Server is created in.
fqdn String
The fully qualified domain name of the MySQL Flexible Server.
geoRedundantBackupEnabled Boolean
Is geo redundant backup enabled?
highAvailabilities List<Property Map>
A high_availability block for this MySQL Flexible Server as defined below.
id String
The provider-assigned unique ID for this managed resource.
location String
The Azure Region of the MySQL Flexible Server.
maintenanceWindows List<Property Map>
A maintenance_window block for this MySQL Flexible Server as defined below.
name String
privateDnsZoneId String
The ID of the Private DNS zone of the MySQL Flexible Server.
publicNetworkAccessEnabled Boolean
Is the public network access enabled?
replicaCapacity Number
The maximum number of replicas that a primary MySQL Flexible Server can have.
replicationRole String
The replication role of the MySQL Flexible Server.
resourceGroupName String
restorePointInTime String
skuName String
The SKU Name of the MySQL Flexible Server.
storages List<Property Map>
A storage block for this MySQL Flexible Server as defined below.
tags Map<String>
A mapping of tags which are assigned to the MySQL Flexible Server.
version String
The version of the MySQL Flexible Server.
zone String
The Availability Zones where this MySQL Flexible Server is located.

Supporting Types

GetFlexibleServerHighAvailability

Mode This property is required. string
The high availability mode of the MySQL Flexible Server.
StandbyAvailabilityZone This property is required. string
The availability zone of the standby Flexible Server.
Mode This property is required. string
The high availability mode of the MySQL Flexible Server.
StandbyAvailabilityZone This property is required. string
The availability zone of the standby Flexible Server.
mode This property is required. String
The high availability mode of the MySQL Flexible Server.
standbyAvailabilityZone This property is required. String
The availability zone of the standby Flexible Server.
mode This property is required. string
The high availability mode of the MySQL Flexible Server.
standbyAvailabilityZone This property is required. string
The availability zone of the standby Flexible Server.
mode This property is required. str
The high availability mode of the MySQL Flexible Server.
standby_availability_zone This property is required. str
The availability zone of the standby Flexible Server.
mode This property is required. String
The high availability mode of the MySQL Flexible Server.
standbyAvailabilityZone This property is required. String
The availability zone of the standby Flexible Server.

GetFlexibleServerMaintenanceWindow

DayOfWeek This property is required. int
The day of week of the maintenance window.
StartHour This property is required. int
The start hour of the maintenance window.
StartMinute This property is required. int
The start minute of the maintenance window.
DayOfWeek This property is required. int
The day of week of the maintenance window.
StartHour This property is required. int
The start hour of the maintenance window.
StartMinute This property is required. int
The start minute of the maintenance window.
dayOfWeek This property is required. Integer
The day of week of the maintenance window.
startHour This property is required. Integer
The start hour of the maintenance window.
startMinute This property is required. Integer
The start minute of the maintenance window.
dayOfWeek This property is required. number
The day of week of the maintenance window.
startHour This property is required. number
The start hour of the maintenance window.
startMinute This property is required. number
The start minute of the maintenance window.
day_of_week This property is required. int
The day of week of the maintenance window.
start_hour This property is required. int
The start hour of the maintenance window.
start_minute This property is required. int
The start minute of the maintenance window.
dayOfWeek This property is required. Number
The day of week of the maintenance window.
startHour This property is required. Number
The start hour of the maintenance window.
startMinute This property is required. Number
The start minute of the maintenance window.

GetFlexibleServerStorage

AutoGrowEnabled This property is required. bool
Is Storage Auto Grow enabled?
IoScalingEnabled This property is required. bool
Should IOPS be scaled automatically?
Iops This property is required. int
The storage IOPS of the MySQL Flexible Server.
SizeGb This property is required. int
The max storage allowed for the MySQL Flexible Server.
AutoGrowEnabled This property is required. bool
Is Storage Auto Grow enabled?
IoScalingEnabled This property is required. bool
Should IOPS be scaled automatically?
Iops This property is required. int
The storage IOPS of the MySQL Flexible Server.
SizeGb This property is required. int
The max storage allowed for the MySQL Flexible Server.
autoGrowEnabled This property is required. Boolean
Is Storage Auto Grow enabled?
ioScalingEnabled This property is required. Boolean
Should IOPS be scaled automatically?
iops This property is required. Integer
The storage IOPS of the MySQL Flexible Server.
sizeGb This property is required. Integer
The max storage allowed for the MySQL Flexible Server.
autoGrowEnabled This property is required. boolean
Is Storage Auto Grow enabled?
ioScalingEnabled This property is required. boolean
Should IOPS be scaled automatically?
iops This property is required. number
The storage IOPS of the MySQL Flexible Server.
sizeGb This property is required. number
The max storage allowed for the MySQL Flexible Server.
auto_grow_enabled This property is required. bool
Is Storage Auto Grow enabled?
io_scaling_enabled This property is required. bool
Should IOPS be scaled automatically?
iops This property is required. int
The storage IOPS of the MySQL Flexible Server.
size_gb This property is required. int
The max storage allowed for the MySQL Flexible Server.
autoGrowEnabled This property is required. Boolean
Is Storage Auto Grow enabled?
ioScalingEnabled This property is required. Boolean
Should IOPS be scaled automatically?
iops This property is required. Number
The storage IOPS of the MySQL Flexible Server.
sizeGb This property is required. Number
The max storage allowed for the MySQL Flexible Server.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi