1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIamPolicyAssignment
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getIamPolicyAssignment

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Provides a read-only data source to retrieve information about policy_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 policyAssignment = ibm.getIamPolicyAssignments({});
    
    import pulumi
    import pulumi_ibm as ibm
    
    policy_assignment = ibm.get_iam_policy_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.GetIamPolicyAssignments(ctx, &ibm.GetIamPolicyAssignmentsArgs{}, 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 policyAssignment = Ibm.GetIamPolicyAssignments.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.GetIamPolicyAssignmentsArgs;
    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 policyAssignment = IbmFunctions.getIamPolicyAssignments();
    
        }
    }
    
    variables:
      policyAssignment:
        fn::invoke:
          function: ibm:getIamPolicyAssignments
          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 getIamPolicyAssignment

    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 getIamPolicyAssignment(args: GetIamPolicyAssignmentArgs, opts?: InvokeOptions): Promise<GetIamPolicyAssignmentResult>
    function getIamPolicyAssignmentOutput(args: GetIamPolicyAssignmentOutputArgs, opts?: InvokeOptions): Output<GetIamPolicyAssignmentResult>
    def get_iam_policy_assignment(assignment_id: Optional[str] = None,
                                  version: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetIamPolicyAssignmentResult
    def get_iam_policy_assignment_output(assignment_id: Optional[pulumi.Input[str]] = None,
                                  version: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetIamPolicyAssignmentResult]
    func LookupIamPolicyAssignment(ctx *Context, args *LookupIamPolicyAssignmentArgs, opts ...InvokeOption) (*LookupIamPolicyAssignmentResult, error)
    func LookupIamPolicyAssignmentOutput(ctx *Context, args *LookupIamPolicyAssignmentOutputArgs, opts ...InvokeOption) LookupIamPolicyAssignmentResultOutput

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

    public static class GetIamPolicyAssignment 
    {
        public static Task<GetIamPolicyAssignmentResult> InvokeAsync(GetIamPolicyAssignmentArgs args, InvokeOptions? opts = null)
        public static Output<GetIamPolicyAssignmentResult> Invoke(GetIamPolicyAssignmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIamPolicyAssignmentResult> getIamPolicyAssignment(GetIamPolicyAssignmentArgs args, InvokeOptions options)
    public static Output<GetIamPolicyAssignmentResult> getIamPolicyAssignment(GetIamPolicyAssignmentArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getIamPolicyAssignment:getIamPolicyAssignment
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AssignmentId string
    (String) Passed in value to correlate with other assignments.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character.
    Version string
    (String) The orchestrator template version.
    AssignmentId string
    (String) Passed in value to correlate with other assignments.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character.
    Version string
    (String) The orchestrator template version.
    assignmentId String
    (String) Passed in value to correlate with other assignments.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character.
    version String
    (String) The orchestrator template version.
    assignmentId string
    (String) Passed in value to correlate with other assignments.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character.
    version string
    (String) The orchestrator template version.
    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.
    version str
    (String) The orchestrator template version.
    assignmentId String
    (String) Passed in value to correlate with other assignments.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character.
    version String
    (String) The orchestrator template version.

    getIamPolicyAssignment 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 policy assignment was created.
    CreatedById string
    (String) The iam ID of the entity that created the policy assignment.
    Href string
    (String) The href URL that links to the policies assignments API by policy assignment ID.
    Id string
    (String) The policy assignment template id.
    LastModifiedAt string
    (String) The UTC timestamp when the policy assignment was last modified.
    LastModifiedById string
    (String) The iam ID of the entity that last modified the policy assignment.
    Resources List<GetIamPolicyAssignmentResource>
    (List) Object for each account assigned.

    • Constraints: The minimum length is 1 item. Nested schema for resources:
    Subject Dictionary<string, string>
    Target Dictionary<string, string>
    (Map) assignment target details. Nested schema for target:
    Template Dictionary<string, string>
    (Map) template details Nested schema for template:
    Version string
    (String) The orchestrator template version.
    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 policy assignment was created.
    CreatedById string
    (String) The iam ID of the entity that created the policy assignment.
    Href string
    (String) The href URL that links to the policies assignments API by policy assignment ID.
    Id string
    (String) The policy assignment template id.
    LastModifiedAt string
    (String) The UTC timestamp when the policy assignment was last modified.
    LastModifiedById string
    (String) The iam ID of the entity that last modified the policy assignment.
    Resources []GetIamPolicyAssignmentResource
    (List) Object for each account assigned.

    • Constraints: The minimum length is 1 item. Nested schema for resources:
    Subject map[string]string
    Target map[string]string
    (Map) assignment target details. Nested schema for target:
    Template map[string]string
    (Map) template details Nested schema for template:
    Version string
    (String) The orchestrator template version.
    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 policy assignment was created.
    createdById String
    (String) The iam ID of the entity that created the policy assignment.
    href String
    (String) The href URL that links to the policies assignments API by policy assignment ID.
    id String
    (String) The policy assignment template id.
    lastModifiedAt String
    (String) The UTC timestamp when the policy assignment was last modified.
    lastModifiedById String
    (String) The iam ID of the entity that last modified the policy assignment.
    resources List<GetIamPolicyAssignmentResource>
    (List) Object for each account assigned.

    • Constraints: The minimum length is 1 item. Nested schema for resources:
    subject Map<String,String>
    target Map<String,String>
    (Map) assignment target details. Nested schema for target:
    template Map<String,String>
    (Map) template details Nested schema for template:
    version String
    (String) The orchestrator template version.
    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 policy assignment was created.
    createdById string
    (String) The iam ID of the entity that created the policy assignment.
    href string
    (String) The href URL that links to the policies assignments API by policy assignment ID.
    id string
    (String) The policy assignment template id.
    lastModifiedAt string
    (String) The UTC timestamp when the policy assignment was last modified.
    lastModifiedById string
    (String) The iam ID of the entity that last modified the policy assignment.
    resources GetIamPolicyAssignmentResource[]
    (List) Object for each account assigned.

    • Constraints: The minimum length is 1 item. Nested schema for resources:
    subject {[key: string]: string}
    target {[key: string]: string}
    (Map) assignment target details. Nested schema for target:
    template {[key: string]: string}
    (Map) template details Nested schema for template:
    version string
    (String) The orchestrator template version.
    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 policy assignment was created.
    created_by_id str
    (String) The iam ID of the entity that created the policy assignment.
    href str
    (String) The href URL that links to the policies assignments API by policy assignment ID.
    id str
    (String) The policy assignment template id.
    last_modified_at str
    (String) The UTC timestamp when the policy assignment was last modified.
    last_modified_by_id str
    (String) The iam ID of the entity that last modified the policy assignment.
    resources Sequence[GetIamPolicyAssignmentResource]
    (List) Object for each account assigned.

    • Constraints: The minimum length is 1 item. Nested schema for resources:
    subject Mapping[str, str]
    target Mapping[str, str]
    (Map) assignment target details. Nested schema for target:
    template Mapping[str, str]
    (Map) template details Nested schema for template:
    version str
    (String) The orchestrator template version.
    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 policy assignment was created.
    createdById String
    (String) The iam ID of the entity that created the policy assignment.
    href String
    (String) The href URL that links to the policies assignments API by policy assignment ID.
    id String
    (String) The policy assignment template id.
    lastModifiedAt String
    (String) The UTC timestamp when the policy assignment was last modified.
    lastModifiedById String
    (String) The iam ID of the entity that last modified the policy assignment.
    resources List<Property Map>
    (List) Object for each account assigned.

    • Constraints: The minimum length is 1 item. Nested schema for resources:
    subject Map<String>
    target Map<String>
    (Map) assignment target details. Nested schema for target:
    template Map<String>
    (Map) template details Nested schema for template:
    version String
    (String) The orchestrator template version.

    Supporting Types

    GetIamPolicyAssignmentResource

    Policies List<GetIamPolicyAssignmentResourcePolicy>
    (String) The conflicting policy id.
    Target Dictionary<string, string>
    (Map) assignment target details. Nested schema for target:
    Policies []GetIamPolicyAssignmentResourcePolicy
    (String) The conflicting policy id.
    Target map[string]string
    (Map) assignment target details. Nested schema for target:
    policies List<GetIamPolicyAssignmentResourcePolicy>
    (String) The conflicting policy id.
    target Map<String,String>
    (Map) assignment target details. Nested schema for target:
    policies GetIamPolicyAssignmentResourcePolicy[]
    (String) The conflicting policy id.
    target {[key: string]: string}
    (Map) assignment target details. Nested schema for target:
    policies Sequence[GetIamPolicyAssignmentResourcePolicy]
    (String) The conflicting policy id.
    target Mapping[str, str]
    (Map) assignment target details. Nested schema for target:
    policies List<Property Map>
    (String) The conflicting policy id.
    target Map<String>
    (Map) assignment target details. Nested schema for target:

    GetIamPolicyAssignmentResourcePolicy

    ErrorMessages List<GetIamPolicyAssignmentResourcePolicyErrorMessage>
    (List) The error response from API. Nested schema for error_message:
    ResourceCreateds List<GetIamPolicyAssignmentResourcePolicyResourceCreated>
    (List) On success, includes the policy assigned. Nested schema for resource_created:
    Status string
    (String) The policy assignment status.
    ErrorMessages []GetIamPolicyAssignmentResourcePolicyErrorMessage
    (List) The error response from API. Nested schema for error_message:
    ResourceCreateds []GetIamPolicyAssignmentResourcePolicyResourceCreated
    (List) On success, includes the policy assigned. Nested schema for resource_created:
    Status string
    (String) The policy assignment status.
    errorMessages List<GetIamPolicyAssignmentResourcePolicyErrorMessage>
    (List) The error response from API. Nested schema for error_message:
    resourceCreateds List<GetIamPolicyAssignmentResourcePolicyResourceCreated>
    (List) On success, includes the policy assigned. Nested schema for resource_created:
    status String
    (String) The policy assignment status.
    errorMessages GetIamPolicyAssignmentResourcePolicyErrorMessage[]
    (List) The error response from API. Nested schema for error_message:
    resourceCreateds GetIamPolicyAssignmentResourcePolicyResourceCreated[]
    (List) On success, includes the policy assigned. Nested schema for resource_created:
    status string
    (String) The policy assignment status.
    error_messages Sequence[GetIamPolicyAssignmentResourcePolicyErrorMessage]
    (List) The error response from API. Nested schema for error_message:
    resource_createds Sequence[GetIamPolicyAssignmentResourcePolicyResourceCreated]
    (List) On success, includes the policy assigned. Nested schema for resource_created:
    status str
    (String) The policy assignment status.
    errorMessages List<Property Map>
    (List) The error response from API. Nested schema for error_message:
    resourceCreateds List<Property Map>
    (List) On success, includes the policy assigned. Nested schema for resource_created:
    status String
    (String) The policy assignment status.

    GetIamPolicyAssignmentResourcePolicyErrorMessage

    Errors List<GetIamPolicyAssignmentResourcePolicyErrorMessageError>
    (List) The errors encountered during the response. Nested schema for errors:
    StatusCode double
    (Integer) The http error code of the response.
    Trace string
    (String) The unique transaction id for the request.
    Errors []GetIamPolicyAssignmentResourcePolicyErrorMessageError
    (List) The errors encountered during the response. Nested schema for errors:
    StatusCode float64
    (Integer) The http error code of the response.
    Trace string
    (String) The unique transaction id for the request.
    errors List<GetIamPolicyAssignmentResourcePolicyErrorMessageError>
    (List) The errors encountered during the response. Nested schema for errors:
    statusCode Double
    (Integer) The http error code of the response.
    trace String
    (String) The unique transaction id for the request.
    errors GetIamPolicyAssignmentResourcePolicyErrorMessageError[]
    (List) The errors encountered during the response. Nested schema for errors:
    statusCode number
    (Integer) The http error code of the response.
    trace string
    (String) The unique transaction id for the request.
    errors Sequence[GetIamPolicyAssignmentResourcePolicyErrorMessageError]
    (List) The errors encountered during the response. Nested schema for errors:
    status_code float
    (Integer) The http error code of the response.
    trace str
    (String) The unique transaction id for the request.
    errors List<Property Map>
    (List) The errors encountered during the response. Nested schema for errors:
    statusCode Number
    (Integer) The http error code of the response.
    trace String
    (String) The unique transaction id for the request.

    GetIamPolicyAssignmentResourcePolicyErrorMessageError

    Code string
    (String) The API error code for the error.
    Details List<GetIamPolicyAssignmentResourcePolicyErrorMessageErrorDetail>
    (List) Additional error details. Nested schema for details: Nested schema for conflicts_with:
    Message string
    (String) The error message returned by the API.
    MoreInfo string
    (String) Additional info for error.
    Code string
    (String) The API error code for the error.
    Details []GetIamPolicyAssignmentResourcePolicyErrorMessageErrorDetail
    (List) Additional error details. Nested schema for details: Nested schema for conflicts_with:
    Message string
    (String) The error message returned by the API.
    MoreInfo string
    (String) Additional info for error.
    code String
    (String) The API error code for the error.
    details List<GetIamPolicyAssignmentResourcePolicyErrorMessageErrorDetail>
    (List) Additional error details. Nested schema for details: Nested schema for conflicts_with:
    message String
    (String) The error message returned by the API.
    moreInfo String
    (String) Additional info for error.
    code string
    (String) The API error code for the error.
    details GetIamPolicyAssignmentResourcePolicyErrorMessageErrorDetail[]
    (List) Additional error details. Nested schema for details: Nested schema for conflicts_with:
    message string
    (String) The error message returned by the API.
    moreInfo string
    (String) Additional info for error.
    code str
    (String) The API error code for the error.
    details Sequence[GetIamPolicyAssignmentResourcePolicyErrorMessageErrorDetail]
    (List) Additional error details. Nested schema for details: Nested schema for conflicts_with:
    message str
    (String) The error message returned by the API.
    more_info str
    (String) Additional info for error.
    code String
    (String) The API error code for the error.
    details List<Property Map>
    (List) Additional error details. Nested schema for details: Nested schema for conflicts_with:
    message String
    (String) The error message returned by the API.
    moreInfo String
    (String) Additional info for error.

    GetIamPolicyAssignmentResourcePolicyErrorMessageErrorDetail

    GetIamPolicyAssignmentResourcePolicyErrorMessageErrorDetailConflictsWith

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

    GetIamPolicyAssignmentResourcePolicyResourceCreated

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

    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.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud