Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi
oci.Identity.getDbCredentials
Explore with Pulumi AI
This data source provides the list of Db Credentials in Oracle Cloud Infrastructure Identity service.
Lists the DB credentials for the specified user. The returned object contains the credential’s OCID
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testDbCredentials = oci.Identity.getDbCredentials({
userId: testUser.id,
name: dbCredentialName,
state: dbCredentialState,
});
import pulumi
import pulumi_oci as oci
test_db_credentials = oci.Identity.get_db_credentials(user_id=test_user["id"],
name=db_credential_name,
state=db_credential_state)
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.GetDbCredentials(ctx, &identity.GetDbCredentialsArgs{
UserId: testUser.Id,
Name: pulumi.StringRef(dbCredentialName),
State: pulumi.StringRef(dbCredentialState),
}, 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 testDbCredentials = Oci.Identity.GetDbCredentials.Invoke(new()
{
UserId = testUser.Id,
Name = dbCredentialName,
State = dbCredentialState,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Identity.IdentityFunctions;
import com.pulumi.oci.Identity.inputs.GetDbCredentialsArgs;
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 testDbCredentials = IdentityFunctions.getDbCredentials(GetDbCredentialsArgs.builder()
.userId(testUser.id())
.name(dbCredentialName)
.state(dbCredentialState)
.build());
}
}
variables:
testDbCredentials:
fn::invoke:
Function: oci:Identity:getDbCredentials
Arguments:
userId: ${testUser.id}
name: ${dbCredentialName}
state: ${dbCredentialState}
Using getDbCredentials
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 getDbCredentials(args: GetDbCredentialsArgs, opts?: InvokeOptions): Promise<GetDbCredentialsResult>
function getDbCredentialsOutput(args: GetDbCredentialsOutputArgs, opts?: InvokeOptions): Output<GetDbCredentialsResult>
def get_db_credentials(filters: Optional[Sequence[_identity.GetDbCredentialsFilter]] = None,
name: Optional[str] = None,
state: Optional[str] = None,
user_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDbCredentialsResult
def get_db_credentials_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[_identity.GetDbCredentialsFilterArgs]]]] = None,
name: Optional[pulumi.Input[str]] = None,
state: Optional[pulumi.Input[str]] = None,
user_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDbCredentialsResult]
func GetDbCredentials(ctx *Context, args *GetDbCredentialsArgs, opts ...InvokeOption) (*GetDbCredentialsResult, error)
func GetDbCredentialsOutput(ctx *Context, args *GetDbCredentialsOutputArgs, opts ...InvokeOption) GetDbCredentialsResultOutput
> Note: This function is named GetDbCredentials
in the Go SDK.
public static class GetDbCredentials
{
public static Task<GetDbCredentialsResult> InvokeAsync(GetDbCredentialsArgs args, InvokeOptions? opts = null)
public static Output<GetDbCredentialsResult> Invoke(GetDbCredentialsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDbCredentialsResult> getDbCredentials(GetDbCredentialsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: oci:Identity/getDbCredentials:getDbCredentials
arguments:
# arguments dictionary
The following arguments are supported:
- User
Id string - The OCID of the user.
- Filters
List<Get
Db Credentials Filter> - Name string
- A filter to only return resources that match the given name exactly.
- State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- User
Id string - The OCID of the user.
- Filters
[]Get
Db Credentials Filter - Name string
- A filter to only return resources that match the given name exactly.
- State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- user
Id String - The OCID of the user.
- filters
List<Get
Db Credentials Filter> - name String
- A filter to only return resources that match the given name exactly.
- state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- user
Id string - The OCID of the user.
- filters
Get
Db Credentials Filter[] - name string
- A filter to only return resources that match the given name exactly.
- state string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- user_
id str - The OCID of the user.
- filters
Sequence[identity.
Get Db Credentials Filter] - name str
- A filter to only return resources that match the given name exactly.
- state str
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- user
Id String - The OCID of the user.
- filters List<Property Map>
- name String
- A filter to only return resources that match the given name exactly.
- state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
getDbCredentials Result
The following output properties are available:
- Db
Credentials List<GetDb Credentials Db Credential> - The list of db_credentials.
- Id string
- The provider-assigned unique ID for this managed resource.
- User
Id string - The OCID of the user the DB credential belongs to.
- Filters
List<Get
Db Credentials Filter> - Name string
- State string
- The credential's current state. After creating a DB credential, make sure its
lifecycleState
changes from CREATING to ACTIVE before using it.
- Db
Credentials []GetDb Credentials Db Credential - The list of db_credentials.
- Id string
- The provider-assigned unique ID for this managed resource.
- User
Id string - The OCID of the user the DB credential belongs to.
- Filters
[]Get
Db Credentials Filter - Name string
- State string
- The credential's current state. After creating a DB credential, make sure its
lifecycleState
changes from CREATING to ACTIVE before using it.
- db
Credentials List<GetDb Credentials Db Credential> - The list of db_credentials.
- id String
- The provider-assigned unique ID for this managed resource.
- user
Id String - The OCID of the user the DB credential belongs to.
- filters
List<Get
Db Credentials Filter> - name String
- state String
- The credential's current state. After creating a DB credential, make sure its
lifecycleState
changes from CREATING to ACTIVE before using it.
- db
Credentials GetDb Credentials Db Credential[] - The list of db_credentials.
- id string
- The provider-assigned unique ID for this managed resource.
- user
Id string - The OCID of the user the DB credential belongs to.
- filters
Get
Db Credentials Filter[] - name string
- state string
- The credential's current state. After creating a DB credential, make sure its
lifecycleState
changes from CREATING to ACTIVE before using it.
- db_
credentials Sequence[identity.Get Db Credentials Db Credential] - The list of db_credentials.
- id str
- The provider-assigned unique ID for this managed resource.
- user_
id str - The OCID of the user the DB credential belongs to.
- filters
Sequence[identity.
Get Db Credentials Filter] - name str
- state str
- The credential's current state. After creating a DB credential, make sure its
lifecycleState
changes from CREATING to ACTIVE before using it.
- db
Credentials List<Property Map> - The list of db_credentials.
- id String
- The provider-assigned unique ID for this managed resource.
- user
Id String - The OCID of the user the DB credential belongs to.
- filters List<Property Map>
- name String
- state String
- The credential's current state. After creating a DB credential, make sure its
lifecycleState
changes from CREATING to ACTIVE before using it.
Supporting Types
GetDbCredentialsDbCredential
- Description string
- The description you assign to the DB credential. Does not have to be unique, and it's changeable.
- Id string
- The OCID of the DB credential.
- Lifecycle
Details string - Password string
- State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- Time
Created string - Date and time the
DbCredential
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- Time
Expires 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
- User
Id string - The OCID of the user.
- Description string
- The description you assign to the DB credential. Does not have to be unique, and it's changeable.
- Id string
- The OCID of the DB credential.
- Lifecycle
Details string - Password string
- State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- Time
Created string - Date and time the
DbCredential
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- Time
Expires 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
- User
Id string - The OCID of the user.
- description String
- The description you assign to the DB credential. Does not have to be unique, and it's changeable.
- id String
- The OCID of the DB credential.
- lifecycle
Details String - password String
- state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- time
Created String - Date and time the
DbCredential
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- time
Expires 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
- user
Id String - The OCID of the user.
- description string
- The description you assign to the DB credential. Does not have to be unique, and it's changeable.
- id string
- The OCID of the DB credential.
- lifecycle
Details string - password string
- state string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- time
Created string - Date and time the
DbCredential
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- time
Expires 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
- user
Id string - The OCID of the user.
- description str
- The description you assign to the DB credential. Does not have to be unique, and it's changeable.
- id str
- The OCID of the DB credential.
- lifecycle_
details str - password str
- state str
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- 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 str - The OCID of the user.
- description String
- The description you assign to the DB credential. Does not have to be unique, and it's changeable.
- id String
- The OCID of the DB credential.
- lifecycle
Details String - password String
- state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- time
Created String - Date and time the
DbCredential
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- time
Expires 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
- user
Id String - The OCID of the user.
GetDbCredentialsFilter
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.