1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIamRoleAssignment
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.getIamRoleAssignment({
        assignmentId: "role_assignment_id",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    role_assignment = ibm.get_iam_role_assignment(assignment_id="role_assignment_id")
    
    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.LookupIamRoleAssignment(ctx, &ibm.LookupIamRoleAssignmentArgs{
    			AssignmentId: "role_assignment_id",
    		}, 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.GetIamRoleAssignment.Invoke(new()
        {
            AssignmentId = "role_assignment_id",
        });
    
    });
    
    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.GetIamRoleAssignmentArgs;
    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.getIamRoleAssignment(GetIamRoleAssignmentArgs.builder()
                .assignmentId("role_assignment_id")
                .build());
    
        }
    }
    
    variables:
      roleAssignment:
        fn::invoke:
          function: ibm:getIamRoleAssignment
          arguments:
            assignmentId: role_assignment_id
    

    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 getIamRoleAssignment

    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 getIamRoleAssignment(args: GetIamRoleAssignmentArgs, opts?: InvokeOptions): Promise<GetIamRoleAssignmentResult>
    function getIamRoleAssignmentOutput(args: GetIamRoleAssignmentOutputArgs, opts?: InvokeOptions): Output<GetIamRoleAssignmentResult>
    def get_iam_role_assignment(assignment_id: Optional[str] = None,
                                id: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetIamRoleAssignmentResult
    def get_iam_role_assignment_output(assignment_id: Optional[pulumi.Input[str]] = None,
                                id: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetIamRoleAssignmentResult]
    func LookupIamRoleAssignment(ctx *Context, args *LookupIamRoleAssignmentArgs, opts ...InvokeOption) (*LookupIamRoleAssignmentResult, error)
    func LookupIamRoleAssignmentOutput(ctx *Context, args *LookupIamRoleAssignmentOutputArgs, opts ...InvokeOption) LookupIamRoleAssignmentResultOutput

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

    public static class GetIamRoleAssignment 
    {
        public static Task<GetIamRoleAssignmentResult> InvokeAsync(GetIamRoleAssignmentArgs args, InvokeOptions? opts = null)
        public static Output<GetIamRoleAssignmentResult> Invoke(GetIamRoleAssignmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIamRoleAssignmentResult> getIamRoleAssignment(GetIamRoleAssignmentArgs args, InvokeOptions options)
    public static Output<GetIamRoleAssignmentResult> getIamRoleAssignment(GetIamRoleAssignmentArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getIamRoleAssignment:getIamRoleAssignment
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AssignmentId string
    The role assignment ID.
    Id string
    (String) The role assignment template id.
    AssignmentId string
    The role assignment ID.
    Id string
    (String) The role assignment template id.
    assignmentId String
    The role assignment ID.
    id String
    (String) The role assignment template id.
    assignmentId string
    The role assignment ID.
    id string
    (String) The role assignment template id.
    assignment_id str
    The role assignment ID.
    id str
    (String) The role assignment template id.
    assignmentId String
    The role assignment ID.
    id String
    (String) The role assignment template id.

    getIamRoleAssignment Result

    The following output properties are available:

    AccountId string
    (String) Enterprise account ID where template will be created.
    AssignmentId string
    (String) Passed in value to correlate with other assignments.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character.
    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<GetIamRoleAssignmentResource>
    (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<GetIamRoleAssignmentTarget>
    (Map) assignment target details. Nested schema for target:
    Templates List<GetIamRoleAssignmentTemplate>
    (Map) template details Nested schema for template:
    AccountId string
    (String) Enterprise account ID where template will be created.
    AssignmentId string
    (String) Passed in value to correlate with other assignments.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character.
    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 []GetIamRoleAssignmentResource
    (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 []GetIamRoleAssignmentTarget
    (Map) assignment target details. Nested schema for target:
    Templates []GetIamRoleAssignmentTemplate
    (Map) template details Nested schema for template:
    accountId String
    (String) Enterprise account ID where template will be created.
    assignmentId String
    (String) Passed in value to correlate with other assignments.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character.
    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<GetIamRoleAssignmentResource>
    (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<GetIamRoleAssignmentTarget>
    (Map) assignment target details. Nested schema for target:
    templates List<GetIamRoleAssignmentTemplate>
    (Map) template details Nested schema for template:
    accountId string
    (String) Enterprise account ID where template will be created.
    assignmentId string
    (String) Passed in value to correlate with other assignments.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character.
    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 GetIamRoleAssignmentResource[]
    (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 GetIamRoleAssignmentTarget[]
    (Map) assignment target details. Nested schema for target:
    templates GetIamRoleAssignmentTemplate[]
    (Map) template details Nested schema for template:
    account_id str
    (String) Enterprise account ID where template will be created.
    assignment_id str
    (String) Passed in value to correlate with other assignments.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character.
    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[GetIamRoleAssignmentResource]
    (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[GetIamRoleAssignmentTarget]
    (Map) assignment target details. Nested schema for target:
    templates Sequence[GetIamRoleAssignmentTemplate]
    (Map) template details Nested schema for template:
    accountId String
    (String) Enterprise account ID where template will be created.
    assignmentId String
    (String) Passed in value to correlate with other assignments.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character.
    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:

    Supporting Types

    GetIamRoleAssignmentResource

    Roles List<GetIamRoleAssignmentResourceRole>
    (String) The conflicting role id.
    Targets List<GetIamRoleAssignmentResourceTarget>
    (Map) assignment target details. Nested schema for target:
    Roles []GetIamRoleAssignmentResourceRole
    (String) The conflicting role id.
    Targets []GetIamRoleAssignmentResourceTarget
    (Map) assignment target details. Nested schema for target:
    roles List<GetIamRoleAssignmentResourceRole>
    (String) The conflicting role id.
    targets List<GetIamRoleAssignmentResourceTarget>
    (Map) assignment target details. Nested schema for target:
    roles GetIamRoleAssignmentResourceRole[]
    (String) The conflicting role id.
    targets GetIamRoleAssignmentResourceTarget[]
    (Map) assignment target details. Nested schema for target:
    roles Sequence[GetIamRoleAssignmentResourceRole]
    (String) The conflicting role id.
    targets Sequence[GetIamRoleAssignmentResourceTarget]
    (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:

    GetIamRoleAssignmentResourceRole

    ErrorMessages List<GetIamRoleAssignmentResourceRoleErrorMessage>
    (List) The error response from API. Nested schema for error_message:
    ResourceCreateds List<GetIamRoleAssignmentResourceRoleResourceCreated>
    (List) On success, includes the role assigned. Nested schema for resource_created:
    ErrorMessages []GetIamRoleAssignmentResourceRoleErrorMessage
    (List) The error response from API. Nested schema for error_message:
    ResourceCreateds []GetIamRoleAssignmentResourceRoleResourceCreated
    (List) On success, includes the role assigned. Nested schema for resource_created:
    errorMessages List<GetIamRoleAssignmentResourceRoleErrorMessage>
    (List) The error response from API. Nested schema for error_message:
    resourceCreateds List<GetIamRoleAssignmentResourceRoleResourceCreated>
    (List) On success, includes the role assigned. Nested schema for resource_created:
    errorMessages GetIamRoleAssignmentResourceRoleErrorMessage[]
    (List) The error response from API. Nested schema for error_message:
    resourceCreateds GetIamRoleAssignmentResourceRoleResourceCreated[]
    (List) On success, includes the role assigned. Nested schema for resource_created:
    error_messages Sequence[GetIamRoleAssignmentResourceRoleErrorMessage]
    (List) The error response from API. Nested schema for error_message:
    resource_createds Sequence[GetIamRoleAssignmentResourceRoleResourceCreated]
    (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:

    GetIamRoleAssignmentResourceRoleErrorMessage

    Code string
    (String) error code.
    ErrorCode string
    Errors List<GetIamRoleAssignmentResourceRoleErrorMessageError>
    (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 []GetIamRoleAssignmentResourceRoleErrorMessageError
    (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<GetIamRoleAssignmentResourceRoleErrorMessageError>
    (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 GetIamRoleAssignmentResourceRoleErrorMessageError[]
    (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[GetIamRoleAssignmentResourceRoleErrorMessageError]
    (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.

    GetIamRoleAssignmentResourceRoleErrorMessageError

    Code string
    (String) error code.
    Details List<GetIamRoleAssignmentResourceRoleErrorMessageErrorDetail>
    (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 []GetIamRoleAssignmentResourceRoleErrorMessageErrorDetail
    (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<GetIamRoleAssignmentResourceRoleErrorMessageErrorDetail>
    (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 GetIamRoleAssignmentResourceRoleErrorMessageErrorDetail[]
    (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[GetIamRoleAssignmentResourceRoleErrorMessageErrorDetail]
    (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.

    GetIamRoleAssignmentResourceRoleErrorMessageErrorDetail

    GetIamRoleAssignmentResourceRoleErrorMessageErrorDetailConflictsWith

    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.

    GetIamRoleAssignmentResourceRoleResourceCreated

    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.

    GetIamRoleAssignmentResourceTarget

    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.

    GetIamRoleAssignmentTarget

    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.

    GetIamRoleAssignmentTemplate

    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