Oracle Cloud Infrastructure v3.9.0 published on Wednesday, Sep 24, 2025 by Pulumi
oci.Mysql.getMysqlVersion
This data source provides the list of Mysql Versions in Oracle Cloud Infrastructure MySQL Database service.
Get a list of supported and available MySQL database major versions.
The list is sorted by version family.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testMysqlVersions = oci.Mysql.getMysqlVersion({
    compartmentId: compartmentId,
});
import pulumi
import pulumi_oci as oci
test_mysql_versions = oci.Mysql.get_mysql_version(compartment_id=compartment_id)
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v3/go/oci/mysql"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := mysql.GetMysqlVersion(ctx, &mysql.GetMysqlVersionArgs{
			CompartmentId: compartmentId,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testMysqlVersions = Oci.Mysql.GetMysqlVersion.Invoke(new()
    {
        CompartmentId = compartmentId,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Mysql.MysqlFunctions;
import com.pulumi.oci.Mysql.inputs.GetMysqlVersionArgs;
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 testMysqlVersions = MysqlFunctions.getMysqlVersion(GetMysqlVersionArgs.builder()
            .compartmentId(compartmentId)
            .build());
    }
}
variables:
  testMysqlVersions:
    fn::invoke:
      function: oci:Mysql:getMysqlVersion
      arguments:
        compartmentId: ${compartmentId}
Using getMysqlVersion
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 getMysqlVersion(args: GetMysqlVersionArgs, opts?: InvokeOptions): Promise<GetMysqlVersionResult>
function getMysqlVersionOutput(args: GetMysqlVersionOutputArgs, opts?: InvokeOptions): Output<GetMysqlVersionResult>def get_mysql_version(compartment_id: Optional[str] = None,
                      filters: Optional[Sequence[GetMysqlVersionFilter]] = None,
                      opts: Optional[InvokeOptions] = None) -> GetMysqlVersionResult
def get_mysql_version_output(compartment_id: Optional[pulumi.Input[str]] = None,
                      filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetMysqlVersionFilterArgs]]]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetMysqlVersionResult]func GetMysqlVersion(ctx *Context, args *GetMysqlVersionArgs, opts ...InvokeOption) (*GetMysqlVersionResult, error)
func GetMysqlVersionOutput(ctx *Context, args *GetMysqlVersionOutputArgs, opts ...InvokeOption) GetMysqlVersionResultOutput> Note: This function is named GetMysqlVersion in the Go SDK.
public static class GetMysqlVersion 
{
    public static Task<GetMysqlVersionResult> InvokeAsync(GetMysqlVersionArgs args, InvokeOptions? opts = null)
    public static Output<GetMysqlVersionResult> Invoke(GetMysqlVersionInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetMysqlVersionResult> getMysqlVersion(GetMysqlVersionArgs args, InvokeOptions options)
public static Output<GetMysqlVersionResult> getMysqlVersion(GetMysqlVersionArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Mysql/getMysqlVersion:getMysqlVersion
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CompartmentId string
- The compartment OCID.
- Filters
List<GetMysql Version Filter> 
- CompartmentId string
- The compartment OCID.
- Filters
[]GetMysql Version Filter 
- compartmentId String
- The compartment OCID.
- filters
List<GetVersion Filter> 
- compartmentId string
- The compartment OCID.
- filters
GetMysql Version Filter[] 
- compartment_id str
- The compartment OCID.
- filters
Sequence[GetMysql Version Filter] 
- compartmentId String
- The compartment OCID.
- filters List<Property Map>
getMysqlVersion Result
The following output properties are available:
- CompartmentId string
- Id string
- The provider-assigned unique ID for this managed resource.
- Versions
List<GetMysql Version Version> 
- The list of supported MySQL Versions.
- Filters
List<GetMysql Version Filter> 
- CompartmentId string
- Id string
- The provider-assigned unique ID for this managed resource.
- Versions
[]GetMysql Version Version 
- The list of supported MySQL Versions.
- Filters
[]GetMysql Version Filter 
- compartmentId String
- id String
- The provider-assigned unique ID for this managed resource.
- versions
List<GetVersion Version> 
- The list of supported MySQL Versions.
- filters
List<GetVersion Filter> 
- compartmentId string
- id string
- The provider-assigned unique ID for this managed resource.
- versions
GetMysql Version Version[] 
- The list of supported MySQL Versions.
- filters
GetMysql Version Filter[] 
- compartment_id str
- id str
- The provider-assigned unique ID for this managed resource.
- versions
Sequence[GetMysql Version Version] 
- The list of supported MySQL Versions.
- filters
Sequence[GetMysql Version Filter] 
- compartmentId String
- id String
- The provider-assigned unique ID for this managed resource.
- versions List<Property Map>
- The list of supported MySQL Versions.
- filters List<Property Map>
Supporting Types
GetMysqlVersionFilter   
GetMysqlVersionVersion   
- VersionFamily string
- A descriptive summary of a group of versions.
- Versions
List<GetMysql Version Version Version> 
- The list of supported MySQL Versions.
- VersionFamily string
- A descriptive summary of a group of versions.
- Versions
[]GetMysql Version Version Version 
- The list of supported MySQL Versions.
- versionFamily String
- A descriptive summary of a group of versions.
- versions
List<GetVersion Version Version> 
- The list of supported MySQL Versions.
- versionFamily string
- A descriptive summary of a group of versions.
- versions
GetMysql Version Version Version[] 
- The list of supported MySQL Versions.
- version_family str
- A descriptive summary of a group of versions.
- versions
Sequence[GetMysql Version Version Version] 
- The list of supported MySQL Versions.
- versionFamily String
- A descriptive summary of a group of versions.
- versions List<Property Map>
- The list of supported MySQL Versions.
GetMysqlVersionVersionVersion    
- Description string
- A link to a page describing the version.
- Version string
- The specific version identifier
- Description string
- A link to a page describing the version.
- Version string
- The specific version identifier
- description String
- A link to a page describing the version.
- version String
- The specific version identifier
- description string
- A link to a page describing the version.
- version string
- The specific version identifier
- description str
- A link to a page describing the version.
- version str
- The specific version identifier
- description String
- A link to a page describing the version.
- version String
- The specific version identifier
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.
