getRole

suspend fun getRole(argument: GetRolePlainArgs): GetRoleResult

This data source can be used to fetch information about a specific IAM role. By using this data source, you can reference IAM role properties without having to hard code ARNs as input.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetRoleArgs;
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 example = IamFunctions.getRole(GetRoleArgs.builder()
.name("an_example_role_name")
.build());
}
}

Return

A collection of values returned by getRole.

Parameters

argument

A collection of arguments for invoking getRole.


suspend fun getRole(name: String, tags: Map<String, String>? = null): GetRoleResult

Return

A collection of values returned by getRole.

Parameters

name

Friendly IAM role name to match.

tags

Tags attached to the role.

See also


suspend fun getRole(argument: suspend GetRolePlainArgsBuilder.() -> Unit): GetRoleResult

Return

A collection of values returned by getRole.

Parameters

argument

Builder for com.pulumi.aws.iam.kotlin.inputs.GetRolePlainArgs.

See also