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,
});
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)
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
	})
}
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,
    });
});
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());
    }
}
resources:
  testExternalMySqlDatabase:
    type: oci:DatabaseManagement:ExternalMySqlDatabase
    name: test_external_my_sql_database
    properties:
      compartmentId: ${compartmentId}
      dbName: ${externalMySqlDatabaseDbName}
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 string
- The unique name of the resource.
- args ExternalMySqlDatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args ExternalMySqlDatabaseArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExternalMySqlDatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
example, err := databasemanagement.NewExternalMySqlDatabase(ctx, "externalMySqlDatabaseResource", &databasemanagement.ExternalMySqlDatabaseArgs{
	CompartmentId: pulumi.String("string"),
	DbName:        pulumi.String("string"),
})
var externalMySqlDatabaseResource = new ExternalMySqlDatabase("externalMySqlDatabaseResource", ExternalMySqlDatabaseArgs.builder()
    .compartmentId("string")
    .dbName("string")
    .build());
external_my_sql_database_resource = oci.database_management.ExternalMySqlDatabase("externalMySqlDatabaseResource",
    compartment_id="string",
    db_name="string")
const externalMySqlDatabaseResource = new oci.databasemanagement.ExternalMySqlDatabase("externalMySqlDatabaseResource", {
    compartmentId: "string",
    dbName: "string",
});
type: oci:DatabaseManagement:ExternalMySqlDatabase
properties:
    compartmentId: string
    dbName: string
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 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 
- CompartmentId 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 
- compartmentId 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 
- compartmentId 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 
- compartment_id 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 
- compartmentId 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 
Outputs
All input properties are implicitly available as output properties. Additionally, the ExternalMySqlDatabase resource produces the following output properties:
- ExternalDatabase stringId 
- OCID of External MySQL Database.
- Id string
- The provider-assigned unique ID for this managed resource.
- ExternalDatabase stringId 
- OCID of External MySQL Database.
- Id string
- The provider-assigned unique ID for this managed resource.
- externalDatabase StringId 
- OCID of External MySQL Database.
- id String
- The provider-assigned unique ID for this managed resource.
- externalDatabase stringId 
- OCID of External MySQL Database.
- id string
- The provider-assigned unique ID for this managed resource.
- external_database_ strid 
- OCID of External MySQL Database.
- id str
- The provider-assigned unique ID for this managed resource.
- externalDatabase StringId 
- 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) -> ExternalMySqlDatabasefunc 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- CompartmentId 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 
- ExternalDatabase stringId 
- OCID of External MySQL Database.
- CompartmentId 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 
- ExternalDatabase stringId 
- OCID of External MySQL Database.
- compartmentId 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 
- externalDatabase StringId 
- OCID of External MySQL Database.
- compartmentId 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 
- externalDatabase stringId 
- OCID of External MySQL Database.
- compartment_id 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_ strid 
- OCID of External MySQL Database.
- compartmentId 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 
- externalDatabase StringId 
- 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"
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 ociTerraform Provider.