Viewing docs for AWS v7.30.0
published on Thursday, May 14, 2026 by Pulumi
published on Thursday, May 14, 2026 by Pulumi
Viewing docs for AWS v7.30.0
published on Thursday, May 14, 2026 by Pulumi
published on Thursday, May 14, 2026 by Pulumi
Use this data source to get the names of inline policies associated with an IAM role.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.iam.getRolePolicies({
roleName: "my-role-name",
});
import pulumi
import pulumi_aws as aws
example = aws.iam.get_role_policies(role_name="my-role-name")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := iam.GetRolePolicies(ctx, &iam.GetRolePoliciesArgs{
RoleName: "my-role-name",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.Iam.GetRolePolicies.Invoke(new()
{
RoleName = "my-role-name",
});
});
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.GetRolePoliciesArgs;
import java.util.ArrayList;
import java.util.Arrays;
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.getRolePolicies(GetRolePoliciesArgs.builder()
.roleName("my-role-name")
.build());
}
}
variables:
example:
fn::invoke:
function: aws:iam:getRolePolicies
arguments:
roleName: my-role-name
Example coming soon!
Using getRolePolicies
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 getRolePolicies(args: GetRolePoliciesArgs, opts?: InvokeOptions): Promise<GetRolePoliciesResult>
function getRolePoliciesOutput(args: GetRolePoliciesOutputArgs, opts?: InvokeOptions): Output<GetRolePoliciesResult>def get_role_policies(role_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRolePoliciesResult
def get_role_policies_output(role_name: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRolePoliciesResult]func GetRolePolicies(ctx *Context, args *GetRolePoliciesArgs, opts ...InvokeOption) (*GetRolePoliciesResult, error)
func GetRolePoliciesOutput(ctx *Context, args *GetRolePoliciesOutputArgs, opts ...InvokeOption) GetRolePoliciesResultOutput> Note: This function is named GetRolePolicies in the Go SDK.
public static class GetRolePolicies
{
public static Task<GetRolePoliciesResult> InvokeAsync(GetRolePoliciesArgs args, InvokeOptions? opts = null)
public static Output<GetRolePoliciesResult> Invoke(GetRolePoliciesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRolePoliciesResult> getRolePolicies(GetRolePoliciesArgs args, InvokeOptions options)
public static Output<GetRolePoliciesResult> getRolePolicies(GetRolePoliciesArgs args, InvokeOptions options)
fn::invoke:
function: aws:iam/getRolePolicies:getRolePolicies
arguments:
# arguments dictionarydata "aws_iam_getrolepolicies" "name" {
# arguments
}The following arguments are supported:
- Role
Name string - Name of the IAM role.
- Role
Name string - Name of the IAM role.
- role_
name string - Name of the IAM role.
- role
Name String - Name of the IAM role.
- role
Name string - Name of the IAM role.
- role_
name str - Name of the IAM role.
- role
Name String - Name of the IAM role.
getRolePolicies Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy
Names List<string> - Set of inline policy names associated with the role.
- Role
Name string
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy
Names []string - Set of inline policy names associated with the role.
- Role
Name string
- id string
- The provider-assigned unique ID for this managed resource.
- policy_
names list(string) - Set of inline policy names associated with the role.
- role_
name string
- id String
- The provider-assigned unique ID for this managed resource.
- policy
Names List<String> - Set of inline policy names associated with the role.
- role
Name String
- id string
- The provider-assigned unique ID for this managed resource.
- policy
Names string[] - Set of inline policy names associated with the role.
- role
Name string
- id str
- The provider-assigned unique ID for this managed resource.
- policy_
names Sequence[str] - Set of inline policy names associated with the role.
- role_
name str
- id String
- The provider-assigned unique ID for this managed resource.
- policy
Names List<String> - Set of inline policy names associated with the role.
- role
Name String
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
Viewing docs for AWS v7.30.0
published on Thursday, May 14, 2026 by Pulumi
published on Thursday, May 14, 2026 by Pulumi
