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

ibm.IamCustomRole

Explore with Pulumi AI

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

    Create, update, or delete a custom IAM role. For more information, about IAM custom roles, see Creating custom roles.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const customrole = new ibm.IamCustomRole("customrole", {
        actions: ["kms.secrets.rotate"],
        description: "This is a custom role",
        displayName: "Role1",
        service: "kms",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    customrole = ibm.IamCustomRole("customrole",
        actions=["kms.secrets.rotate"],
        description="This is a custom role",
        display_name="Role1",
        service="kms")
    
    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.NewIamCustomRole(ctx, "customrole", &ibm.IamCustomRoleArgs{
    			Actions: pulumi.StringArray{
    				pulumi.String("kms.secrets.rotate"),
    			},
    			Description: pulumi.String("This is a custom role"),
    			DisplayName: pulumi.String("Role1"),
    			Service:     pulumi.String("kms"),
    		})
    		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 customrole = new Ibm.IamCustomRole("customrole", new()
        {
            Actions = new[]
            {
                "kms.secrets.rotate",
            },
            Description = "This is a custom role",
            DisplayName = "Role1",
            Service = "kms",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IamCustomRole;
    import com.pulumi.ibm.IamCustomRoleArgs;
    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 customrole = new IamCustomRole("customrole", IamCustomRoleArgs.builder()
                .actions("kms.secrets.rotate")
                .description("This is a custom role")
                .displayName("Role1")
                .service("kms")
                .build());
    
        }
    }
    
    resources:
      customrole:
        type: ibm:IamCustomRole
        properties:
          actions:
            - kms.secrets.rotate
          description: This is a custom role
          displayName: Role1
          service: kms
    

    Create IamCustomRole Resource

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

    Constructor syntax

    new IamCustomRole(name: string, args: IamCustomRoleArgs, opts?: CustomResourceOptions);
    @overload
    def IamCustomRole(resource_name: str,
                      args: IamCustomRoleArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def IamCustomRole(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      actions: Optional[Sequence[str]] = None,
                      display_name: Optional[str] = None,
                      service: Optional[str] = None,
                      description: Optional[str] = None,
                      iam_custom_role_id: Optional[str] = None,
                      name: Optional[str] = None)
    func NewIamCustomRole(ctx *Context, name string, args IamCustomRoleArgs, opts ...ResourceOption) (*IamCustomRole, error)
    public IamCustomRole(string name, IamCustomRoleArgs args, CustomResourceOptions? opts = null)
    public IamCustomRole(String name, IamCustomRoleArgs args)
    public IamCustomRole(String name, IamCustomRoleArgs args, CustomResourceOptions options)
    
    type: ibm:IamCustomRole
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args IamCustomRoleArgs
    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 IamCustomRoleArgs
    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 IamCustomRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IamCustomRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IamCustomRoleArgs
    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 iamCustomRoleResource = new Ibm.IamCustomRole("iamCustomRoleResource", new()
    {
        Actions = new[]
        {
            "string",
        },
        DisplayName = "string",
        Service = "string",
        Description = "string",
        IamCustomRoleId = "string",
        Name = "string",
    });
    
    example, err := ibm.NewIamCustomRole(ctx, "iamCustomRoleResource", &ibm.IamCustomRoleArgs{
    	Actions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	DisplayName:     pulumi.String("string"),
    	Service:         pulumi.String("string"),
    	Description:     pulumi.String("string"),
    	IamCustomRoleId: pulumi.String("string"),
    	Name:            pulumi.String("string"),
    })
    
    var iamCustomRoleResource = new IamCustomRole("iamCustomRoleResource", IamCustomRoleArgs.builder()
        .actions("string")
        .displayName("string")
        .service("string")
        .description("string")
        .iamCustomRoleId("string")
        .name("string")
        .build());
    
    iam_custom_role_resource = ibm.IamCustomRole("iamCustomRoleResource",
        actions=["string"],
        display_name="string",
        service="string",
        description="string",
        iam_custom_role_id="string",
        name="string")
    
    const iamCustomRoleResource = new ibm.IamCustomRole("iamCustomRoleResource", {
        actions: ["string"],
        displayName: "string",
        service: "string",
        description: "string",
        iamCustomRoleId: "string",
        name: "string",
    });
    
    type: ibm:IamCustomRole
    properties:
        actions:
            - string
        description: string
        displayName: string
        iamCustomRoleId: string
        name: string
        service: string
    

    IamCustomRole 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 IamCustomRole resource accepts the following input properties:

    Actions List<string>
    Required-A list of action IDs that you want to add to your custom role. The action IDs vary by service. To retrieve supported action IDs, follow the documentation to create the custom role from the console.
    DisplayName string
    The display name of the custom role.
    Service string
    The name of the service for which you want to create the custom role. To retrieve the name, run ibmcloud catalog service-marketplace.
    Description string
    The description of the custom role. Make sure to include information about the level of access this role assignment gives a user.
    IamCustomRoleId string
    (String) The ID of the custom role.
    Name string
    The name of the custom role.
    Actions []string
    Required-A list of action IDs that you want to add to your custom role. The action IDs vary by service. To retrieve supported action IDs, follow the documentation to create the custom role from the console.
    DisplayName string
    The display name of the custom role.
    Service string
    The name of the service for which you want to create the custom role. To retrieve the name, run ibmcloud catalog service-marketplace.
    Description string
    The description of the custom role. Make sure to include information about the level of access this role assignment gives a user.
    IamCustomRoleId string
    (String) The ID of the custom role.
    Name string
    The name of the custom role.
    actions List<String>
    Required-A list of action IDs that you want to add to your custom role. The action IDs vary by service. To retrieve supported action IDs, follow the documentation to create the custom role from the console.
    displayName String
    The display name of the custom role.
    service String
    The name of the service for which you want to create the custom role. To retrieve the name, run ibmcloud catalog service-marketplace.
    description String
    The description of the custom role. Make sure to include information about the level of access this role assignment gives a user.
    iamCustomRoleId String
    (String) The ID of the custom role.
    name String
    The name of the custom role.
    actions string[]
    Required-A list of action IDs that you want to add to your custom role. The action IDs vary by service. To retrieve supported action IDs, follow the documentation to create the custom role from the console.
    displayName string
    The display name of the custom role.
    service string
    The name of the service for which you want to create the custom role. To retrieve the name, run ibmcloud catalog service-marketplace.
    description string
    The description of the custom role. Make sure to include information about the level of access this role assignment gives a user.
    iamCustomRoleId string
    (String) The ID of the custom role.
    name string
    The name of the custom role.
    actions Sequence[str]
    Required-A list of action IDs that you want to add to your custom role. The action IDs vary by service. To retrieve supported action IDs, follow the documentation to create the custom role from the console.
    display_name str
    The display name of the custom role.
    service str
    The name of the service for which you want to create the custom role. To retrieve the name, run ibmcloud catalog service-marketplace.
    description str
    The description of the custom role. Make sure to include information about the level of access this role assignment gives a user.
    iam_custom_role_id str
    (String) The ID of the custom role.
    name str
    The name of the custom role.
    actions List<String>
    Required-A list of action IDs that you want to add to your custom role. The action IDs vary by service. To retrieve supported action IDs, follow the documentation to create the custom role from the console.
    displayName String
    The display name of the custom role.
    service String
    The name of the service for which you want to create the custom role. To retrieve the name, run ibmcloud catalog service-marketplace.
    description String
    The description of the custom role. Make sure to include information about the level of access this role assignment gives a user.
    iamCustomRoleId String
    (String) The ID of the custom role.
    name String
    The name of the custom role.

    Outputs

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

    Crn string
    (String) The CRN of the custom role.
    Id string
    The provider-assigned unique ID for this managed resource.
    ResourceControllerUrl string
    The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource
    ResourceCrn string
    The crn of the resource
    ResourceName string
    The name of the resource
    Crn string
    (String) The CRN of the custom role.
    Id string
    The provider-assigned unique ID for this managed resource.
    ResourceControllerUrl string
    The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource
    ResourceCrn string
    The crn of the resource
    ResourceName string
    The name of the resource
    crn String
    (String) The CRN of the custom role.
    id String
    The provider-assigned unique ID for this managed resource.
    resourceControllerUrl String
    The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource
    resourceCrn String
    The crn of the resource
    resourceName String
    The name of the resource
    crn string
    (String) The CRN of the custom role.
    id string
    The provider-assigned unique ID for this managed resource.
    resourceControllerUrl string
    The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource
    resourceCrn string
    The crn of the resource
    resourceName string
    The name of the resource
    crn str
    (String) The CRN of the custom role.
    id str
    The provider-assigned unique ID for this managed resource.
    resource_controller_url str
    The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource
    resource_crn str
    The crn of the resource
    resource_name str
    The name of the resource
    crn String
    (String) The CRN of the custom role.
    id String
    The provider-assigned unique ID for this managed resource.
    resourceControllerUrl String
    The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource
    resourceCrn String
    The crn of the resource
    resourceName String
    The name of the resource

    Look up Existing IamCustomRole Resource

    Get an existing IamCustomRole 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?: IamCustomRoleState, opts?: CustomResourceOptions): IamCustomRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            actions: Optional[Sequence[str]] = None,
            crn: Optional[str] = None,
            description: Optional[str] = None,
            display_name: Optional[str] = None,
            iam_custom_role_id: Optional[str] = None,
            name: Optional[str] = None,
            resource_controller_url: Optional[str] = None,
            resource_crn: Optional[str] = None,
            resource_name: Optional[str] = None,
            service: Optional[str] = None) -> IamCustomRole
    func GetIamCustomRole(ctx *Context, name string, id IDInput, state *IamCustomRoleState, opts ...ResourceOption) (*IamCustomRole, error)
    public static IamCustomRole Get(string name, Input<string> id, IamCustomRoleState? state, CustomResourceOptions? opts = null)
    public static IamCustomRole get(String name, Output<String> id, IamCustomRoleState state, CustomResourceOptions options)
    resources:  _:    type: ibm:IamCustomRole    get:      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:
    Actions List<string>
    Required-A list of action IDs that you want to add to your custom role. The action IDs vary by service. To retrieve supported action IDs, follow the documentation to create the custom role from the console.
    Crn string
    (String) The CRN of the custom role.
    Description string
    The description of the custom role. Make sure to include information about the level of access this role assignment gives a user.
    DisplayName string
    The display name of the custom role.
    IamCustomRoleId string
    (String) The ID of the custom role.
    Name string
    The name of the custom role.
    ResourceControllerUrl string
    The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource
    ResourceCrn string
    The crn of the resource
    ResourceName string
    The name of the resource
    Service string
    The name of the service for which you want to create the custom role. To retrieve the name, run ibmcloud catalog service-marketplace.
    Actions []string
    Required-A list of action IDs that you want to add to your custom role. The action IDs vary by service. To retrieve supported action IDs, follow the documentation to create the custom role from the console.
    Crn string
    (String) The CRN of the custom role.
    Description string
    The description of the custom role. Make sure to include information about the level of access this role assignment gives a user.
    DisplayName string
    The display name of the custom role.
    IamCustomRoleId string
    (String) The ID of the custom role.
    Name string
    The name of the custom role.
    ResourceControllerUrl string
    The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource
    ResourceCrn string
    The crn of the resource
    ResourceName string
    The name of the resource
    Service string
    The name of the service for which you want to create the custom role. To retrieve the name, run ibmcloud catalog service-marketplace.
    actions List<String>
    Required-A list of action IDs that you want to add to your custom role. The action IDs vary by service. To retrieve supported action IDs, follow the documentation to create the custom role from the console.
    crn String
    (String) The CRN of the custom role.
    description String
    The description of the custom role. Make sure to include information about the level of access this role assignment gives a user.
    displayName String
    The display name of the custom role.
    iamCustomRoleId String
    (String) The ID of the custom role.
    name String
    The name of the custom role.
    resourceControllerUrl String
    The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource
    resourceCrn String
    The crn of the resource
    resourceName String
    The name of the resource
    service String
    The name of the service for which you want to create the custom role. To retrieve the name, run ibmcloud catalog service-marketplace.
    actions string[]
    Required-A list of action IDs that you want to add to your custom role. The action IDs vary by service. To retrieve supported action IDs, follow the documentation to create the custom role from the console.
    crn string
    (String) The CRN of the custom role.
    description string
    The description of the custom role. Make sure to include information about the level of access this role assignment gives a user.
    displayName string
    The display name of the custom role.
    iamCustomRoleId string
    (String) The ID of the custom role.
    name string
    The name of the custom role.
    resourceControllerUrl string
    The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource
    resourceCrn string
    The crn of the resource
    resourceName string
    The name of the resource
    service string
    The name of the service for which you want to create the custom role. To retrieve the name, run ibmcloud catalog service-marketplace.
    actions Sequence[str]
    Required-A list of action IDs that you want to add to your custom role. The action IDs vary by service. To retrieve supported action IDs, follow the documentation to create the custom role from the console.
    crn str
    (String) The CRN of the custom role.
    description str
    The description of the custom role. Make sure to include information about the level of access this role assignment gives a user.
    display_name str
    The display name of the custom role.
    iam_custom_role_id str
    (String) The ID of the custom role.
    name str
    The name of the custom role.
    resource_controller_url str
    The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource
    resource_crn str
    The crn of the resource
    resource_name str
    The name of the resource
    service str
    The name of the service for which you want to create the custom role. To retrieve the name, run ibmcloud catalog service-marketplace.
    actions List<String>
    Required-A list of action IDs that you want to add to your custom role. The action IDs vary by service. To retrieve supported action IDs, follow the documentation to create the custom role from the console.
    crn String
    (String) The CRN of the custom role.
    description String
    The description of the custom role. Make sure to include information about the level of access this role assignment gives a user.
    displayName String
    The display name of the custom role.
    iamCustomRoleId String
    (String) The ID of the custom role.
    name String
    The name of the custom role.
    resourceControllerUrl String
    The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource
    resourceCrn String
    The crn of the resource
    resourceName String
    The name of the resource
    service String
    The name of the service for which you want to create the custom role. To retrieve the name, run ibmcloud catalog service-marketplace.

    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