1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIamRoleAssignments
ibm 1.86.0 published on Wednesday, Dec 3, 2025 by ibm-cloud
ibm logo
ibm 1.86.0 published on Wednesday, Dec 3, 2025 by ibm-cloud

    Provides a read-only data source to retrieve information about role_assignments. You can then reference the fields of the data source in other resources within the same configuration by using interpolation syntax.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const roleAssignment = ibm.getIamRoleAssignments({});
    
    import pulumi
    import pulumi_ibm as ibm
    
    role_assignment = ibm.get_iam_role_assignments()
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.GetIamRoleAssignments(ctx, &ibm.GetIamRoleAssignmentsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var roleAssignment = Ibm.GetIamRoleAssignments.Invoke();
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetIamRoleAssignmentsArgs;
    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 roleAssignment = IbmFunctions.getIamRoleAssignments(GetIamRoleAssignmentsArgs.builder()
                .build());
    
        }
    }
    
    variables:
      roleAssignment:
        fn::invoke:
          function: ibm:getIamRoleAssignments
          arguments: {}
    

    Timeouts section

    The resource includes default timeout settings for the following operations:

    • create - (Timeout) Defaults to 30 minutes.
    • update - (Timeout) Defaults to 30 minutes.
    • delete - (Timeout) Defaults to 30 minutes.

    Using getIamRoleAssignments

    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 getIamRoleAssignments(args: GetIamRoleAssignmentsArgs, opts?: InvokeOptions): Promise<GetIamRoleAssignmentsResult>
    function getIamRoleAssignmentsOutput(args: GetIamRoleAssignmentsOutputArgs, opts?: InvokeOptions): Output<GetIamRoleAssignmentsResult>
    def get_iam_role_assignments(id: Optional[str] = None,
                                 template_id: Optional[str] = None,
                                 template_version: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetIamRoleAssignmentsResult
    def get_iam_role_assignments_output(id: Optional[pulumi.Input[str]] = None,
                                 template_id: Optional[pulumi.Input[str]] = None,
                                 template_version: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetIamRoleAssignmentsResult]
    func GetIamRoleAssignments(ctx *Context, args *GetIamRoleAssignmentsArgs, opts ...InvokeOption) (*GetIamRoleAssignmentsResult, error)
    func GetIamRoleAssignmentsOutput(ctx *Context, args *GetIamRoleAssignmentsOutputArgs, opts ...InvokeOption) GetIamRoleAssignmentsResultOutput

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

    public static class GetIamRoleAssignments 
    {
        public static Task<GetIamRoleAssignmentsResult> InvokeAsync(GetIamRoleAssignmentsArgs args, InvokeOptions? opts = null)
        public static Output<GetIamRoleAssignmentsResult> Invoke(GetIamRoleAssignmentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIamRoleAssignmentsResult> getIamRoleAssignments(GetIamRoleAssignmentsArgs args, InvokeOptions options)
    public static Output<GetIamRoleAssignmentsResult> getIamRoleAssignments(GetIamRoleAssignmentsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getIamRoleAssignments:getIamRoleAssignments
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    (String) The role assignment template id.
    TemplateId string
    TemplateVersion string
    Id string
    (String) The role assignment template id.
    TemplateId string
    TemplateVersion string
    id String
    (String) The role assignment template id.
    templateId String
    templateVersion String
    id string
    (String) The role assignment template id.
    templateId string
    templateVersion string
    id str
    (String) The role assignment template id.
    template_id str
    template_version str
    id String
    (String) The role assignment template id.
    templateId String
    templateVersion String

    getIamRoleAssignments Result

    The following output properties are available:

    Assignments List<GetIamRoleAssignmentsAssignment>
    (List) List of role assignments.

    • Constraints: The minimum length is 0 items. Nested schema for assignments:
    Id string
    (String) The role assignment template id.
    TemplateId string
    TemplateVersion string
    Assignments []GetIamRoleAssignmentsAssignment
    (List) List of role assignments.

    • Constraints: The minimum length is 0 items. Nested schema for assignments:
    Id string
    (String) The role assignment template id.
    TemplateId string
    TemplateVersion string
    assignments List<GetIamRoleAssignmentsAssignment>
    (List) List of role assignments.

    • Constraints: The minimum length is 0 items. Nested schema for assignments:
    id String
    (String) The role assignment template id.
    templateId String
    templateVersion String
    assignments GetIamRoleAssignmentsAssignment[]
    (List) List of role assignments.

    • Constraints: The minimum length is 0 items. Nested schema for assignments:
    id string
    (String) The role assignment template id.
    templateId string
    templateVersion string
    assignments Sequence[GetIamRoleAssignmentsAssignment]
    (List) List of role assignments.

    • Constraints: The minimum length is 0 items. Nested schema for assignments:
    id str
    (String) The role assignment template id.
    template_id str
    template_version str
    assignments List<Property Map>
    (List) List of role assignments.

    • Constraints: The minimum length is 0 items. Nested schema for assignments:
    id String
    (String) The role assignment template id.
    templateId String
    templateVersion String

    Supporting Types

    GetIamRoleAssignmentsAssignment

    AccountId string
    (String) Enterprise account ID where template will be created.
    CreatedAt string
    (String) The UTC timestamp when the role assignment was created.
    CreatedById string
    (String) The iam ID of the entity that created the role assignment.
    Href string
    (String) The href URL that links to the policies assignments API by role assignment ID.
    Id string
    (String) The role assignment template id.
    LastModifiedAt string
    (String) The UTC timestamp when the role assignment was last modified.
    LastModifiedById string
    (String) The iam ID of the entity that last modified the role assignment.
    Operation string
    Resources List<GetIamRoleAssignmentsAssignmentResource>
    (List) Object for each account assigned.

    • Constraints: The minimum length is 1 item. Nested schema for resources:
    Status string
    (String) The role assignment status.
    Targets List<GetIamRoleAssignmentsAssignmentTarget>
    (Map) assignment target details. Nested schema for target:
    Templates List<GetIamRoleAssignmentsAssignmentTemplate>
    (Map) template details Nested schema for template:
    AccountId string
    (String) Enterprise account ID where template will be created.
    CreatedAt string
    (String) The UTC timestamp when the role assignment was created.
    CreatedById string
    (String) The iam ID of the entity that created the role assignment.
    Href string
    (String) The href URL that links to the policies assignments API by role assignment ID.
    Id string
    (String) The role assignment template id.
    LastModifiedAt string
    (String) The UTC timestamp when the role assignment was last modified.
    LastModifiedById string
    (String) The iam ID of the entity that last modified the role assignment.
    Operation string
    Resources []GetIamRoleAssignmentsAssignmentResource
    (List) Object for each account assigned.

    • Constraints: The minimum length is 1 item. Nested schema for resources:
    Status string
    (String) The role assignment status.
    Targets []GetIamRoleAssignmentsAssignmentTarget
    (Map) assignment target details. Nested schema for target:
    Templates []GetIamRoleAssignmentsAssignmentTemplate
    (Map) template details Nested schema for template:
    accountId String
    (String) Enterprise account ID where template will be created.
    createdAt String
    (String) The UTC timestamp when the role assignment was created.
    createdById String
    (String) The iam ID of the entity that created the role assignment.
    href String
    (String) The href URL that links to the policies assignments API by role assignment ID.
    id String
    (String) The role assignment template id.
    lastModifiedAt String
    (String) The UTC timestamp when the role assignment was last modified.
    lastModifiedById String
    (String) The iam ID of the entity that last modified the role assignment.
    operation String
    resources List<GetIamRoleAssignmentsAssignmentResource>
    (List) Object for each account assigned.

    • Constraints: The minimum length is 1 item. Nested schema for resources:
    status String
    (String) The role assignment status.
    targets List<GetIamRoleAssignmentsAssignmentTarget>
    (Map) assignment target details. Nested schema for target:
    templates List<GetIamRoleAssignmentsAssignmentTemplate>
    (Map) template details Nested schema for template:
    accountId string
    (String) Enterprise account ID where template will be created.
    createdAt string
    (String) The UTC timestamp when the role assignment was created.
    createdById string
    (String) The iam ID of the entity that created the role assignment.
    href string
    (String) The href URL that links to the policies assignments API by role assignment ID.
    id string
    (String) The role assignment template id.
    lastModifiedAt string
    (String) The UTC timestamp when the role assignment was last modified.
    lastModifiedById string
    (String) The iam ID of the entity that last modified the role assignment.
    operation string
    resources GetIamRoleAssignmentsAssignmentResource[]
    (List) Object for each account assigned.

    • Constraints: The minimum length is 1 item. Nested schema for resources:
    status string
    (String) The role assignment status.
    targets GetIamRoleAssignmentsAssignmentTarget[]
    (Map) assignment target details. Nested schema for target:
    templates GetIamRoleAssignmentsAssignmentTemplate[]
    (Map) template details Nested schema for template:
    account_id str
    (String) Enterprise account ID where template will be created.
    created_at str
    (String) The UTC timestamp when the role assignment was created.
    created_by_id str
    (String) The iam ID of the entity that created the role assignment.
    href str
    (String) The href URL that links to the policies assignments API by role assignment ID.
    id str
    (String) The role assignment template id.
    last_modified_at str
    (String) The UTC timestamp when the role assignment was last modified.
    last_modified_by_id str
    (String) The iam ID of the entity that last modified the role assignment.
    operation str
    resources Sequence[GetIamRoleAssignmentsAssignmentResource]
    (List) Object for each account assigned.

    • Constraints: The minimum length is 1 item. Nested schema for resources:
    status str
    (String) The role assignment status.
    targets Sequence[GetIamRoleAssignmentsAssignmentTarget]
    (Map) assignment target details. Nested schema for target:
    templates Sequence[GetIamRoleAssignmentsAssignmentTemplate]
    (Map) template details Nested schema for template:
    accountId String
    (String) Enterprise account ID where template will be created.
    createdAt String
    (String) The UTC timestamp when the role assignment was created.
    createdById String
    (String) The iam ID of the entity that created the role assignment.
    href String
    (String) The href URL that links to the policies assignments API by role assignment ID.
    id String
    (String) The role assignment template id.
    lastModifiedAt String
    (String) The UTC timestamp when the role assignment was last modified.
    lastModifiedById String
    (String) The iam ID of the entity that last modified the role assignment.
    operation String
    resources List<Property Map>
    (List) Object for each account assigned.

    • Constraints: The minimum length is 1 item. Nested schema for resources:
    status String
    (String) The role assignment status.
    targets List<Property Map>
    (Map) assignment target details. Nested schema for target:
    templates List<Property Map>
    (Map) template details Nested schema for template:

    GetIamRoleAssignmentsAssignmentResource

    Roles List<GetIamRoleAssignmentsAssignmentResourceRole>
    (String) The conflicting role id.
    Targets List<GetIamRoleAssignmentsAssignmentResourceTarget>
    (Map) assignment target details. Nested schema for target:
    Roles []GetIamRoleAssignmentsAssignmentResourceRole
    (String) The conflicting role id.
    Targets []GetIamRoleAssignmentsAssignmentResourceTarget
    (Map) assignment target details. Nested schema for target:
    roles List<GetIamRoleAssignmentsAssignmentResourceRole>
    (String) The conflicting role id.
    targets List<GetIamRoleAssignmentsAssignmentResourceTarget>
    (Map) assignment target details. Nested schema for target:
    roles GetIamRoleAssignmentsAssignmentResourceRole[]
    (String) The conflicting role id.
    targets GetIamRoleAssignmentsAssignmentResourceTarget[]
    (Map) assignment target details. Nested schema for target:
    roles Sequence[GetIamRoleAssignmentsAssignmentResourceRole]
    (String) The conflicting role id.
    targets Sequence[GetIamRoleAssignmentsAssignmentResourceTarget]
    (Map) assignment target details. Nested schema for target:
    roles List<Property Map>
    (String) The conflicting role id.
    targets List<Property Map>
    (Map) assignment target details. Nested schema for target:

    GetIamRoleAssignmentsAssignmentResourceRole

    ErrorMessages List<GetIamRoleAssignmentsAssignmentResourceRoleErrorMessage>
    (List) The error response from API. Nested schema for error_message:
    ResourceCreateds List<GetIamRoleAssignmentsAssignmentResourceRoleResourceCreated>
    (List) On success, includes the role assigned. Nested schema for resource_created:
    ErrorMessages []GetIamRoleAssignmentsAssignmentResourceRoleErrorMessage
    (List) The error response from API. Nested schema for error_message:
    ResourceCreateds []GetIamRoleAssignmentsAssignmentResourceRoleResourceCreated
    (List) On success, includes the role assigned. Nested schema for resource_created:
    errorMessages List<GetIamRoleAssignmentsAssignmentResourceRoleErrorMessage>
    (List) The error response from API. Nested schema for error_message:
    resourceCreateds List<GetIamRoleAssignmentsAssignmentResourceRoleResourceCreated>
    (List) On success, includes the role assigned. Nested schema for resource_created:
    errorMessages GetIamRoleAssignmentsAssignmentResourceRoleErrorMessage[]
    (List) The error response from API. Nested schema for error_message:
    resourceCreateds GetIamRoleAssignmentsAssignmentResourceRoleResourceCreated[]
    (List) On success, includes the role assigned. Nested schema for resource_created:
    error_messages Sequence[GetIamRoleAssignmentsAssignmentResourceRoleErrorMessage]
    (List) The error response from API. Nested schema for error_message:
    resource_createds Sequence[GetIamRoleAssignmentsAssignmentResourceRoleResourceCreated]
    (List) On success, includes the role assigned. Nested schema for resource_created:
    errorMessages List<Property Map>
    (List) The error response from API. Nested schema for error_message:
    resourceCreateds List<Property Map>
    (List) On success, includes the role assigned. Nested schema for resource_created:

    GetIamRoleAssignmentsAssignmentResourceRoleErrorMessage

    Code string
    (String) error code.
    ErrorCode string
    Errors List<GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageError>
    (List) The errors encountered during the response. Nested schema for errors:
    Message string
    (String) Error message detailing the nature of the error.
    Name string
    (String) Name of the error.

    • errorCode - (String) error code.
    StatusCode double
    (Integer) The http error code of the response.
    Trace string
    (String) The unique transaction id for the request.
    Code string
    (String) error code.
    ErrorCode string
    Errors []GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageError
    (List) The errors encountered during the response. Nested schema for errors:
    Message string
    (String) Error message detailing the nature of the error.
    Name string
    (String) Name of the error.

    • errorCode - (String) error code.
    StatusCode float64
    (Integer) The http error code of the response.
    Trace string
    (String) The unique transaction id for the request.
    code String
    (String) error code.
    errorCode String
    errors List<GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageError>
    (List) The errors encountered during the response. Nested schema for errors:
    message String
    (String) Error message detailing the nature of the error.
    name String
    (String) Name of the error.

    • errorCode - (String) error code.
    statusCode Double
    (Integer) The http error code of the response.
    trace String
    (String) The unique transaction id for the request.
    code string
    (String) error code.
    errorCode string
    errors GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageError[]
    (List) The errors encountered during the response. Nested schema for errors:
    message string
    (String) Error message detailing the nature of the error.
    name string
    (String) Name of the error.

    • errorCode - (String) error code.
    statusCode number
    (Integer) The http error code of the response.
    trace string
    (String) The unique transaction id for the request.
    code str
    (String) error code.
    error_code str
    errors Sequence[GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageError]
    (List) The errors encountered during the response. Nested schema for errors:
    message str
    (String) Error message detailing the nature of the error.
    name str
    (String) Name of the error.

    • errorCode - (String) error code.
    status_code float
    (Integer) The http error code of the response.
    trace str
    (String) The unique transaction id for the request.
    code String
    (String) error code.
    errorCode String
    errors List<Property Map>
    (List) The errors encountered during the response. Nested schema for errors:
    message String
    (String) Error message detailing the nature of the error.
    name String
    (String) Name of the error.

    • errorCode - (String) error code.
    statusCode Number
    (Integer) The http error code of the response.
    trace String
    (String) The unique transaction id for the request.

    GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageError

    Code string
    (String) error code.
    Details List<GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageErrorDetail>
    (List) Additional error details. Nested schema for details: Nested schema for conflicts_with:
    Message string
    (String) Error message detailing the nature of the error.
    MoreInfo string
    (String) Additional info for error.
    Code string
    (String) error code.
    Details []GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageErrorDetail
    (List) Additional error details. Nested schema for details: Nested schema for conflicts_with:
    Message string
    (String) Error message detailing the nature of the error.
    MoreInfo string
    (String) Additional info for error.
    code String
    (String) error code.
    details List<GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageErrorDetail>
    (List) Additional error details. Nested schema for details: Nested schema for conflicts_with:
    message String
    (String) Error message detailing the nature of the error.
    moreInfo String
    (String) Additional info for error.
    code string
    (String) error code.
    details GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageErrorDetail[]
    (List) Additional error details. Nested schema for details: Nested schema for conflicts_with:
    message string
    (String) Error message detailing the nature of the error.
    moreInfo string
    (String) Additional info for error.
    code str
    (String) error code.
    details Sequence[GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageErrorDetail]
    (List) Additional error details. Nested schema for details: Nested schema for conflicts_with:
    message str
    (String) Error message detailing the nature of the error.
    more_info str
    (String) Additional info for error.
    code String
    (String) error code.
    details List<Property Map>
    (List) Additional error details. Nested schema for details: Nested schema for conflicts_with:
    message String
    (String) Error message detailing the nature of the error.
    moreInfo String
    (String) Additional info for error.

    GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageErrorDetail

    GetIamRoleAssignmentsAssignmentResourceRoleErrorMessageErrorDetailConflictsWith

    Etag string
    (String) The revision number of the resource.
    Policy string
    Role string
    (String) The conflicting role id.
    Etag string
    (String) The revision number of the resource.
    Policy string
    Role string
    (String) The conflicting role id.
    etag String
    (String) The revision number of the resource.
    policy String
    role String
    (String) The conflicting role id.
    etag string
    (String) The revision number of the resource.
    policy string
    role string
    (String) The conflicting role id.
    etag str
    (String) The revision number of the resource.
    policy str
    role str
    (String) The conflicting role id.
    etag String
    (String) The revision number of the resource.
    policy String
    role String
    (String) The conflicting role id.

    GetIamRoleAssignmentsAssignmentResourceRoleResourceCreated

    Id string
    (String) The role assignment template id.
    Id string
    (String) The role assignment template id.
    id String
    (String) The role assignment template id.
    id string
    (String) The role assignment template id.
    id str
    (String) The role assignment template id.
    id String
    (String) The role assignment template id.

    GetIamRoleAssignmentsAssignmentResourceTarget

    Id string
    (String) The role assignment template id.
    Type string
    (String) The target type.
    Id string
    (String) The role assignment template id.
    Type string
    (String) The target type.
    id String
    (String) The role assignment template id.
    type String
    (String) The target type.
    id string
    (String) The role assignment template id.
    type string
    (String) The target type.
    id str
    (String) The role assignment template id.
    type str
    (String) The target type.
    id String
    (String) The role assignment template id.
    type String
    (String) The target type.

    GetIamRoleAssignmentsAssignmentTarget

    Id string
    (String) The role assignment template id.
    Type string
    (String) The target type.
    Id string
    (String) The role assignment template id.
    Type string
    (String) The target type.
    id String
    (String) The role assignment template id.
    type String
    (String) The target type.
    id string
    (String) The role assignment template id.
    type string
    (String) The target type.
    id str
    (String) The role assignment template id.
    type str
    (String) The target type.
    id String
    (String) The role assignment template id.
    type String
    (String) The target type.

    GetIamRoleAssignmentsAssignmentTemplate

    Id string
    (String) The role assignment template id.
    Version string
    (String) The orchestrator template version.
    Id string
    (String) The role assignment template id.
    Version string
    (String) The orchestrator template version.
    id String
    (String) The role assignment template id.
    version String
    (String) The orchestrator template version.
    id string
    (String) The role assignment template id.
    version string
    (String) The orchestrator template version.
    id str
    (String) The role assignment template id.
    version str
    (String) The orchestrator template version.
    id String
    (String) The role assignment template id.
    version String
    (String) The orchestrator template version.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.86.0 published on Wednesday, Dec 3, 2025 by ibm-cloud
      Meet Neo: Your AI Platform Teammate