1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. dms
  5. getEnterpriseDatabases
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.dms.getEnterpriseDatabases

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides DMS Enterprise Database available to the user. What is Database.

    NOTE: Available since v1.195.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.dms.getEnterpriseDatabases({
        nameRegex: "test2",
        instanceId: "2195118",
    });
    export const alicloudDmsEnterpriseDatabaseExampleId = _default.then(_default => _default.databases?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.dms.get_enterprise_databases(name_regex="test2",
        instance_id="2195118")
    pulumi.export("alicloudDmsEnterpriseDatabaseExampleId", default.databases[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := dms.GetEnterpriseDatabases(ctx, &dms.GetEnterpriseDatabasesArgs{
    			NameRegex:  pulumi.StringRef("test2"),
    			InstanceId: "2195118",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("alicloudDmsEnterpriseDatabaseExampleId", _default.Databases[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Dms.GetEnterpriseDatabases.Invoke(new()
        {
            NameRegex = "test2",
            InstanceId = "2195118",
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudDmsEnterpriseDatabaseExampleId"] = @default.Apply(@default => @default.Apply(getEnterpriseDatabasesResult => getEnterpriseDatabasesResult.Databases[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.dms.DmsFunctions;
    import com.pulumi.alicloud.dms.inputs.GetEnterpriseDatabasesArgs;
    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 default = DmsFunctions.getEnterpriseDatabases(GetEnterpriseDatabasesArgs.builder()
                .nameRegex("test2")
                .instanceId("2195118")
                .build());
    
            ctx.export("alicloudDmsEnterpriseDatabaseExampleId", default_.databases()[0].id());
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:dms:getEnterpriseDatabases
          Arguments:
            nameRegex: test2
            instanceId: '2195118'
    outputs:
      alicloudDmsEnterpriseDatabaseExampleId: ${default.databases[0].id}
    

    Using getEnterpriseDatabases

    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 getEnterpriseDatabases(args: GetEnterpriseDatabasesArgs, opts?: InvokeOptions): Promise<GetEnterpriseDatabasesResult>
    function getEnterpriseDatabasesOutput(args: GetEnterpriseDatabasesOutputArgs, opts?: InvokeOptions): Output<GetEnterpriseDatabasesResult>
    def get_enterprise_databases(ids: Optional[Sequence[str]] = None,
                                 instance_id: Optional[str] = None,
                                 name_regex: Optional[str] = None,
                                 output_file: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetEnterpriseDatabasesResult
    def get_enterprise_databases_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                 instance_id: Optional[pulumi.Input[str]] = None,
                                 name_regex: Optional[pulumi.Input[str]] = None,
                                 output_file: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetEnterpriseDatabasesResult]
    func GetEnterpriseDatabases(ctx *Context, args *GetEnterpriseDatabasesArgs, opts ...InvokeOption) (*GetEnterpriseDatabasesResult, error)
    func GetEnterpriseDatabasesOutput(ctx *Context, args *GetEnterpriseDatabasesOutputArgs, opts ...InvokeOption) GetEnterpriseDatabasesResultOutput

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

    public static class GetEnterpriseDatabases 
    {
        public static Task<GetEnterpriseDatabasesResult> InvokeAsync(GetEnterpriseDatabasesArgs args, InvokeOptions? opts = null)
        public static Output<GetEnterpriseDatabasesResult> Invoke(GetEnterpriseDatabasesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetEnterpriseDatabasesResult> getEnterpriseDatabases(GetEnterpriseDatabasesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:dms/getEnterpriseDatabases:getEnterpriseDatabases
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    The instance ID of the target database.
    Ids List<string>
    A list of Database IDs.
    NameRegex string
    A regex string to filter the results by the database Schema Name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    InstanceId string
    The instance ID of the target database.
    Ids []string
    A list of Database IDs.
    NameRegex string
    A regex string to filter the results by the database Schema Name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    instanceId String
    The instance ID of the target database.
    ids List<String>
    A list of Database IDs.
    nameRegex String
    A regex string to filter the results by the database Schema Name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    instanceId string
    The instance ID of the target database.
    ids string[]
    A list of Database IDs.
    nameRegex string
    A regex string to filter the results by the database Schema Name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    instance_id str
    The instance ID of the target database.
    ids Sequence[str]
    A list of Database IDs.
    name_regex str
    A regex string to filter the results by the database Schema Name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    instanceId String
    The instance ID of the target database.
    ids List<String>
    A list of Database IDs.
    nameRegex String
    A regex string to filter the results by the database Schema Name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getEnterpriseDatabases Result

    The following output properties are available:

    Databases List<Pulumi.AliCloud.Dms.Outputs.GetEnterpriseDatabasesDatabase>
    A list of Database Entries. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of Database IDs.
    InstanceId string
    The instance ID of the target database.
    NameRegex string
    OutputFile string
    Databases []GetEnterpriseDatabasesDatabase
    A list of Database Entries. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Database IDs.
    InstanceId string
    The instance ID of the target database.
    NameRegex string
    OutputFile string
    databases List<GetEnterpriseDatabasesDatabase>
    A list of Database Entries. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Database IDs.
    instanceId String
    The instance ID of the target database.
    nameRegex String
    outputFile String
    databases GetEnterpriseDatabasesDatabase[]
    A list of Database Entries. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Database IDs.
    instanceId string
    The instance ID of the target database.
    nameRegex string
    outputFile string
    databases Sequence[GetEnterpriseDatabasesDatabase]
    A list of Database Entries. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Database IDs.
    instance_id str
    The instance ID of the target database.
    name_regex str
    output_file str
    databases List<Property Map>
    A list of Database Entries. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Database IDs.
    instanceId String
    The instance ID of the target database.
    nameRegex String
    outputFile String

    Supporting Types

    GetEnterpriseDatabasesDatabase

    CatalogName string
    The name of the Database Directory.> PG Series databases will display the database name.
    DatabaseId string
    The ID of the physical library.
    DbType string
    Database type.
    DbaId string
    The DBA user ID of the target database.
    DbaName string
    The DBA nickname of the target Library.
    Encoding string
    Database encoding.
    EnvType string
    The environment type of the database.
    Host string
    The database connection address.
    Id string
    The Database ID, same value as database_id.
    InstanceId string
    The instance ID of the target database.
    OwnerIdLists List<string>
    Library Owner User ID list.
    OwnerNameLists List<string>
    Library Owner nickname list.
    Port int
    The connection port of the database.
    SchemaName string
    The name of the database.> PG Series databases will display schema names.
    SearchName string
    Library search name.
    Sid string
    Database SID.> only Oracle Database Display.
    State string
    Library status, value description:-NORMAL: NORMAL-DISABLE: Disabled-OFFLINE: OFFLINE-NOT_EXIST: does not exist
    CatalogName string
    The name of the Database Directory.> PG Series databases will display the database name.
    DatabaseId string
    The ID of the physical library.
    DbType string
    Database type.
    DbaId string
    The DBA user ID of the target database.
    DbaName string
    The DBA nickname of the target Library.
    Encoding string
    Database encoding.
    EnvType string
    The environment type of the database.
    Host string
    The database connection address.
    Id string
    The Database ID, same value as database_id.
    InstanceId string
    The instance ID of the target database.
    OwnerIdLists []string
    Library Owner User ID list.
    OwnerNameLists []string
    Library Owner nickname list.
    Port int
    The connection port of the database.
    SchemaName string
    The name of the database.> PG Series databases will display schema names.
    SearchName string
    Library search name.
    Sid string
    Database SID.> only Oracle Database Display.
    State string
    Library status, value description:-NORMAL: NORMAL-DISABLE: Disabled-OFFLINE: OFFLINE-NOT_EXIST: does not exist
    catalogName String
    The name of the Database Directory.> PG Series databases will display the database name.
    databaseId String
    The ID of the physical library.
    dbType String
    Database type.
    dbaId String
    The DBA user ID of the target database.
    dbaName String
    The DBA nickname of the target Library.
    encoding String
    Database encoding.
    envType String
    The environment type of the database.
    host String
    The database connection address.
    id String
    The Database ID, same value as database_id.
    instanceId String
    The instance ID of the target database.
    ownerIdLists List<String>
    Library Owner User ID list.
    ownerNameLists List<String>
    Library Owner nickname list.
    port Integer
    The connection port of the database.
    schemaName String
    The name of the database.> PG Series databases will display schema names.
    searchName String
    Library search name.
    sid String
    Database SID.> only Oracle Database Display.
    state String
    Library status, value description:-NORMAL: NORMAL-DISABLE: Disabled-OFFLINE: OFFLINE-NOT_EXIST: does not exist
    catalogName string
    The name of the Database Directory.> PG Series databases will display the database name.
    databaseId string
    The ID of the physical library.
    dbType string
    Database type.
    dbaId string
    The DBA user ID of the target database.
    dbaName string
    The DBA nickname of the target Library.
    encoding string
    Database encoding.
    envType string
    The environment type of the database.
    host string
    The database connection address.
    id string
    The Database ID, same value as database_id.
    instanceId string
    The instance ID of the target database.
    ownerIdLists string[]
    Library Owner User ID list.
    ownerNameLists string[]
    Library Owner nickname list.
    port number
    The connection port of the database.
    schemaName string
    The name of the database.> PG Series databases will display schema names.
    searchName string
    Library search name.
    sid string
    Database SID.> only Oracle Database Display.
    state string
    Library status, value description:-NORMAL: NORMAL-DISABLE: Disabled-OFFLINE: OFFLINE-NOT_EXIST: does not exist
    catalog_name str
    The name of the Database Directory.> PG Series databases will display the database name.
    database_id str
    The ID of the physical library.
    db_type str
    Database type.
    dba_id str
    The DBA user ID of the target database.
    dba_name str
    The DBA nickname of the target Library.
    encoding str
    Database encoding.
    env_type str
    The environment type of the database.
    host str
    The database connection address.
    id str
    The Database ID, same value as database_id.
    instance_id str
    The instance ID of the target database.
    owner_id_lists Sequence[str]
    Library Owner User ID list.
    owner_name_lists Sequence[str]
    Library Owner nickname list.
    port int
    The connection port of the database.
    schema_name str
    The name of the database.> PG Series databases will display schema names.
    search_name str
    Library search name.
    sid str
    Database SID.> only Oracle Database Display.
    state str
    Library status, value description:-NORMAL: NORMAL-DISABLE: Disabled-OFFLINE: OFFLINE-NOT_EXIST: does not exist
    catalogName String
    The name of the Database Directory.> PG Series databases will display the database name.
    databaseId String
    The ID of the physical library.
    dbType String
    Database type.
    dbaId String
    The DBA user ID of the target database.
    dbaName String
    The DBA nickname of the target Library.
    encoding String
    Database encoding.
    envType String
    The environment type of the database.
    host String
    The database connection address.
    id String
    The Database ID, same value as database_id.
    instanceId String
    The instance ID of the target database.
    ownerIdLists List<String>
    Library Owner User ID list.
    ownerNameLists List<String>
    Library Owner nickname list.
    port Number
    The connection port of the database.
    schemaName String
    The name of the database.> PG Series databases will display schema names.
    searchName String
    Library search name.
    sid String
    Database SID.> only Oracle Database Display.
    state String
    Library status, value description:-NORMAL: NORMAL-DISABLE: Disabled-OFFLINE: OFFLINE-NOT_EXIST: does not exist

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi