1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIamRoleTemplate
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 an iam_role_template. 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 iamRoleTemplate = ibm.getIamRoleTemplate({});
    
    import pulumi
    import pulumi_ibm as ibm
    
    iam_role_template = ibm.get_iam_role_template()
    
    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.LookupIamRoleTemplate(ctx, &ibm.LookupIamRoleTemplateArgs{}, 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 iamRoleTemplate = Ibm.GetIamRoleTemplate.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.GetIamRoleTemplateArgs;
    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 iamRoleTemplate = IbmFunctions.getIamRoleTemplate(GetIamRoleTemplateArgs.builder()
                .build());
    
        }
    }
    
    variables:
      iamRoleTemplate:
        fn::invoke:
          function: ibm:getIamRoleTemplate
          arguments: {}
    

    Using getIamRoleTemplate

    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 getIamRoleTemplate(args: GetIamRoleTemplateArgs, opts?: InvokeOptions): Promise<GetIamRoleTemplateResult>
    function getIamRoleTemplateOutput(args: GetIamRoleTemplateOutputArgs, opts?: InvokeOptions): Output<GetIamRoleTemplateResult>
    def get_iam_role_template(id: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetIamRoleTemplateResult
    def get_iam_role_template_output(id: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetIamRoleTemplateResult]
    func LookupIamRoleTemplate(ctx *Context, args *LookupIamRoleTemplateArgs, opts ...InvokeOption) (*LookupIamRoleTemplateResult, error)
    func LookupIamRoleTemplateOutput(ctx *Context, args *LookupIamRoleTemplateOutputArgs, opts ...InvokeOption) LookupIamRoleTemplateResultOutput

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

    public static class GetIamRoleTemplate 
    {
        public static Task<GetIamRoleTemplateResult> InvokeAsync(GetIamRoleTemplateArgs args, InvokeOptions? opts = null)
        public static Output<GetIamRoleTemplateResult> Invoke(GetIamRoleTemplateInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIamRoleTemplateResult> getIamRoleTemplate(GetIamRoleTemplateArgs args, InvokeOptions options)
    public static Output<GetIamRoleTemplateResult> getIamRoleTemplate(GetIamRoleTemplateArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getIamRoleTemplate:getIamRoleTemplate
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    Id string
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    id String
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    id string
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    id str
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    id String
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.

    getIamRoleTemplate Result

    The following output properties are available:

    Id string
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    RoleTemplates List<GetIamRoleTemplateRoleTemplate>
    (List) List of role templates.

    • Constraints: The maximum length is 100 items. The minimum length is 0 items. Nested schema for role_templates:
    Id string
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    RoleTemplates []GetIamRoleTemplateRoleTemplate
    (List) List of role templates.

    • Constraints: The maximum length is 100 items. The minimum length is 0 items. Nested schema for role_templates:
    id String
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    roleTemplates List<GetIamRoleTemplateRoleTemplate>
    (List) List of role templates.

    • Constraints: The maximum length is 100 items. The minimum length is 0 items. Nested schema for role_templates:
    id string
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    roleTemplates GetIamRoleTemplateRoleTemplate[]
    (List) List of role templates.

    • Constraints: The maximum length is 100 items. The minimum length is 0 items. Nested schema for role_templates:
    id str
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    role_templates Sequence[GetIamRoleTemplateRoleTemplate]
    (List) List of role templates.

    • Constraints: The maximum length is 100 items. The minimum length is 0 items. Nested schema for role_templates:
    id String
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    roleTemplates List<Property Map>
    (List) List of role templates.

    • Constraints: The maximum length is 100 items. The minimum length is 0 items. Nested schema for role_templates:

    Supporting Types

    GetIamRoleTemplateRoleTemplate

    AccountId string
    (String) Enterprise account ID where this template is created.

    • Constraints: The maximum length is 32 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9-]*$/.
    Committed bool
    (Boolean) Committed status of the template. If committed is set to true, then the template version can no longer be updated.
    Description string
    (String) Description of the role.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character. The value must match regular expression /^.*$/.
    Id string
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    Name string
    (String) The name of the role that is used in the CRN. This must be alphanumeric and capitalized.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character. The value must match regular expression /^[A-Z]{1}[A-Za-z0-9]{0,29}$/.
    Roles List<GetIamRoleTemplateRoleTemplateRole>
    (List) The role properties that are created in an action resource when the template is assigned. Nested schema for role:
    Version string
    (String) The version number of the template used to identify different versions of same template.

    • Constraints: The maximum length is 2 characters. The minimum length is 1 character. The value must match regular expression /^[0-9]*$/.
    AccountId string
    (String) Enterprise account ID where this template is created.

    • Constraints: The maximum length is 32 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9-]*$/.
    Committed bool
    (Boolean) Committed status of the template. If committed is set to true, then the template version can no longer be updated.
    Description string
    (String) Description of the role.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character. The value must match regular expression /^.*$/.
    Id string
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    Name string
    (String) The name of the role that is used in the CRN. This must be alphanumeric and capitalized.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character. The value must match regular expression /^[A-Z]{1}[A-Za-z0-9]{0,29}$/.
    Roles []GetIamRoleTemplateRoleTemplateRole
    (List) The role properties that are created in an action resource when the template is assigned. Nested schema for role:
    Version string
    (String) The version number of the template used to identify different versions of same template.

    • Constraints: The maximum length is 2 characters. The minimum length is 1 character. The value must match regular expression /^[0-9]*$/.
    accountId String
    (String) Enterprise account ID where this template is created.

    • Constraints: The maximum length is 32 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9-]*$/.
    committed Boolean
    (Boolean) Committed status of the template. If committed is set to true, then the template version can no longer be updated.
    description String
    (String) Description of the role.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character. The value must match regular expression /^.*$/.
    id String
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    name String
    (String) The name of the role that is used in the CRN. This must be alphanumeric and capitalized.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character. The value must match regular expression /^[A-Z]{1}[A-Za-z0-9]{0,29}$/.
    roles List<GetIamRoleTemplateRoleTemplateRole>
    (List) The role properties that are created in an action resource when the template is assigned. Nested schema for role:
    version String
    (String) The version number of the template used to identify different versions of same template.

    • Constraints: The maximum length is 2 characters. The minimum length is 1 character. The value must match regular expression /^[0-9]*$/.
    accountId string
    (String) Enterprise account ID where this template is created.

    • Constraints: The maximum length is 32 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9-]*$/.
    committed boolean
    (Boolean) Committed status of the template. If committed is set to true, then the template version can no longer be updated.
    description string
    (String) Description of the role.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character. The value must match regular expression /^.*$/.
    id string
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    name string
    (String) The name of the role that is used in the CRN. This must be alphanumeric and capitalized.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character. The value must match regular expression /^[A-Z]{1}[A-Za-z0-9]{0,29}$/.
    roles GetIamRoleTemplateRoleTemplateRole[]
    (List) The role properties that are created in an action resource when the template is assigned. Nested schema for role:
    version string
    (String) The version number of the template used to identify different versions of same template.

    • Constraints: The maximum length is 2 characters. The minimum length is 1 character. The value must match regular expression /^[0-9]*$/.
    account_id str
    (String) Enterprise account ID where this template is created.

    • Constraints: The maximum length is 32 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9-]*$/.
    committed bool
    (Boolean) Committed status of the template. If committed is set to true, then the template version can no longer be updated.
    description str
    (String) Description of the role.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character. The value must match regular expression /^.*$/.
    id str
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    name str
    (String) The name of the role that is used in the CRN. This must be alphanumeric and capitalized.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character. The value must match regular expression /^[A-Z]{1}[A-Za-z0-9]{0,29}$/.
    roles Sequence[GetIamRoleTemplateRoleTemplateRole]
    (List) The role properties that are created in an action resource when the template is assigned. Nested schema for role:
    version str
    (String) The version number of the template used to identify different versions of same template.

    • Constraints: The maximum length is 2 characters. The minimum length is 1 character. The value must match regular expression /^[0-9]*$/.
    accountId String
    (String) Enterprise account ID where this template is created.

    • Constraints: The maximum length is 32 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9-]*$/.
    committed Boolean
    (Boolean) Committed status of the template. If committed is set to true, then the template version can no longer be updated.
    description String
    (String) Description of the role.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character. The value must match regular expression /^.*$/.
    id String
    (String) The role template ID.

    • Constraints: The maximum length is 49 characters. The minimum length is 1 character. The value must match regular expression /^roleTemplate-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.
    name String
    (String) The name of the role that is used in the CRN. This must be alphanumeric and capitalized.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character. The value must match regular expression /^[A-Z]{1}[A-Za-z0-9]{0,29}$/.
    roles List<Property Map>
    (List) The role properties that are created in an action resource when the template is assigned. Nested schema for role:
    version String
    (String) The version number of the template used to identify different versions of same template.

    • Constraints: The maximum length is 2 characters. The minimum length is 1 character. The value must match regular expression /^[0-9]*$/.

    GetIamRoleTemplateRoleTemplateRole

    Actions List<string>
    (List) The actions of the role.

    • Constraints: The minimum length is 1 item.
    Description string
    (String) Description of the role.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character. The value must match regular expression /^.*$/.
    DisplayName string
    (String) The display the name of the role that is shown in the console.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character. The value must match regular expression /^((?!<|>).)*$/.
    Name string
    (String) The name of the role that is used in the CRN. This must be alphanumeric and capitalized.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character. The value must match regular expression /^[A-Z]{1}[A-Za-z0-9]{0,29}$/.
    ServiceName string
    (String) The service name that the role refers.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character.
    Actions []string
    (List) The actions of the role.

    • Constraints: The minimum length is 1 item.
    Description string
    (String) Description of the role.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character. The value must match regular expression /^.*$/.
    DisplayName string
    (String) The display the name of the role that is shown in the console.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character. The value must match regular expression /^((?!<|>).)*$/.
    Name string
    (String) The name of the role that is used in the CRN. This must be alphanumeric and capitalized.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character. The value must match regular expression /^[A-Z]{1}[A-Za-z0-9]{0,29}$/.
    ServiceName string
    (String) The service name that the role refers.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character.
    actions List<String>
    (List) The actions of the role.

    • Constraints: The minimum length is 1 item.
    description String
    (String) Description of the role.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character. The value must match regular expression /^.*$/.
    displayName String
    (String) The display the name of the role that is shown in the console.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character. The value must match regular expression /^((?!<|>).)*$/.
    name String
    (String) The name of the role that is used in the CRN. This must be alphanumeric and capitalized.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character. The value must match regular expression /^[A-Z]{1}[A-Za-z0-9]{0,29}$/.
    serviceName String
    (String) The service name that the role refers.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character.
    actions string[]
    (List) The actions of the role.

    • Constraints: The minimum length is 1 item.
    description string
    (String) Description of the role.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character. The value must match regular expression /^.*$/.
    displayName string
    (String) The display the name of the role that is shown in the console.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character. The value must match regular expression /^((?!<|>).)*$/.
    name string
    (String) The name of the role that is used in the CRN. This must be alphanumeric and capitalized.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character. The value must match regular expression /^[A-Z]{1}[A-Za-z0-9]{0,29}$/.
    serviceName string
    (String) The service name that the role refers.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character.
    actions Sequence[str]
    (List) The actions of the role.

    • Constraints: The minimum length is 1 item.
    description str
    (String) Description of the role.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character. The value must match regular expression /^.*$/.
    display_name str
    (String) The display the name of the role that is shown in the console.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character. The value must match regular expression /^((?!<|>).)*$/.
    name str
    (String) The name of the role that is used in the CRN. This must be alphanumeric and capitalized.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character. The value must match regular expression /^[A-Z]{1}[A-Za-z0-9]{0,29}$/.
    service_name str
    (String) The service name that the role refers.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character.
    actions List<String>
    (List) The actions of the role.

    • Constraints: The minimum length is 1 item.
    description String
    (String) Description of the role.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character. The value must match regular expression /^.*$/.
    displayName String
    (String) The display the name of the role that is shown in the console.

    • Constraints: The maximum length is 50 characters. The minimum length is 1 character. The value must match regular expression /^((?!<|>).)*$/.
    name String
    (String) The name of the role that is used in the CRN. This must be alphanumeric and capitalized.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character. The value must match regular expression /^[A-Z]{1}[A-Za-z0-9]{0,29}$/.
    serviceName String
    (String) The service name that the role refers.

    • Constraints: The maximum length is 300 characters. The minimum length is 1 character.

    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