1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIamRoles
ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud

ibm.getIamRoles

Explore with Pulumi AI

Retrieve information about supported IAM roles for an IBM Cloud service. For more information, about IAM role action, see actions and roles for account management services.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";

const test = ibm.getIamRoles({
    service: "kms",
});
Copy
import pulumi
import pulumi_ibm as ibm

test = ibm.get_iam_roles(service="kms")
Copy
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.GetIamRoles(ctx, &ibm.GetIamRolesArgs{
			Service: pulumi.StringRef("kms"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;

return await Deployment.RunAsync(() => 
{
    var test = Ibm.GetIamRoles.Invoke(new()
    {
        Service = "kms",
    });

});
Copy
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.GetIamRolesArgs;
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 test = IbmFunctions.getIamRoles(GetIamRolesArgs.builder()
            .service("kms")
            .build());

    }
}
Copy
variables:
  test:
    fn::invoke:
      function: ibm:getIamRoles
      arguments:
        service: kms
Copy

Using getIamRoles

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 getIamRoles(args: GetIamRolesArgs, opts?: InvokeOptions): Promise<GetIamRolesResult>
function getIamRolesOutput(args: GetIamRolesOutputArgs, opts?: InvokeOptions): Output<GetIamRolesResult>
Copy
def get_iam_roles(id: Optional[str] = None,
                  service: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetIamRolesResult
def get_iam_roles_output(id: Optional[pulumi.Input[str]] = None,
                  service: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetIamRolesResult]
Copy
func GetIamRoles(ctx *Context, args *GetIamRolesArgs, opts ...InvokeOption) (*GetIamRolesResult, error)
func GetIamRolesOutput(ctx *Context, args *GetIamRolesOutputArgs, opts ...InvokeOption) GetIamRolesResultOutput
Copy

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

public static class GetIamRoles 
{
    public static Task<GetIamRolesResult> InvokeAsync(GetIamRolesArgs args, InvokeOptions? opts = null)
    public static Output<GetIamRolesResult> Invoke(GetIamRolesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetIamRolesResult> getIamRoles(GetIamRolesArgs args, InvokeOptions options)
public static Output<GetIamRolesResult> getIamRoles(GetIamRolesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: ibm:index/getIamRoles:getIamRoles
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Id string
(String) The ID of your IBM Cloud account.
Service string
The name of the IBM Cloud service for which you want to list supported IAM For account management services, you can find supported values in the documentation. For other services, run the ibmcloud catalog service-marketplace command and retrieve the value from the Name column of your command line output.
Id string
(String) The ID of your IBM Cloud account.
Service string
The name of the IBM Cloud service for which you want to list supported IAM For account management services, you can find supported values in the documentation. For other services, run the ibmcloud catalog service-marketplace command and retrieve the value from the Name column of your command line output.
id String
(String) The ID of your IBM Cloud account.
service String
The name of the IBM Cloud service for which you want to list supported IAM For account management services, you can find supported values in the documentation. For other services, run the ibmcloud catalog service-marketplace command and retrieve the value from the Name column of your command line output.
id string
(String) The ID of your IBM Cloud account.
service string
The name of the IBM Cloud service for which you want to list supported IAM For account management services, you can find supported values in the documentation. For other services, run the ibmcloud catalog service-marketplace command and retrieve the value from the Name column of your command line output.
id str
(String) The ID of your IBM Cloud account.
service str
The name of the IBM Cloud service for which you want to list supported IAM For account management services, you can find supported values in the documentation. For other services, run the ibmcloud catalog service-marketplace command and retrieve the value from the Name column of your command line output.
id String
(String) The ID of your IBM Cloud account.
service String
The name of the IBM Cloud service for which you want to list supported IAM For account management services, you can find supported values in the documentation. For other services, run the ibmcloud catalog service-marketplace command and retrieve the value from the Name column of your command line output.

getIamRoles Result

The following output properties are available:

Id string
(String) The ID of your IBM Cloud account.
Roles List<GetIamRolesRole>
(List) A list of supported IAM service access, platform, and custom roles for an IBM Cloud service.
Service string
Id string
(String) The ID of your IBM Cloud account.
Roles []GetIamRolesRole
(List) A list of supported IAM service access, platform, and custom roles for an IBM Cloud service.
Service string
id String
(String) The ID of your IBM Cloud account.
roles List<GetIamRolesRole>
(List) A list of supported IAM service access, platform, and custom roles for an IBM Cloud service.
service String
id string
(String) The ID of your IBM Cloud account.
roles GetIamRolesRole[]
(List) A list of supported IAM service access, platform, and custom roles for an IBM Cloud service.
service string
id str
(String) The ID of your IBM Cloud account.
roles Sequence[GetIamRolesRole]
(List) A list of supported IAM service access, platform, and custom roles for an IBM Cloud service.
service str
id String
(String) The ID of your IBM Cloud account.
roles List<Property Map>
(List) A list of supported IAM service access, platform, and custom roles for an IBM Cloud service.
service String

Supporting Types

GetIamRolesRole

Description This property is required. string
(String) The description of the role.
Name This property is required. string
(String) The name of the role.
Type This property is required. string
(String) The type of the role. Supported values are service, platform, and custom.
Description This property is required. string
(String) The description of the role.
Name This property is required. string
(String) The name of the role.
Type This property is required. string
(String) The type of the role. Supported values are service, platform, and custom.
description This property is required. String
(String) The description of the role.
name This property is required. String
(String) The name of the role.
type This property is required. String
(String) The type of the role. Supported values are service, platform, and custom.
description This property is required. string
(String) The description of the role.
name This property is required. string
(String) The name of the role.
type This property is required. string
(String) The type of the role. Supported values are service, platform, and custom.
description This property is required. str
(String) The description of the role.
name This property is required. str
(String) The name of the role.
type This property is required. str
(String) The type of the role. Supported values are service, platform, and custom.
description This property is required. String
(String) The description of the role.
name This property is required. String
(String) The name of the role.
type This property is required. String
(String) The type of the role. Supported values are service, platform, and custom.

Package Details

Repository
ibm ibm-cloud/terraform-provider-ibm
License
Notes
This Pulumi package is based on the ibm Terraform Provider.