1. Packages
  2. Packages
  3. Ibm Provider
  4. API Docs
  5. IamIdentityPreference
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

    Update and delete iam_identity_preferences with this resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const iamIdentityPreferenceInstance = new ibm.IamIdentityPreference("iam_identity_preference_instance", {
        accountId: "account_id",
        iamId: "iam_id",
        preferenceId: "preference_id",
        service: "service",
        valueString: "value_string",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    iam_identity_preference_instance = ibm.IamIdentityPreference("iam_identity_preference_instance",
        account_id="account_id",
        iam_id="iam_id",
        preference_id="preference_id",
        service="service",
        value_string="value_string")
    
    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.NewIamIdentityPreference(ctx, "iam_identity_preference_instance", &ibm.IamIdentityPreferenceArgs{
    			AccountId:    pulumi.String("account_id"),
    			IamId:        pulumi.String("iam_id"),
    			PreferenceId: pulumi.String("preference_id"),
    			Service:      pulumi.String("service"),
    			ValueString:  pulumi.String("value_string"),
    		})
    		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 iamIdentityPreferenceInstance = new Ibm.IamIdentityPreference("iam_identity_preference_instance", new()
        {
            AccountId = "account_id",
            IamId = "iam_id",
            PreferenceId = "preference_id",
            Service = "service",
            ValueString = "value_string",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IamIdentityPreference;
    import com.pulumi.ibm.IamIdentityPreferenceArgs;
    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) {
            var iamIdentityPreferenceInstance = new IamIdentityPreference("iamIdentityPreferenceInstance", IamIdentityPreferenceArgs.builder()
                .accountId("account_id")
                .iamId("iam_id")
                .preferenceId("preference_id")
                .service("service")
                .valueString("value_string")
                .build());
    
        }
    }
    
    resources:
      iamIdentityPreferenceInstance:
        type: ibm:IamIdentityPreference
        name: iam_identity_preference_instance
        properties:
          accountId: account_id
          iamId: iam_id
          preferenceId: preference_id
          service: service
          valueString: value_string
    
    Example coming soon!
    

    Create IamIdentityPreference Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new IamIdentityPreference(name: string, args: IamIdentityPreferenceArgs, opts?: CustomResourceOptions);
    @overload
    def IamIdentityPreference(resource_name: str,
                              args: IamIdentityPreferenceArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def IamIdentityPreference(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              account_id: Optional[str] = None,
                              iam_id: Optional[str] = None,
                              preference_id: Optional[str] = None,
                              service: Optional[str] = None,
                              iam_identity_preference_id: Optional[str] = None,
                              value_list_of_strings: Optional[Sequence[str]] = None,
                              value_string: Optional[str] = None)
    func NewIamIdentityPreference(ctx *Context, name string, args IamIdentityPreferenceArgs, opts ...ResourceOption) (*IamIdentityPreference, error)
    public IamIdentityPreference(string name, IamIdentityPreferenceArgs args, CustomResourceOptions? opts = null)
    public IamIdentityPreference(String name, IamIdentityPreferenceArgs args)
    public IamIdentityPreference(String name, IamIdentityPreferenceArgs args, CustomResourceOptions options)
    
    type: ibm:IamIdentityPreference
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "ibm_iam_identity_preference" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args IamIdentityPreferenceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args IamIdentityPreferenceArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args IamIdentityPreferenceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IamIdentityPreferenceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IamIdentityPreferenceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var iamIdentityPreferenceResource = new Ibm.IamIdentityPreference("iamIdentityPreferenceResource", new()
    {
        AccountId = "string",
        IamId = "string",
        PreferenceId = "string",
        Service = "string",
        IamIdentityPreferenceId = "string",
        ValueListOfStrings = new[]
        {
            "string",
        },
        ValueString = "string",
    });
    
    example, err := ibm.NewIamIdentityPreference(ctx, "iamIdentityPreferenceResource", &ibm.IamIdentityPreferenceArgs{
    	AccountId:               pulumi.String("string"),
    	IamId:                   pulumi.String("string"),
    	PreferenceId:            pulumi.String("string"),
    	Service:                 pulumi.String("string"),
    	IamIdentityPreferenceId: pulumi.String("string"),
    	ValueListOfStrings: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ValueString: pulumi.String("string"),
    })
    
    resource "ibm_iam_identity_preference" "iamIdentityPreferenceResource" {
      lifecycle {
        create_before_destroy = true
      }
      account_id                 = "string"
      iam_id                     = "string"
      preference_id              = "string"
      service                    = "string"
      iam_identity_preference_id = "string"
      value_list_of_strings      = ["string"]
      value_string               = "string"
    }
    
    var iamIdentityPreferenceResource = new IamIdentityPreference("iamIdentityPreferenceResource", IamIdentityPreferenceArgs.builder()
        .accountId("string")
        .iamId("string")
        .preferenceId("string")
        .service("string")
        .iamIdentityPreferenceId("string")
        .valueListOfStrings("string")
        .valueString("string")
        .build());
    
    iam_identity_preference_resource = ibm.IamIdentityPreference("iamIdentityPreferenceResource",
        account_id="string",
        iam_id="string",
        preference_id="string",
        service="string",
        iam_identity_preference_id="string",
        value_list_of_strings=["string"],
        value_string="string")
    
    const iamIdentityPreferenceResource = new ibm.IamIdentityPreference("iamIdentityPreferenceResource", {
        accountId: "string",
        iamId: "string",
        preferenceId: "string",
        service: "string",
        iamIdentityPreferenceId: "string",
        valueListOfStrings: ["string"],
        valueString: "string",
    });
    
    type: ibm:IamIdentityPreference
    properties:
        accountId: string
        iamId: string
        iamIdentityPreferenceId: string
        preferenceId: string
        service: string
        valueListOfStrings:
            - string
        valueString: string
    

    IamIdentityPreference Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The IamIdentityPreference resource accepts the following input properties:

    AccountId string
    Account id to update preference for.
    IamId string
    IAM id to update the preference for.
    PreferenceId string
    Identifier of preference to be updated.
    Service string
    Service of the preference to be updated.
    IamIdentityPreferenceId string
    The unique identifier of the iam_identity_preference.
    ValueListOfStrings List<string>
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    AccountId string
    Account id to update preference for.
    IamId string
    IAM id to update the preference for.
    PreferenceId string
    Identifier of preference to be updated.
    Service string
    Service of the preference to be updated.
    IamIdentityPreferenceId string
    The unique identifier of the iam_identity_preference.
    ValueListOfStrings []string
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    account_id string
    Account id to update preference for.
    iam_id string
    IAM id to update the preference for.
    preference_id string
    Identifier of preference to be updated.
    service string
    Service of the preference to be updated.
    iam_identity_preference_id string
    The unique identifier of the iam_identity_preference.
    value_list_of_strings list(string)
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    accountId String
    Account id to update preference for.
    iamId String
    IAM id to update the preference for.
    preferenceId String
    Identifier of preference to be updated.
    service String
    Service of the preference to be updated.
    iamIdentityPreferenceId String
    The unique identifier of the iam_identity_preference.
    valueListOfStrings List<String>
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    accountId string
    Account id to update preference for.
    iamId string
    IAM id to update the preference for.
    preferenceId string
    Identifier of preference to be updated.
    service string
    Service of the preference to be updated.
    iamIdentityPreferenceId string
    The unique identifier of the iam_identity_preference.
    valueListOfStrings string[]
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    account_id str
    Account id to update preference for.
    iam_id str
    IAM id to update the preference for.
    preference_id str
    Identifier of preference to be updated.
    service str
    Service of the preference to be updated.
    iam_identity_preference_id str
    The unique identifier of the iam_identity_preference.
    value_list_of_strings Sequence[str]
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    accountId String
    Account id to update preference for.
    iamId String
    IAM id to update the preference for.
    preferenceId String
    Identifier of preference to be updated.
    service String
    Service of the preference to be updated.
    iamIdentityPreferenceId String
    The unique identifier of the iam_identity_preference.
    valueListOfStrings List<String>
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the IamIdentityPreference resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Scope string
    (String) Scope of the preference, 'global' or 'account'.
    Id string
    The provider-assigned unique ID for this managed resource.
    Scope string
    (String) Scope of the preference, 'global' or 'account'.
    id string
    The provider-assigned unique ID for this managed resource.
    scope string
    (String) Scope of the preference, 'global' or 'account'.
    id String
    The provider-assigned unique ID for this managed resource.
    scope String
    (String) Scope of the preference, 'global' or 'account'.
    id string
    The provider-assigned unique ID for this managed resource.
    scope string
    (String) Scope of the preference, 'global' or 'account'.
    id str
    The provider-assigned unique ID for this managed resource.
    scope str
    (String) Scope of the preference, 'global' or 'account'.
    id String
    The provider-assigned unique ID for this managed resource.
    scope String
    (String) Scope of the preference, 'global' or 'account'.

    Look up Existing IamIdentityPreference Resource

    Get an existing IamIdentityPreference resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: IamIdentityPreferenceState, opts?: CustomResourceOptions): IamIdentityPreference
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            iam_id: Optional[str] = None,
            iam_identity_preference_id: Optional[str] = None,
            preference_id: Optional[str] = None,
            scope: Optional[str] = None,
            service: Optional[str] = None,
            value_list_of_strings: Optional[Sequence[str]] = None,
            value_string: Optional[str] = None) -> IamIdentityPreference
    func GetIamIdentityPreference(ctx *Context, name string, id IDInput, state *IamIdentityPreferenceState, opts ...ResourceOption) (*IamIdentityPreference, error)
    public static IamIdentityPreference Get(string name, Input<string> id, IamIdentityPreferenceState? state, CustomResourceOptions? opts = null)
    public static IamIdentityPreference get(String name, Output<String> id, IamIdentityPreferenceState state, CustomResourceOptions options)
    resources:  _:    type: ibm:IamIdentityPreference    get:      id: ${id}
    import {
      to = ibm_iam_identity_preference.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccountId string
    Account id to update preference for.
    IamId string
    IAM id to update the preference for.
    IamIdentityPreferenceId string
    The unique identifier of the iam_identity_preference.
    PreferenceId string
    Identifier of preference to be updated.
    Scope string
    (String) Scope of the preference, 'global' or 'account'.
    Service string
    Service of the preference to be updated.
    ValueListOfStrings List<string>
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    AccountId string
    Account id to update preference for.
    IamId string
    IAM id to update the preference for.
    IamIdentityPreferenceId string
    The unique identifier of the iam_identity_preference.
    PreferenceId string
    Identifier of preference to be updated.
    Scope string
    (String) Scope of the preference, 'global' or 'account'.
    Service string
    Service of the preference to be updated.
    ValueListOfStrings []string
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    account_id string
    Account id to update preference for.
    iam_id string
    IAM id to update the preference for.
    iam_identity_preference_id string
    The unique identifier of the iam_identity_preference.
    preference_id string
    Identifier of preference to be updated.
    scope string
    (String) Scope of the preference, 'global' or 'account'.
    service string
    Service of the preference to be updated.
    value_list_of_strings list(string)
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    accountId String
    Account id to update preference for.
    iamId String
    IAM id to update the preference for.
    iamIdentityPreferenceId String
    The unique identifier of the iam_identity_preference.
    preferenceId String
    Identifier of preference to be updated.
    scope String
    (String) Scope of the preference, 'global' or 'account'.
    service String
    Service of the preference to be updated.
    valueListOfStrings List<String>
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    accountId string
    Account id to update preference for.
    iamId string
    IAM id to update the preference for.
    iamIdentityPreferenceId string
    The unique identifier of the iam_identity_preference.
    preferenceId string
    Identifier of preference to be updated.
    scope string
    (String) Scope of the preference, 'global' or 'account'.
    service string
    Service of the preference to be updated.
    valueListOfStrings string[]
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    account_id str
    Account id to update preference for.
    iam_id str
    IAM id to update the preference for.
    iam_identity_preference_id str
    The unique identifier of the iam_identity_preference.
    preference_id str
    Identifier of preference to be updated.
    scope str
    (String) Scope of the preference, 'global' or 'account'.
    service str
    Service of the preference to be updated.
    value_list_of_strings Sequence[str]
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.
    accountId String
    Account id to update preference for.
    iamId String
    IAM id to update the preference for.
    iamIdentityPreferenceId String
    The unique identifier of the iam_identity_preference.
    preferenceId String
    Identifier of preference to be updated.
    scope String
    (String) Scope of the preference, 'global' or 'account'.
    service String
    Service of the preference to be updated.
    valueListOfStrings List<String>
    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 value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is present.

    Import

    You can import the ibm_iam_identity_preference resource by using id.

    The id property can be formed from account_id, iam_id, service, and preference_id in the following format:

    
    <account_id>/<iam_id>/<service>/<preference_id>
    
    
    • account_id: A string. Account id to update preference for.

    • iam_id: A string. IAM id to update the preference for.

    • service: A string. Service of the preference to be updated.

    • preference_id: A string. Identifier of preference to be updated.

    Syntax

    
    ```sh
    $ pulumi import ibm:index/iamIdentityPreference:IamIdentityPreference iam_identity_preference <account_id>/<iam_id>/<service>/<preference_id>
    ```
    
    

    To learn more about importing existing cloud resources, see Importing resources.

    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