We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.mysql.getFlexibleServer
Explore with Pulumi AI
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);
import pulumi
import pulumi_azure as azure
example = azure.mysql.get_flexible_server(name="existingMySqlFlexibleServer",
    resource_group_name="existingResGroup")
pulumi.export("id", example.id)
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
	})
}
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),
    };
});
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()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:mysql:getFlexibleServer
      arguments:
        name: existingMySqlFlexibleServer
        resourceGroupName: existingResGroup
outputs:
  id: ${example.id}
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>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]func LookupFlexibleServer(ctx *Context, args *LookupFlexibleServerArgs, opts ...InvokeOption) (*LookupFlexibleServerResult, error)
func LookupFlexibleServerOutput(ctx *Context, args *LookupFlexibleServerOutputArgs, opts ...InvokeOption) LookupFlexibleServerResultOutput> 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)
}public static CompletableFuture<GetFlexibleServerResult> getFlexibleServer(GetFlexibleServerArgs args, InvokeOptions options)
public static Output<GetFlexibleServerResult> getFlexibleServer(GetFlexibleServerArgs args, InvokeOptions options)
fn::invoke:
  function: azure:mysql/getFlexibleServer:getFlexibleServer
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- Specifies the name of the MySQL Flexible Server.
- ResourceGroup stringName 
- The name of the resource group for the MySQL Flexible Server.
- Name string
- Specifies the name of the MySQL Flexible Server.
- ResourceGroup stringName 
- The name of the resource group for the MySQL Flexible Server.
- name String
- Specifies the name of the MySQL Flexible Server.
- resourceGroup StringName 
- The name of the resource group for the MySQL Flexible Server.
- name string
- Specifies the name of the MySQL Flexible Server.
- resourceGroup stringName 
- The name of the resource group for the MySQL Flexible Server.
- name str
- Specifies the name of the MySQL Flexible Server.
- resource_group_ strname 
- The name of the resource group for the MySQL Flexible Server.
- name String
- Specifies the name of the MySQL Flexible Server.
- resourceGroup StringName 
- 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.
- BackupRetention intDays 
- The backup retention days of the MySQL Flexible Server.
- DelegatedSubnet stringId 
- 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.
- GeoRedundant boolBackup Enabled 
- Is geo redundant backup enabled?
- HighAvailabilities List<GetFlexible Server High Availability> 
- A high_availabilityblock 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<GetFlexible Server Maintenance Window> 
- A maintenance_windowblock for this MySQL Flexible Server as defined below.
- Name string
- PrivateDns stringZone Id 
- The ID of the Private DNS zone of the MySQL Flexible Server.
- PublicNetwork boolAccess Enabled 
- 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.
- ResourceGroup stringName 
- RestorePoint stringIn Time 
- SkuName string
- The SKU Name of the MySQL Flexible Server.
- Storages
List<GetFlexible Server Storage> 
- A storageblock for this MySQL Flexible Server as defined below.
- 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.
- BackupRetention intDays 
- The backup retention days of the MySQL Flexible Server.
- DelegatedSubnet stringId 
- 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.
- GeoRedundant boolBackup Enabled 
- Is geo redundant backup enabled?
- HighAvailabilities []GetFlexible Server High Availability 
- A high_availabilityblock 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 []GetFlexible Server Maintenance Window 
- A maintenance_windowblock for this MySQL Flexible Server as defined below.
- Name string
- PrivateDns stringZone Id 
- The ID of the Private DNS zone of the MySQL Flexible Server.
- PublicNetwork boolAccess Enabled 
- 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.
- ResourceGroup stringName 
- RestorePoint stringIn Time 
- SkuName string
- The SKU Name of the MySQL Flexible Server.
- Storages
[]GetFlexible Server Storage 
- A storageblock for this MySQL Flexible Server as defined below.
- 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.
- backupRetention IntegerDays 
- The backup retention days of the MySQL Flexible Server.
- delegatedSubnet StringId 
- 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.
- geoRedundant BooleanBackup Enabled 
- Is geo redundant backup enabled?
- highAvailabilities List<GetFlexible Server High Availability> 
- A high_availabilityblock 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<GetFlexible Server Maintenance Window> 
- A maintenance_windowblock for this MySQL Flexible Server as defined below.
- name String
- privateDns StringZone Id 
- The ID of the Private DNS zone of the MySQL Flexible Server.
- publicNetwork BooleanAccess Enabled 
- 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.
- resourceGroup StringName 
- restorePoint StringIn Time 
- skuName String
- The SKU Name of the MySQL Flexible Server.
- storages
List<GetFlexible Server Storage> 
- A storageblock for this MySQL Flexible Server as defined below.
- 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.
- backupRetention numberDays 
- The backup retention days of the MySQL Flexible Server.
- delegatedSubnet stringId 
- 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.
- geoRedundant booleanBackup Enabled 
- Is geo redundant backup enabled?
- highAvailabilities GetFlexible Server High Availability[] 
- A high_availabilityblock 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 GetFlexible Server Maintenance Window[] 
- A maintenance_windowblock for this MySQL Flexible Server as defined below.
- name string
- privateDns stringZone Id 
- The ID of the Private DNS zone of the MySQL Flexible Server.
- publicNetwork booleanAccess Enabled 
- 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.
- resourceGroup stringName 
- restorePoint stringIn Time 
- skuName string
- The SKU Name of the MySQL Flexible Server.
- storages
GetFlexible Server Storage[] 
- A storageblock for this MySQL Flexible Server as defined below.
- {[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_ intdays 
- The backup retention days of the MySQL Flexible Server.
- delegated_subnet_ strid 
- 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_ boolbackup_ enabled 
- Is geo redundant backup enabled?
- high_availabilities Sequence[GetFlexible Server High Availability] 
- A high_availabilityblock 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[GetFlexible Server Maintenance Window] 
- A maintenance_windowblock for this MySQL Flexible Server as defined below.
- name str
- private_dns_ strzone_ id 
- The ID of the Private DNS zone of the MySQL Flexible Server.
- public_network_ boolaccess_ enabled 
- 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_ strname 
- restore_point_ strin_ time 
- sku_name str
- The SKU Name of the MySQL Flexible Server.
- storages
Sequence[GetFlexible Server Storage] 
- A storageblock for this MySQL Flexible Server as defined below.
- 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.
- backupRetention NumberDays 
- The backup retention days of the MySQL Flexible Server.
- delegatedSubnet StringId 
- 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.
- geoRedundant BooleanBackup Enabled 
- Is geo redundant backup enabled?
- highAvailabilities List<Property Map>
- A high_availabilityblock 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_windowblock for this MySQL Flexible Server as defined below.
- name String
- privateDns StringZone Id 
- The ID of the Private DNS zone of the MySQL Flexible Server.
- publicNetwork BooleanAccess Enabled 
- 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.
- resourceGroup StringName 
- restorePoint StringIn Time 
- skuName String
- The SKU Name of the MySQL Flexible Server.
- storages List<Property Map>
- A storageblock for this MySQL Flexible Server as defined below.
- 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 string
- The high availability mode of the MySQL Flexible Server.
- StandbyAvailability stringZone 
- The availability zone of the standby Flexible Server.
- Mode string
- The high availability mode of the MySQL Flexible Server.
- StandbyAvailability stringZone 
- The availability zone of the standby Flexible Server.
- mode String
- The high availability mode of the MySQL Flexible Server.
- standbyAvailability StringZone 
- The availability zone of the standby Flexible Server.
- mode string
- The high availability mode of the MySQL Flexible Server.
- standbyAvailability stringZone 
- The availability zone of the standby Flexible Server.
- mode str
- The high availability mode of the MySQL Flexible Server.
- standby_availability_ strzone 
- The availability zone of the standby Flexible Server.
- mode String
- The high availability mode of the MySQL Flexible Server.
- standbyAvailability StringZone 
- The availability zone of the standby Flexible Server.
GetFlexibleServerMaintenanceWindow    
- DayOf intWeek 
- The day of week of the maintenance window.
- StartHour int
- The start hour of the maintenance window.
- StartMinute int
- The start minute of the maintenance window.
- DayOf intWeek 
- The day of week of the maintenance window.
- StartHour int
- The start hour of the maintenance window.
- StartMinute int
- The start minute of the maintenance window.
- dayOf IntegerWeek 
- The day of week of the maintenance window.
- startHour Integer
- The start hour of the maintenance window.
- startMinute Integer
- The start minute of the maintenance window.
- dayOf numberWeek 
- The day of week of the maintenance window.
- startHour number
- The start hour of the maintenance window.
- startMinute number
- The start minute of the maintenance window.
- day_of_ intweek 
- The day of week of the maintenance window.
- start_hour int
- The start hour of the maintenance window.
- start_minute int
- The start minute of the maintenance window.
- dayOf NumberWeek 
- The day of week of the maintenance window.
- startHour Number
- The start hour of the maintenance window.
- startMinute Number
- The start minute of the maintenance window.
GetFlexibleServerStorage   
- AutoGrow boolEnabled 
- Is Storage Auto Grow enabled?
- IoScaling boolEnabled 
- Should IOPS be scaled automatically?
- Iops int
- The storage IOPS of the MySQL Flexible Server.
- SizeGb int
- The max storage allowed for the MySQL Flexible Server.
- AutoGrow boolEnabled 
- Is Storage Auto Grow enabled?
- IoScaling boolEnabled 
- Should IOPS be scaled automatically?
- Iops int
- The storage IOPS of the MySQL Flexible Server.
- SizeGb int
- The max storage allowed for the MySQL Flexible Server.
- autoGrow BooleanEnabled 
- Is Storage Auto Grow enabled?
- ioScaling BooleanEnabled 
- Should IOPS be scaled automatically?
- iops Integer
- The storage IOPS of the MySQL Flexible Server.
- sizeGb Integer
- The max storage allowed for the MySQL Flexible Server.
- autoGrow booleanEnabled 
- Is Storage Auto Grow enabled?
- ioScaling booleanEnabled 
- Should IOPS be scaled automatically?
- iops number
- The storage IOPS of the MySQL Flexible Server.
- sizeGb number
- The max storage allowed for the MySQL Flexible Server.
- auto_grow_ boolenabled 
- Is Storage Auto Grow enabled?
- io_scaling_ boolenabled 
- Should IOPS be scaled automatically?
- iops int
- The storage IOPS of the MySQL Flexible Server.
- size_gb int
- The max storage allowed for the MySQL Flexible Server.
- autoGrow BooleanEnabled 
- Is Storage Auto Grow enabled?
- ioScaling BooleanEnabled 
- Should IOPS be scaled automatically?
- iops Number
- The storage IOPS of the MySQL Flexible Server.
- sizeGb 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 azurermTerraform Provider.