1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DatabaseManagement
  5. ExternalMySqlDatabase
Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi

oci.DatabaseManagement.ExternalMySqlDatabase

Explore with Pulumi AI

This resource provides the External My Sql Database resource in Oracle Cloud Infrastructure Database Management service.

Creates an external MySQL database.

Example Usage

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

const testExternalMySqlDatabase = new oci.databasemanagement.ExternalMySqlDatabase("test_external_my_sql_database", {
    compartmentId: compartmentId,
    dbName: externalMySqlDatabaseDbName,
});
Copy
import pulumi
import pulumi_oci as oci

test_external_my_sql_database = oci.database_management.ExternalMySqlDatabase("test_external_my_sql_database",
    compartment_id=compartment_id,
    db_name=external_my_sql_database_db_name)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/databasemanagement"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := databasemanagement.NewExternalMySqlDatabase(ctx, "test_external_my_sql_database", &databasemanagement.ExternalMySqlDatabaseArgs{
			CompartmentId: pulumi.Any(compartmentId),
			DbName:        pulumi.Any(externalMySqlDatabaseDbName),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testExternalMySqlDatabase = new Oci.DatabaseManagement.ExternalMySqlDatabase("test_external_my_sql_database", new()
    {
        CompartmentId = compartmentId,
        DbName = externalMySqlDatabaseDbName,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.DatabaseManagement.ExternalMySqlDatabase;
import com.pulumi.oci.DatabaseManagement.ExternalMySqlDatabaseArgs;
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) {
        var testExternalMySqlDatabase = new ExternalMySqlDatabase("testExternalMySqlDatabase", ExternalMySqlDatabaseArgs.builder()
            .compartmentId(compartmentId)
            .dbName(externalMySqlDatabaseDbName)
            .build());

    }
}
Copy
resources:
  testExternalMySqlDatabase:
    type: oci:DatabaseManagement:ExternalMySqlDatabase
    name: test_external_my_sql_database
    properties:
      compartmentId: ${compartmentId}
      dbName: ${externalMySqlDatabaseDbName}
Copy

Create ExternalMySqlDatabase Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ExternalMySqlDatabase(name: string, args: ExternalMySqlDatabaseArgs, opts?: CustomResourceOptions);
@overload
def ExternalMySqlDatabase(resource_name: str,
                          args: ExternalMySqlDatabaseArgs,
                          opts: Optional[ResourceOptions] = None)

@overload
def ExternalMySqlDatabase(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          compartment_id: Optional[str] = None,
                          db_name: Optional[str] = None)
func NewExternalMySqlDatabase(ctx *Context, name string, args ExternalMySqlDatabaseArgs, opts ...ResourceOption) (*ExternalMySqlDatabase, error)
public ExternalMySqlDatabase(string name, ExternalMySqlDatabaseArgs args, CustomResourceOptions? opts = null)
public ExternalMySqlDatabase(String name, ExternalMySqlDatabaseArgs args)
public ExternalMySqlDatabase(String name, ExternalMySqlDatabaseArgs args, CustomResourceOptions options)
type: oci:DatabaseManagement:ExternalMySqlDatabase
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ExternalMySqlDatabaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ExternalMySqlDatabaseArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ExternalMySqlDatabaseArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ExternalMySqlDatabaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ExternalMySqlDatabaseArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var externalMySqlDatabaseResource = new Oci.DatabaseManagement.ExternalMySqlDatabase("externalMySqlDatabaseResource", new()
{
    CompartmentId = "string",
    DbName = "string",
});
Copy
example, err := databasemanagement.NewExternalMySqlDatabase(ctx, "externalMySqlDatabaseResource", &databasemanagement.ExternalMySqlDatabaseArgs{
	CompartmentId: pulumi.String("string"),
	DbName:        pulumi.String("string"),
})
Copy
var externalMySqlDatabaseResource = new ExternalMySqlDatabase("externalMySqlDatabaseResource", ExternalMySqlDatabaseArgs.builder()
    .compartmentId("string")
    .dbName("string")
    .build());
Copy
external_my_sql_database_resource = oci.database_management.ExternalMySqlDatabase("externalMySqlDatabaseResource",
    compartment_id="string",
    db_name="string")
Copy
const externalMySqlDatabaseResource = new oci.databasemanagement.ExternalMySqlDatabase("externalMySqlDatabaseResource", {
    compartmentId: "string",
    dbName: "string",
});
Copy
type: oci:DatabaseManagement:ExternalMySqlDatabase
properties:
    compartmentId: string
    dbName: string
Copy

ExternalMySqlDatabase Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ExternalMySqlDatabase resource accepts the following input properties:

CompartmentId
This property is required.
Changes to this property will trigger replacement.
string
OCID of compartment for the External MySQL Database.
DbName This property is required. string

(Updatable) Name of the External MySQL Database.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

CompartmentId
This property is required.
Changes to this property will trigger replacement.
string
OCID of compartment for the External MySQL Database.
DbName This property is required. string

(Updatable) Name of the External MySQL Database.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartmentId
This property is required.
Changes to this property will trigger replacement.
String
OCID of compartment for the External MySQL Database.
dbName This property is required. String

(Updatable) Name of the External MySQL Database.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartmentId
This property is required.
Changes to this property will trigger replacement.
string
OCID of compartment for the External MySQL Database.
dbName This property is required. string

(Updatable) Name of the External MySQL Database.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartment_id
This property is required.
Changes to this property will trigger replacement.
str
OCID of compartment for the External MySQL Database.
db_name This property is required. str

(Updatable) Name of the External MySQL Database.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartmentId
This property is required.
Changes to this property will trigger replacement.
String
OCID of compartment for the External MySQL Database.
dbName This property is required. String

(Updatable) Name of the External MySQL Database.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Outputs

All input properties are implicitly available as output properties. Additionally, the ExternalMySqlDatabase resource produces the following output properties:

ExternalDatabaseId string
OCID of External MySQL Database.
Id string
The provider-assigned unique ID for this managed resource.
ExternalDatabaseId string
OCID of External MySQL Database.
Id string
The provider-assigned unique ID for this managed resource.
externalDatabaseId String
OCID of External MySQL Database.
id String
The provider-assigned unique ID for this managed resource.
externalDatabaseId string
OCID of External MySQL Database.
id string
The provider-assigned unique ID for this managed resource.
external_database_id str
OCID of External MySQL Database.
id str
The provider-assigned unique ID for this managed resource.
externalDatabaseId String
OCID of External MySQL Database.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ExternalMySqlDatabase Resource

Get an existing ExternalMySqlDatabase resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ExternalMySqlDatabaseState, opts?: CustomResourceOptions): ExternalMySqlDatabase
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        compartment_id: Optional[str] = None,
        db_name: Optional[str] = None,
        external_database_id: Optional[str] = None) -> ExternalMySqlDatabase
func GetExternalMySqlDatabase(ctx *Context, name string, id IDInput, state *ExternalMySqlDatabaseState, opts ...ResourceOption) (*ExternalMySqlDatabase, error)
public static ExternalMySqlDatabase Get(string name, Input<string> id, ExternalMySqlDatabaseState? state, CustomResourceOptions? opts = null)
public static ExternalMySqlDatabase get(String name, Output<String> id, ExternalMySqlDatabaseState state, CustomResourceOptions options)
resources:  _:    type: oci:DatabaseManagement:ExternalMySqlDatabase    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CompartmentId Changes to this property will trigger replacement. string
OCID of compartment for the External MySQL Database.
DbName string

(Updatable) Name of the External MySQL Database.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

ExternalDatabaseId string
OCID of External MySQL Database.
CompartmentId Changes to this property will trigger replacement. string
OCID of compartment for the External MySQL Database.
DbName string

(Updatable) Name of the External MySQL Database.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

ExternalDatabaseId string
OCID of External MySQL Database.
compartmentId Changes to this property will trigger replacement. String
OCID of compartment for the External MySQL Database.
dbName String

(Updatable) Name of the External MySQL Database.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

externalDatabaseId String
OCID of External MySQL Database.
compartmentId Changes to this property will trigger replacement. string
OCID of compartment for the External MySQL Database.
dbName string

(Updatable) Name of the External MySQL Database.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

externalDatabaseId string
OCID of External MySQL Database.
compartment_id Changes to this property will trigger replacement. str
OCID of compartment for the External MySQL Database.
db_name str

(Updatable) Name of the External MySQL Database.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

external_database_id str
OCID of External MySQL Database.
compartmentId Changes to this property will trigger replacement. String
OCID of compartment for the External MySQL Database.
dbName String

(Updatable) Name of the External MySQL Database.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

externalDatabaseId String
OCID of External MySQL Database.

Import

ExternalMySqlDatabases can be imported using the id, e.g.

$ pulumi import oci:DatabaseManagement/externalMySqlDatabase:ExternalMySqlDatabase test_external_my_sql_database "id"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.