Oracle Cloud Infrastructure

v0.5.0 published on Monday, Sep 12, 2022 by Pulumi

getManagedPreferredCredential

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

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testManagedDatabasePreferredCredential = Oci.Database.GetManagedPreferredCredential.Invoke(new()
    {
        CredentialName = @var.Managed_database_preferred_credential_credential_name,
        ManagedDatabaseId = oci_database_management_managed_database.Test_managed_database.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/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:    _var.Managed_database_preferred_credential_credential_name,
			ManagedDatabaseId: oci_database_management_managed_database.Test_managed_database.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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(var_.managed_database_preferred_credential_credential_name())
            .managedDatabaseId(oci_database_management_managed_database.test_managed_database().id())
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_managed_database_preferred_credential = oci.Database.get_managed_preferred_credential(credential_name=var["managed_database_preferred_credential_credential_name"],
    managed_database_id=oci_database_management_managed_database["test_managed_database"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testManagedDatabasePreferredCredential = oci.Database.getManagedPreferredCredential({
    credentialName: _var.managed_database_preferred_credential_credential_name,
    managedDatabaseId: oci_database_management_managed_database.test_managed_database.id,
});
variables:
  testManagedDatabasePreferredCredential:
    Fn::Invoke:
      Function: oci:Database:getManagedPreferredCredential
      Arguments:
        credentialName: ${var.managed_database_preferred_credential_credential_name}
        managedDatabaseId: ${oci_database_management_managed_database.test_managed_database.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,
                                     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,
                                     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.

CredentialName string

The name of the preferred credential.

ManagedDatabaseId string

The OCID of the Managed Database.

credentialName String

The name of the preferred credential.

managedDatabaseId String

The OCID of the Managed Database.

credentialName string

The name of the preferred credential.

managedDatabaseId string

The OCID of the Managed Database.

credential_name str

The name of the preferred credential.

managed_database_id str

The OCID of the Managed Database.

credentialName String

The name of the preferred credential.

managedDatabaseId String

The OCID of the Managed Database.

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
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
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
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
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
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
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
https://github.com/pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.