1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Database
  5. getManagedPreferredCredential
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.Database.getManagedPreferredCredential

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides details about a specific Managed Database Preferred Credential resource in Oracle Cloud Infrastructure Database Management service.

    Gets the preferred credential details for a Managed Database based on credentialName.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testManagedDatabasePreferredCredential = oci.Database.getManagedPreferredCredential({
        credentialName: managedDatabasePreferredCredentialCredentialName,
        managedDatabaseId: testManagedDatabase.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_managed_database_preferred_credential = oci.Database.get_managed_preferred_credential(credential_name=managed_database_preferred_credential_credential_name,
        managed_database_id=test_managed_database["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Database"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Database.GetManagedPreferredCredential(ctx, &database.GetManagedPreferredCredentialArgs{
    			CredentialName:    managedDatabasePreferredCredentialCredentialName,
    			ManagedDatabaseId: testManagedDatabase.Id,
    		}, 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 testManagedDatabasePreferredCredential = Oci.Database.GetManagedPreferredCredential.Invoke(new()
        {
            CredentialName = managedDatabasePreferredCredentialCredentialName,
            ManagedDatabaseId = testManagedDatabase.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Database.DatabaseFunctions;
    import com.pulumi.oci.Database.inputs.GetManagedPreferredCredentialArgs;
    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 testManagedDatabasePreferredCredential = DatabaseFunctions.getManagedPreferredCredential(GetManagedPreferredCredentialArgs.builder()
                .credentialName(managedDatabasePreferredCredentialCredentialName)
                .managedDatabaseId(testManagedDatabase.id())
                .build());
    
        }
    }
    
    variables:
      testManagedDatabasePreferredCredential:
        fn::invoke:
          Function: oci:Database:getManagedPreferredCredential
          Arguments:
            credentialName: ${managedDatabasePreferredCredentialCredentialName}
            managedDatabaseId: ${testManagedDatabase.id}
    

    Using getManagedPreferredCredential

    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 getManagedPreferredCredential(args: GetManagedPreferredCredentialArgs, opts?: InvokeOptions): Promise<GetManagedPreferredCredentialResult>
    function getManagedPreferredCredentialOutput(args: GetManagedPreferredCredentialOutputArgs, opts?: InvokeOptions): Output<GetManagedPreferredCredentialResult>
    def get_managed_preferred_credential(credential_name: Optional[str] = None,
                                         managed_database_id: Optional[str] = None,
                                         named_credential_id: Optional[str] = None,
                                         opts: Optional[InvokeOptions] = None) -> GetManagedPreferredCredentialResult
    def get_managed_preferred_credential_output(credential_name: Optional[pulumi.Input[str]] = None,
                                         managed_database_id: Optional[pulumi.Input[str]] = None,
                                         named_credential_id: Optional[pulumi.Input[str]] = None,
                                         opts: Optional[InvokeOptions] = None) -> Output[GetManagedPreferredCredentialResult]
    func GetManagedPreferredCredential(ctx *Context, args *GetManagedPreferredCredentialArgs, opts ...InvokeOption) (*GetManagedPreferredCredentialResult, error)
    func GetManagedPreferredCredentialOutput(ctx *Context, args *GetManagedPreferredCredentialOutputArgs, opts ...InvokeOption) GetManagedPreferredCredentialResultOutput

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

    public static class GetManagedPreferredCredential 
    {
        public static Task<GetManagedPreferredCredentialResult> InvokeAsync(GetManagedPreferredCredentialArgs args, InvokeOptions? opts = null)
        public static Output<GetManagedPreferredCredentialResult> Invoke(GetManagedPreferredCredentialInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetManagedPreferredCredentialResult> getManagedPreferredCredential(GetManagedPreferredCredentialArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Database/getManagedPreferredCredential:getManagedPreferredCredential
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CredentialName string
    The name of the preferred credential.
    ManagedDatabaseId string
    The OCID of the Managed Database.
    NamedCredentialId string
    The OCID of the Named Credential that contains the database user password metadata.
    CredentialName string
    The name of the preferred credential.
    ManagedDatabaseId string
    The OCID of the Managed Database.
    NamedCredentialId string
    The OCID of the Named Credential that contains the database user password metadata.
    credentialName String
    The name of the preferred credential.
    managedDatabaseId String
    The OCID of the Managed Database.
    namedCredentialId String
    The OCID of the Named Credential that contains the database user password metadata.
    credentialName string
    The name of the preferred credential.
    managedDatabaseId string
    The OCID of the Managed Database.
    namedCredentialId string
    The OCID of the Named Credential that contains the database user password metadata.
    credential_name str
    The name of the preferred credential.
    managed_database_id str
    The OCID of the Managed Database.
    named_credential_id str
    The OCID of the Named Credential that contains the database user password metadata.
    credentialName String
    The name of the preferred credential.
    managedDatabaseId String
    The OCID of the Managed Database.
    namedCredentialId String
    The OCID of the Named Credential that contains the database user password metadata.

    getManagedPreferredCredential Result

    The following output properties are available:

    CredentialName string
    The name of the preferred credential.
    Id string
    The provider-assigned unique ID for this managed resource.
    IsAccessible bool
    Indicates whether the preferred credential is accessible.
    ManagedDatabaseId string
    NamedCredentialId string
    The OCID of the Named Credential that contains the database user password metadata.
    PasswordSecretId string
    The OCID of the Vault service secret that contains the database user password.
    Role string
    The role of the database user.
    Status string
    The status of the preferred credential.
    Type string
    The type of preferred credential. Only 'BASIC' is supported currently.
    UserName string
    The user name used to connect to the database.
    CredentialName string
    The name of the preferred credential.
    Id string
    The provider-assigned unique ID for this managed resource.
    IsAccessible bool
    Indicates whether the preferred credential is accessible.
    ManagedDatabaseId string
    NamedCredentialId string
    The OCID of the Named Credential that contains the database user password metadata.
    PasswordSecretId string
    The OCID of the Vault service secret that contains the database user password.
    Role string
    The role of the database user.
    Status string
    The status of the preferred credential.
    Type string
    The type of preferred credential. Only 'BASIC' is supported currently.
    UserName string
    The user name used to connect to the database.
    credentialName String
    The name of the preferred credential.
    id String
    The provider-assigned unique ID for this managed resource.
    isAccessible Boolean
    Indicates whether the preferred credential is accessible.
    managedDatabaseId String
    namedCredentialId String
    The OCID of the Named Credential that contains the database user password metadata.
    passwordSecretId String
    The OCID of the Vault service secret that contains the database user password.
    role String
    The role of the database user.
    status String
    The status of the preferred credential.
    type String
    The type of preferred credential. Only 'BASIC' is supported currently.
    userName String
    The user name used to connect to the database.
    credentialName string
    The name of the preferred credential.
    id string
    The provider-assigned unique ID for this managed resource.
    isAccessible boolean
    Indicates whether the preferred credential is accessible.
    managedDatabaseId string
    namedCredentialId string
    The OCID of the Named Credential that contains the database user password metadata.
    passwordSecretId string
    The OCID of the Vault service secret that contains the database user password.
    role string
    The role of the database user.
    status string
    The status of the preferred credential.
    type string
    The type of preferred credential. Only 'BASIC' is supported currently.
    userName string
    The user name used to connect to the database.
    credential_name str
    The name of the preferred credential.
    id str
    The provider-assigned unique ID for this managed resource.
    is_accessible bool
    Indicates whether the preferred credential is accessible.
    managed_database_id str
    named_credential_id str
    The OCID of the Named Credential that contains the database user password metadata.
    password_secret_id str
    The OCID of the Vault service secret that contains the database user password.
    role str
    The role of the database user.
    status str
    The status of the preferred credential.
    type str
    The type of preferred credential. Only 'BASIC' is supported currently.
    user_name str
    The user name used to connect to the database.
    credentialName String
    The name of the preferred credential.
    id String
    The provider-assigned unique ID for this managed resource.
    isAccessible Boolean
    Indicates whether the preferred credential is accessible.
    managedDatabaseId String
    namedCredentialId String
    The OCID of the Named Credential that contains the database user password metadata.
    passwordSecretId String
    The OCID of the Vault service secret that contains the database user password.
    role String
    The role of the database user.
    status String
    The status of the preferred credential.
    type String
    The type of preferred credential. Only 'BASIC' is supported currently.
    userName String
    The user name used to connect to the database.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi