Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.DatabaseManagement.getManagedDatabaseUserRoles
Explore with Pulumi AI
This data source provides the list of Managed Database User Roles in Oracle Cloud Infrastructure Database Management service.
Gets the list of roles granted to a specific user.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testManagedDatabaseUserRoles = oci.DatabaseManagement.getManagedDatabaseUserRoles({
    managedDatabaseId: testManagedDatabase.id,
    userName: testUser.name,
    name: managedDatabaseUserRoleName,
    opcNamedCredentialId: managedDatabaseUserRoleOpcNamedCredentialId,
});
import pulumi
import pulumi_oci as oci
test_managed_database_user_roles = oci.DatabaseManagement.get_managed_database_user_roles(managed_database_id=test_managed_database["id"],
    user_name=test_user["name"],
    name=managed_database_user_role_name,
    opc_named_credential_id=managed_database_user_role_opc_named_credential_id)
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/databasemanagement"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := databasemanagement.GetManagedDatabaseUserRoles(ctx, &databasemanagement.GetManagedDatabaseUserRolesArgs{
			ManagedDatabaseId:    testManagedDatabase.Id,
			UserName:             testUser.Name,
			Name:                 pulumi.StringRef(managedDatabaseUserRoleName),
			OpcNamedCredentialId: pulumi.StringRef(managedDatabaseUserRoleOpcNamedCredentialId),
		}, 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 testManagedDatabaseUserRoles = Oci.DatabaseManagement.GetManagedDatabaseUserRoles.Invoke(new()
    {
        ManagedDatabaseId = testManagedDatabase.Id,
        UserName = testUser.Name,
        Name = managedDatabaseUserRoleName,
        OpcNamedCredentialId = managedDatabaseUserRoleOpcNamedCredentialId,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.DatabaseManagement.DatabaseManagementFunctions;
import com.pulumi.oci.DatabaseManagement.inputs.GetManagedDatabaseUserRolesArgs;
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 testManagedDatabaseUserRoles = DatabaseManagementFunctions.getManagedDatabaseUserRoles(GetManagedDatabaseUserRolesArgs.builder()
            .managedDatabaseId(testManagedDatabase.id())
            .userName(testUser.name())
            .name(managedDatabaseUserRoleName)
            .opcNamedCredentialId(managedDatabaseUserRoleOpcNamedCredentialId)
            .build());
    }
}
variables:
  testManagedDatabaseUserRoles:
    fn::invoke:
      function: oci:DatabaseManagement:getManagedDatabaseUserRoles
      arguments:
        managedDatabaseId: ${testManagedDatabase.id}
        userName: ${testUser.name}
        name: ${managedDatabaseUserRoleName}
        opcNamedCredentialId: ${managedDatabaseUserRoleOpcNamedCredentialId}
Using getManagedDatabaseUserRoles
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 getManagedDatabaseUserRoles(args: GetManagedDatabaseUserRolesArgs, opts?: InvokeOptions): Promise<GetManagedDatabaseUserRolesResult>
function getManagedDatabaseUserRolesOutput(args: GetManagedDatabaseUserRolesOutputArgs, opts?: InvokeOptions): Output<GetManagedDatabaseUserRolesResult>def get_managed_database_user_roles(filters: Optional[Sequence[GetManagedDatabaseUserRolesFilter]] = None,
                                    managed_database_id: Optional[str] = None,
                                    name: Optional[str] = None,
                                    opc_named_credential_id: Optional[str] = None,
                                    user_name: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetManagedDatabaseUserRolesResult
def get_managed_database_user_roles_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetManagedDatabaseUserRolesFilterArgs]]]] = None,
                                    managed_database_id: Optional[pulumi.Input[str]] = None,
                                    name: Optional[pulumi.Input[str]] = None,
                                    opc_named_credential_id: Optional[pulumi.Input[str]] = None,
                                    user_name: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetManagedDatabaseUserRolesResult]func GetManagedDatabaseUserRoles(ctx *Context, args *GetManagedDatabaseUserRolesArgs, opts ...InvokeOption) (*GetManagedDatabaseUserRolesResult, error)
func GetManagedDatabaseUserRolesOutput(ctx *Context, args *GetManagedDatabaseUserRolesOutputArgs, opts ...InvokeOption) GetManagedDatabaseUserRolesResultOutput> Note: This function is named GetManagedDatabaseUserRoles in the Go SDK.
public static class GetManagedDatabaseUserRoles 
{
    public static Task<GetManagedDatabaseUserRolesResult> InvokeAsync(GetManagedDatabaseUserRolesArgs args, InvokeOptions? opts = null)
    public static Output<GetManagedDatabaseUserRolesResult> Invoke(GetManagedDatabaseUserRolesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetManagedDatabaseUserRolesResult> getManagedDatabaseUserRoles(GetManagedDatabaseUserRolesArgs args, InvokeOptions options)
public static Output<GetManagedDatabaseUserRolesResult> getManagedDatabaseUserRoles(GetManagedDatabaseUserRolesArgs args, InvokeOptions options)
fn::invoke:
  function: oci:DatabaseManagement/getManagedDatabaseUserRoles:getManagedDatabaseUserRoles
  arguments:
    # arguments dictionaryThe following arguments are supported:
- ManagedDatabase stringId 
- The OCID of the Managed Database.
- UserName string
- The name of the user whose details are to be viewed.
- Filters
List<GetManaged Database User Roles Filter> 
- Name string
- A filter to return only resources that match the entire name.
- OpcNamed stringCredential Id 
- The OCID of the Named Credential.
- ManagedDatabase stringId 
- The OCID of the Managed Database.
- UserName string
- The name of the user whose details are to be viewed.
- Filters
[]GetManaged Database User Roles Filter 
- Name string
- A filter to return only resources that match the entire name.
- OpcNamed stringCredential Id 
- The OCID of the Named Credential.
- managedDatabase StringId 
- The OCID of the Managed Database.
- userName String
- The name of the user whose details are to be viewed.
- filters
List<GetManaged Database User Roles Filter> 
- name String
- A filter to return only resources that match the entire name.
- opcNamed StringCredential Id 
- The OCID of the Named Credential.
- managedDatabase stringId 
- The OCID of the Managed Database.
- userName string
- The name of the user whose details are to be viewed.
- filters
GetManaged Database User Roles Filter[] 
- name string
- A filter to return only resources that match the entire name.
- opcNamed stringCredential Id 
- The OCID of the Named Credential.
- managed_database_ strid 
- The OCID of the Managed Database.
- user_name str
- The name of the user whose details are to be viewed.
- filters
Sequence[GetManaged Database User Roles Filter] 
- name str
- A filter to return only resources that match the entire name.
- opc_named_ strcredential_ id 
- The OCID of the Named Credential.
- managedDatabase StringId 
- The OCID of the Managed Database.
- userName String
- The name of the user whose details are to be viewed.
- filters List<Property Map>
- name String
- A filter to return only resources that match the entire name.
- opcNamed StringCredential Id 
- The OCID of the Named Credential.
getManagedDatabaseUserRoles Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- ManagedDatabase stringId 
- RoleCollections List<GetManaged Database User Roles Role Collection> 
- The list of role_collection.
- UserName string
- Filters
List<GetManaged Database User Roles Filter> 
- Name string
- The name of the role granted to the user.
- OpcNamed stringCredential Id 
- Id string
- The provider-assigned unique ID for this managed resource.
- ManagedDatabase stringId 
- RoleCollections []GetManaged Database User Roles Role Collection 
- The list of role_collection.
- UserName string
- Filters
[]GetManaged Database User Roles Filter 
- Name string
- The name of the role granted to the user.
- OpcNamed stringCredential Id 
- id String
- The provider-assigned unique ID for this managed resource.
- managedDatabase StringId 
- roleCollections List<GetManaged Database User Roles Role Collection> 
- The list of role_collection.
- userName String
- filters
List<GetManaged Database User Roles Filter> 
- name String
- The name of the role granted to the user.
- opcNamed StringCredential Id 
- id string
- The provider-assigned unique ID for this managed resource.
- managedDatabase stringId 
- roleCollections GetManaged Database User Roles Role Collection[] 
- The list of role_collection.
- userName string
- filters
GetManaged Database User Roles Filter[] 
- name string
- The name of the role granted to the user.
- opcNamed stringCredential Id 
- id str
- The provider-assigned unique ID for this managed resource.
- managed_database_ strid 
- role_collections Sequence[GetManaged Database User Roles Role Collection] 
- The list of role_collection.
- user_name str
- filters
Sequence[GetManaged Database User Roles Filter] 
- name str
- The name of the role granted to the user.
- opc_named_ strcredential_ id 
- id String
- The provider-assigned unique ID for this managed resource.
- managedDatabase StringId 
- roleCollections List<Property Map>
- The list of role_collection.
- userName String
- filters List<Property Map>
- name String
- The name of the role granted to the user.
- opcNamed StringCredential Id 
Supporting Types
GetManagedDatabaseUserRolesFilter     
GetManagedDatabaseUserRolesRoleCollection      
- Items
List<GetManaged Database User Roles Role Collection Item> 
- An array of roles.
- Items
[]GetManaged Database User Roles Role Collection Item 
- An array of roles.
- items
List<GetManaged Database User Roles Role Collection Item> 
- An array of roles.
- items
GetManaged Database User Roles Role Collection Item[] 
- An array of roles.
- items
Sequence[GetManaged Database User Roles Role Collection Item] 
- An array of roles.
- items List<Property Map>
- An array of roles.
GetManagedDatabaseUserRolesRoleCollectionItem       
- AdminOption string
- Indicates whether the role is granted with the ADMIN OPTION (YES) or not (NO).
- Common string
- Indicates how the role was granted. Possible values: YES if the role is granted commonly (CONTAINER=ALL is used) NO if the role is granted locally (CONTAINER=ALL is not used)
- DefaultRole string
- Indicates whether the role is designated as a DEFAULT ROLE for the user (YES) or not (NO).
- DelegateOption string
- Indicates whether the role is granted with the DELEGATE OPTION (YES) or not (NO).
- Inherited string
- Indicates whether the granted role is inherited from another container (YES) or not (NO).
- Name string
- A filter to return only resources that match the entire name.
- AdminOption string
- Indicates whether the role is granted with the ADMIN OPTION (YES) or not (NO).
- Common string
- Indicates how the role was granted. Possible values: YES if the role is granted commonly (CONTAINER=ALL is used) NO if the role is granted locally (CONTAINER=ALL is not used)
- DefaultRole string
- Indicates whether the role is designated as a DEFAULT ROLE for the user (YES) or not (NO).
- DelegateOption string
- Indicates whether the role is granted with the DELEGATE OPTION (YES) or not (NO).
- Inherited string
- Indicates whether the granted role is inherited from another container (YES) or not (NO).
- Name string
- A filter to return only resources that match the entire name.
- adminOption String
- Indicates whether the role is granted with the ADMIN OPTION (YES) or not (NO).
- common String
- Indicates how the role was granted. Possible values: YES if the role is granted commonly (CONTAINER=ALL is used) NO if the role is granted locally (CONTAINER=ALL is not used)
- defaultRole String
- Indicates whether the role is designated as a DEFAULT ROLE for the user (YES) or not (NO).
- delegateOption String
- Indicates whether the role is granted with the DELEGATE OPTION (YES) or not (NO).
- inherited String
- Indicates whether the granted role is inherited from another container (YES) or not (NO).
- name String
- A filter to return only resources that match the entire name.
- adminOption string
- Indicates whether the role is granted with the ADMIN OPTION (YES) or not (NO).
- common string
- Indicates how the role was granted. Possible values: YES if the role is granted commonly (CONTAINER=ALL is used) NO if the role is granted locally (CONTAINER=ALL is not used)
- defaultRole string
- Indicates whether the role is designated as a DEFAULT ROLE for the user (YES) or not (NO).
- delegateOption string
- Indicates whether the role is granted with the DELEGATE OPTION (YES) or not (NO).
- inherited string
- Indicates whether the granted role is inherited from another container (YES) or not (NO).
- name string
- A filter to return only resources that match the entire name.
- admin_option str
- Indicates whether the role is granted with the ADMIN OPTION (YES) or not (NO).
- common str
- Indicates how the role was granted. Possible values: YES if the role is granted commonly (CONTAINER=ALL is used) NO if the role is granted locally (CONTAINER=ALL is not used)
- default_role str
- Indicates whether the role is designated as a DEFAULT ROLE for the user (YES) or not (NO).
- delegate_option str
- Indicates whether the role is granted with the DELEGATE OPTION (YES) or not (NO).
- inherited str
- Indicates whether the granted role is inherited from another container (YES) or not (NO).
- name str
- A filter to return only resources that match the entire name.
- adminOption String
- Indicates whether the role is granted with the ADMIN OPTION (YES) or not (NO).
- common String
- Indicates how the role was granted. Possible values: YES if the role is granted commonly (CONTAINER=ALL is used) NO if the role is granted locally (CONTAINER=ALL is not used)
- defaultRole String
- Indicates whether the role is designated as a DEFAULT ROLE for the user (YES) or not (NO).
- delegateOption String
- Indicates whether the role is granted with the DELEGATE OPTION (YES) or not (NO).
- inherited String
- Indicates whether the granted role is inherited from another container (YES) or not (NO).
- name String
- A filter to return only resources that match the entire name.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.