GetRole
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
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Aws.Iam.GetRole.InvokeAsync(new Aws.Iam.GetRoleArgs
{
Name = "an_example_role_name",
}));
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := iam.LookupRole(ctx, &iam.LookupRoleArgs{
Name: "an_example_role_name",
}, nil)
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example = aws.iam.get_role(name="an_example_role_name")import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = pulumi.output(aws.iam.getRole({
name: "an_example_role_name",
}, { async: true }));Using GetRole
function getRole(args: GetRoleArgs, opts?: InvokeOptions): Promise<GetRoleResult>function get_role(name=None, tags=None, opts=None)func LookupRole(ctx *Context, args *LookupRoleArgs, opts ...InvokeOption) (*LookupRoleResult, error)Note: This function is named
LookupRolein the Go SDK.
public static class GetRole {
public static Task<GetRoleResult> InvokeAsync(GetRoleArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
GetRole Result
The following output properties are available:
- Arn string
The Amazon Resource Name (ARN) specifying the role.
- Assume
Role stringPolicy The policy document associated with the role.
- Create
Date string Creation date of the role in RFC 3339 format.
- Description string
Description for the role.
- Id string
The provider-assigned unique ID for this managed resource.
- Max
Session intDuration Maximum session duration.
- Name string
- Path string
The path to the role.
- Permissions
Boundary string The ARN of the policy that is used to set the permissions boundary for the role.
- Dictionary<string, string>
The tags attached to the role.
- Unique
Id string The stable and unique string identifying the role.
- Arn string
The Amazon Resource Name (ARN) specifying the role.
- Assume
Role stringPolicy The policy document associated with the role.
- Create
Date string Creation date of the role in RFC 3339 format.
- Description string
Description for the role.
- Id string
The provider-assigned unique ID for this managed resource.
- Max
Session intDuration Maximum session duration.
- Name string
- Path string
The path to the role.
- Permissions
Boundary string The ARN of the policy that is used to set the permissions boundary for the role.
- map[string]string
The tags attached to the role.
- Unique
Id string The stable and unique string identifying the role.
- arn string
The Amazon Resource Name (ARN) specifying the role.
- assume
Role stringPolicy The policy document associated with the role.
- create
Date string Creation date of the role in RFC 3339 format.
- description string
Description for the role.
- id string
The provider-assigned unique ID for this managed resource.
- max
Session numberDuration Maximum session duration.
- name string
- path string
The path to the role.
- permissions
Boundary string The ARN of the policy that is used to set the permissions boundary for the role.
- {[key: string]: string}
The tags attached to the role.
- unique
Id string The stable and unique string identifying the role.
- arn str
The Amazon Resource Name (ARN) specifying the role.
- assume_
role_ strpolicy The policy document associated with the role.
- create_
date str Creation date of the role in RFC 3339 format.
- description str
Description for the role.
- id str
The provider-assigned unique ID for this managed resource.
- max_
session_ floatduration Maximum session duration.
- name str
- path str
The path to the role.
- permissions_
boundary str The ARN of the policy that is used to set the permissions boundary for the role.
- Dict[str, str]
The tags attached to the role.
- unique_
id str The stable and unique string identifying the role.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.