1. Packages
  2. Packages
  3. Ibm Provider
  4. API Docs
  5. getIamIdentityPreference
Viewing docs for ibm 2.5.0
published on Wednesday, Aug 5, 2026 by ibm-cloud
Viewing docs for ibm 2.5.0
published on Wednesday, Aug 5, 2026 by ibm-cloud

    Provides a read-only data source to retrieve information about an iam_identity_preference. 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 iamIdentityPreference = ibm.getIamIdentityPreference({
        accountId: iamIdentityPreferenceInstance.accountId,
        iamId: iamIdentityPreferenceInstance.iamId,
        preferenceId: iamIdentityPreferenceInstance.preferenceId,
        service: iamIdentityPreferenceInstance.service,
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    iam_identity_preference = ibm.get_iam_identity_preference(account_id=iam_identity_preference_instance["accountId"],
        iam_id=iam_identity_preference_instance["iamId"],
        preference_id=iam_identity_preference_instance["preferenceId"],
        service=iam_identity_preference_instance["service"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/v2/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.LookupIamIdentityPreference(ctx, &ibm.LookupIamIdentityPreferenceArgs{
    			AccountId:    iamIdentityPreferenceInstance.AccountId,
    			IamId:        iamIdentityPreferenceInstance.IamId,
    			PreferenceId: iamIdentityPreferenceInstance.PreferenceId,
    			Service:      iamIdentityPreferenceInstance.Service,
    		}, 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 iamIdentityPreference = Ibm.GetIamIdentityPreference.Invoke(new()
        {
            AccountId = iamIdentityPreferenceInstance.AccountId,
            IamId = iamIdentityPreferenceInstance.IamId,
            PreferenceId = iamIdentityPreferenceInstance.PreferenceId,
            Service = iamIdentityPreferenceInstance.Service,
        });
    
    });
    
    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.GetIamIdentityPreferenceArgs;
    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 iamIdentityPreference = IbmFunctions.getIamIdentityPreference(GetIamIdentityPreferenceArgs.builder()
                .accountId(iamIdentityPreferenceInstance.accountId())
                .iamId(iamIdentityPreferenceInstance.iamId())
                .preferenceId(iamIdentityPreferenceInstance.preferenceId())
                .service(iamIdentityPreferenceInstance.service())
                .build());
    
        }
    }
    
    variables:
      iamIdentityPreference:
        fn::invoke:
          function: ibm:getIamIdentityPreference
          arguments:
            accountId: ${iamIdentityPreferenceInstance.accountId}
            iamId: ${iamIdentityPreferenceInstance.iamId}
            preferenceId: ${iamIdentityPreferenceInstance.preferenceId}
            service: ${iamIdentityPreferenceInstance.service}
    
    Example coming soon!
    

    Using getIamIdentityPreference

    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 getIamIdentityPreference(args: GetIamIdentityPreferenceArgs, opts?: InvokeOptions): Promise<GetIamIdentityPreferenceResult>
    function getIamIdentityPreferenceOutput(args: GetIamIdentityPreferenceOutputArgs, opts?: InvokeOptions): Output<GetIamIdentityPreferenceResult>
    def get_iam_identity_preference(account_id: Optional[str] = None,
                                    iam_id: Optional[str] = None,
                                    id: Optional[str] = None,
                                    preference_id: Optional[str] = None,
                                    service: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetIamIdentityPreferenceResult
    def get_iam_identity_preference_output(account_id: pulumi.Input[Optional[str]] = None,
                                    iam_id: pulumi.Input[Optional[str]] = None,
                                    id: pulumi.Input[Optional[str]] = None,
                                    preference_id: pulumi.Input[Optional[str]] = None,
                                    service: pulumi.Input[Optional[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetIamIdentityPreferenceResult]
    func LookupIamIdentityPreference(ctx *Context, args *LookupIamIdentityPreferenceArgs, opts ...InvokeOption) (*LookupIamIdentityPreferenceResult, error)
    func LookupIamIdentityPreferenceOutput(ctx *Context, args *LookupIamIdentityPreferenceOutputArgs, opts ...InvokeOption) LookupIamIdentityPreferenceResultOutput

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

    public static class GetIamIdentityPreference 
    {
        public static Task<GetIamIdentityPreferenceResult> InvokeAsync(GetIamIdentityPreferenceArgs args, InvokeOptions? opts = null)
        public static Output<GetIamIdentityPreferenceResult> Invoke(GetIamIdentityPreferenceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIamIdentityPreferenceResult> getIamIdentityPreference(GetIamIdentityPreferenceArgs args, InvokeOptions options)
    public static Output<GetIamIdentityPreferenceResult> getIamIdentityPreference(GetIamIdentityPreferenceArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getIamIdentityPreference:getIamIdentityPreference
      arguments:
        # arguments dictionary
    data "ibm_get_iam_identity_preference" "name" {
        # arguments
    }

    The following arguments are supported:

    AccountId string
    Account id to get preference for.
    IamId string
    IAM id to get the preference for.
    PreferenceId string
    Identifier of preference to be fetched.
    Service string
    Service of the preference to be fetched.
    Id string
    The unique identifier of the iam_identity_preference.
    AccountId string
    Account id to get preference for.
    IamId string
    IAM id to get the preference for.
    PreferenceId string
    Identifier of preference to be fetched.
    Service string
    Service of the preference to be fetched.
    Id string
    The unique identifier of the iam_identity_preference.
    account_id string
    Account id to get preference for.
    iam_id string
    IAM id to get the preference for.
    preference_id string
    Identifier of preference to be fetched.
    service string
    Service of the preference to be fetched.
    id string
    The unique identifier of the iam_identity_preference.
    accountId String
    Account id to get preference for.
    iamId String
    IAM id to get the preference for.
    preferenceId String
    Identifier of preference to be fetched.
    service String
    Service of the preference to be fetched.
    id String
    The unique identifier of the iam_identity_preference.
    accountId string
    Account id to get preference for.
    iamId string
    IAM id to get the preference for.
    preferenceId string
    Identifier of preference to be fetched.
    service string
    Service of the preference to be fetched.
    id string
    The unique identifier of the iam_identity_preference.
    account_id str
    Account id to get preference for.
    iam_id str
    IAM id to get the preference for.
    preference_id str
    Identifier of preference to be fetched.
    service str
    Service of the preference to be fetched.
    id str
    The unique identifier of the iam_identity_preference.
    accountId String
    Account id to get preference for.
    iamId String
    IAM id to get the preference for.
    preferenceId String
    Identifier of preference to be fetched.
    service String
    Service of the preference to be fetched.
    id String
    The unique identifier of the iam_identity_preference.

    getIamIdentityPreference Result

    The following output properties are available:

    AccountId string
    IamId string
    Id string
    The unique identifier of the iam_identity_preference.
    PreferenceId string
    Scope string
    (String) Scope of the preference, 'global' or 'account'.
    Service string
    ValueListOfStrings List<string>
    (List) List of values of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    ValueString string
    (String) String value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    AccountId string
    IamId string
    Id string
    The unique identifier of the iam_identity_preference.
    PreferenceId string
    Scope string
    (String) Scope of the preference, 'global' or 'account'.
    Service string
    ValueListOfStrings []string
    (List) List of values of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    ValueString string
    (String) String value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    account_id string
    iam_id string
    id string
    The unique identifier of the iam_identity_preference.
    preference_id string
    scope string
    (String) Scope of the preference, 'global' or 'account'.
    service string
    value_list_of_strings list(string)
    (List) List of values of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    value_string string
    (String) String value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    accountId String
    iamId String
    id String
    The unique identifier of the iam_identity_preference.
    preferenceId String
    scope String
    (String) Scope of the preference, 'global' or 'account'.
    service String
    valueListOfStrings List<String>
    (List) List of values of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    valueString String
    (String) String value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    accountId string
    iamId string
    id string
    The unique identifier of the iam_identity_preference.
    preferenceId string
    scope string
    (String) Scope of the preference, 'global' or 'account'.
    service string
    valueListOfStrings string[]
    (List) List of values of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    valueString string
    (String) String value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    account_id str
    iam_id str
    id str
    The unique identifier of the iam_identity_preference.
    preference_id str
    scope str
    (String) Scope of the preference, 'global' or 'account'.
    service str
    value_list_of_strings Sequence[str]
    (List) List of values of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    value_string str
    (String) String value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    accountId String
    iamId String
    id String
    The unique identifier of the iam_identity_preference.
    preferenceId String
    scope String
    (String) Scope of the preference, 'global' or 'account'.
    service String
    valueListOfStrings List<String>
    (List) List of values of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    valueString String
    (String) String value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    Viewing docs for ibm 2.5.0
    published on Wednesday, Aug 5, 2026 by ibm-cloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial