1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. DbCredential
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.Identity.DbCredential

Explore with Pulumi AI

This resource provides the Db Credential resource in Oracle Cloud Infrastructure Identity service.

Creates a new DB credential for the specified user.

Example Usage

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

const testDbCredential = new oci.identity.DbCredential("test_db_credential", {
    description: dbCredentialDescription,
    password: dbCredentialPassword,
    userId: testUser.id,
});
Copy
import pulumi
import pulumi_oci as oci

test_db_credential = oci.identity.DbCredential("test_db_credential",
    description=db_credential_description,
    password=db_credential_password,
    user_id=test_user["id"])
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := identity.NewDbCredential(ctx, "test_db_credential", &identity.DbCredentialArgs{
			Description: pulumi.Any(dbCredentialDescription),
			Password:    pulumi.Any(dbCredentialPassword),
			UserId:      pulumi.Any(testUser.Id),
		})
		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 testDbCredential = new Oci.Identity.DbCredential("test_db_credential", new()
    {
        Description = dbCredentialDescription,
        Password = dbCredentialPassword,
        UserId = testUser.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Identity.DbCredential;
import com.pulumi.oci.Identity.DbCredentialArgs;
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 testDbCredential = new DbCredential("testDbCredential", DbCredentialArgs.builder()
            .description(dbCredentialDescription)
            .password(dbCredentialPassword)
            .userId(testUser.id())
            .build());

    }
}
Copy
resources:
  testDbCredential:
    type: oci:Identity:DbCredential
    name: test_db_credential
    properties:
      description: ${dbCredentialDescription}
      password: ${dbCredentialPassword}
      userId: ${testUser.id}
Copy

Create DbCredential Resource

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

Constructor syntax

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

@overload
def DbCredential(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 description: Optional[str] = None,
                 password: Optional[str] = None,
                 user_id: Optional[str] = None)
func NewDbCredential(ctx *Context, name string, args DbCredentialArgs, opts ...ResourceOption) (*DbCredential, error)
public DbCredential(string name, DbCredentialArgs args, CustomResourceOptions? opts = null)
public DbCredential(String name, DbCredentialArgs args)
public DbCredential(String name, DbCredentialArgs args, CustomResourceOptions options)
type: oci:Identity:DbCredential
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. DbCredentialArgs
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. DbCredentialArgs
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. DbCredentialArgs
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. DbCredentialArgs
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. DbCredentialArgs
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 dbCredentialResource = new Oci.Identity.DbCredential("dbCredentialResource", new()
{
    Description = "string",
    Password = "string",
    UserId = "string",
});
Copy
example, err := Identity.NewDbCredential(ctx, "dbCredentialResource", &Identity.DbCredentialArgs{
	Description: pulumi.String("string"),
	Password:    pulumi.String("string"),
	UserId:      pulumi.String("string"),
})
Copy
var dbCredentialResource = new DbCredential("dbCredentialResource", DbCredentialArgs.builder()
    .description("string")
    .password("string")
    .userId("string")
    .build());
Copy
db_credential_resource = oci.identity.DbCredential("dbCredentialResource",
    description="string",
    password="string",
    user_id="string")
Copy
const dbCredentialResource = new oci.identity.DbCredential("dbCredentialResource", {
    description: "string",
    password: "string",
    userId: "string",
});
Copy
type: oci:Identity:DbCredential
properties:
    description: string
    password: string
    userId: string
Copy

DbCredential 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 DbCredential resource accepts the following input properties:

Description
This property is required.
Changes to this property will trigger replacement.
string
The description you assign to the DB credentials during creation.
Password
This property is required.
Changes to this property will trigger replacement.
string
The password for the DB credentials during creation.
UserId
This property is required.
Changes to this property will trigger replacement.
string

The OCID of the user.

** 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

Description
This property is required.
Changes to this property will trigger replacement.
string
The description you assign to the DB credentials during creation.
Password
This property is required.
Changes to this property will trigger replacement.
string
The password for the DB credentials during creation.
UserId
This property is required.
Changes to this property will trigger replacement.
string

The OCID of the user.

** 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

description
This property is required.
Changes to this property will trigger replacement.
String
The description you assign to the DB credentials during creation.
password
This property is required.
Changes to this property will trigger replacement.
String
The password for the DB credentials during creation.
userId
This property is required.
Changes to this property will trigger replacement.
String

The OCID of the user.

** 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

description
This property is required.
Changes to this property will trigger replacement.
string
The description you assign to the DB credentials during creation.
password
This property is required.
Changes to this property will trigger replacement.
string
The password for the DB credentials during creation.
userId
This property is required.
Changes to this property will trigger replacement.
string

The OCID of the user.

** 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

description
This property is required.
Changes to this property will trigger replacement.
str
The description you assign to the DB credentials during creation.
password
This property is required.
Changes to this property will trigger replacement.
str
The password for the DB credentials during creation.
user_id
This property is required.
Changes to this property will trigger replacement.
str

The OCID of the user.

** 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

description
This property is required.
Changes to this property will trigger replacement.
String
The description you assign to the DB credentials during creation.
password
This property is required.
Changes to this property will trigger replacement.
String
The password for the DB credentials during creation.
userId
This property is required.
Changes to this property will trigger replacement.
String

The OCID of the user.

** 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 DbCredential resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
LifecycleDetails string
The detailed status of INACTIVE lifecycleState.
State string
The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
TimeCreated string
Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
TimeExpires string
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
Id string
The provider-assigned unique ID for this managed resource.
LifecycleDetails string
The detailed status of INACTIVE lifecycleState.
State string
The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
TimeCreated string
Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
TimeExpires string
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
id String
The provider-assigned unique ID for this managed resource.
lifecycleDetails String
The detailed status of INACTIVE lifecycleState.
state String
The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
timeCreated String
Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpires String
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
id string
The provider-assigned unique ID for this managed resource.
lifecycleDetails string
The detailed status of INACTIVE lifecycleState.
state string
The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
timeCreated string
Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpires string
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
id str
The provider-assigned unique ID for this managed resource.
lifecycle_details str
The detailed status of INACTIVE lifecycleState.
state str
The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
time_created str
Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
time_expires str
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
id String
The provider-assigned unique ID for this managed resource.
lifecycleDetails String
The detailed status of INACTIVE lifecycleState.
state String
The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
timeCreated String
Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpires String
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z

Look up Existing DbCredential Resource

Get an existing DbCredential 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?: DbCredentialState, opts?: CustomResourceOptions): DbCredential
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        lifecycle_details: Optional[str] = None,
        password: Optional[str] = None,
        state: Optional[str] = None,
        time_created: Optional[str] = None,
        time_expires: Optional[str] = None,
        user_id: Optional[str] = None) -> DbCredential
func GetDbCredential(ctx *Context, name string, id IDInput, state *DbCredentialState, opts ...ResourceOption) (*DbCredential, error)
public static DbCredential Get(string name, Input<string> id, DbCredentialState? state, CustomResourceOptions? opts = null)
public static DbCredential get(String name, Output<String> id, DbCredentialState state, CustomResourceOptions options)
resources:  _:    type: oci:Identity:DbCredential    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:
Description Changes to this property will trigger replacement. string
The description you assign to the DB credentials during creation.
LifecycleDetails string
The detailed status of INACTIVE lifecycleState.
Password Changes to this property will trigger replacement. string
The password for the DB credentials during creation.
State string
The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
TimeCreated string
Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
TimeExpires string
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
UserId Changes to this property will trigger replacement. string

The OCID of the user.

** 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

Description Changes to this property will trigger replacement. string
The description you assign to the DB credentials during creation.
LifecycleDetails string
The detailed status of INACTIVE lifecycleState.
Password Changes to this property will trigger replacement. string
The password for the DB credentials during creation.
State string
The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
TimeCreated string
Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
TimeExpires string
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
UserId Changes to this property will trigger replacement. string

The OCID of the user.

** 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

description Changes to this property will trigger replacement. String
The description you assign to the DB credentials during creation.
lifecycleDetails String
The detailed status of INACTIVE lifecycleState.
password Changes to this property will trigger replacement. String
The password for the DB credentials during creation.
state String
The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
timeCreated String
Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpires String
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
userId Changes to this property will trigger replacement. String

The OCID of the user.

** 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

description Changes to this property will trigger replacement. string
The description you assign to the DB credentials during creation.
lifecycleDetails string
The detailed status of INACTIVE lifecycleState.
password Changes to this property will trigger replacement. string
The password for the DB credentials during creation.
state string
The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
timeCreated string
Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpires string
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
userId Changes to this property will trigger replacement. string

The OCID of the user.

** 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

description Changes to this property will trigger replacement. str
The description you assign to the DB credentials during creation.
lifecycle_details str
The detailed status of INACTIVE lifecycleState.
password Changes to this property will trigger replacement. str
The password for the DB credentials during creation.
state str
The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
time_created str
Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
time_expires str
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
user_id Changes to this property will trigger replacement. str

The OCID of the user.

** 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

description Changes to this property will trigger replacement. String
The description you assign to the DB credentials during creation.
lifecycleDetails String
The detailed status of INACTIVE lifecycleState.
password Changes to this property will trigger replacement. String
The password for the DB credentials during creation.
state String
The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
timeCreated String
Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpires String
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
userId Changes to this property will trigger replacement. String

The OCID of the user.

** 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

Import

Import is not supported for this resource.

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.