AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.9.2 published on Friday, Jun 24, 2022 by Pulumi

getInstanceProfiles

This data source can be used to fetch information about all IAM instance profiles under a role. By using this data source, you can reference IAM instance profile 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.GetInstanceProfiles.InvokeAsync(new Aws.Iam.GetInstanceProfilesArgs
        {
            RoleName = "an_example_iam_role_name",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/iam"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := iam.GetInstanceProfiles(ctx, &iam.GetInstanceProfilesArgs{
			RoleName: "an_example_iam_role_name",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = Output.of(IamFunctions.getInstanceProfiles(GetInstanceProfilesArgs.builder()
            .roleName("an_example_iam_role_name")
            .build()));

    }
}
import pulumi
import pulumi_aws as aws

example = aws.iam.get_instance_profiles(role_name="an_example_iam_role_name")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.iam.getInstanceProfiles({
    roleName: "an_example_iam_role_name",
}));
variables:
  example:
    Fn::Invoke:
      Function: aws:iam:getInstanceProfiles
      Arguments:
        roleName: an_example_iam_role_name

Using getInstanceProfiles

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 getInstanceProfiles(args: GetInstanceProfilesArgs, opts?: InvokeOptions): Promise<GetInstanceProfilesResult>
function getInstanceProfilesOutput(args: GetInstanceProfilesOutputArgs, opts?: InvokeOptions): Output<GetInstanceProfilesResult>
def get_instance_profiles(role_name: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetInstanceProfilesResult
def get_instance_profiles_output(role_name: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetInstanceProfilesResult]
func GetInstanceProfiles(ctx *Context, args *GetInstanceProfilesArgs, opts ...InvokeOption) (*GetInstanceProfilesResult, error)
func GetInstanceProfilesOutput(ctx *Context, args *GetInstanceProfilesOutputArgs, opts ...InvokeOption) GetInstanceProfilesResultOutput

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

public static class GetInstanceProfiles 
{
    public static Task<GetInstanceProfilesResult> InvokeAsync(GetInstanceProfilesArgs args, InvokeOptions? opts = null)
    public static Output<GetInstanceProfilesResult> Invoke(GetInstanceProfilesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstanceProfilesResult> getInstanceProfiles(GetInstanceProfilesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:iam/getInstanceProfiles:getInstanceProfiles
  Arguments:
    # Arguments dictionary

The following arguments are supported:

RoleName string

The IAM role name.

RoleName string

The IAM role name.

roleName String

The IAM role name.

roleName string

The IAM role name.

role_name str

The IAM role name.

roleName String

The IAM role name.

getInstanceProfiles Result

The following output properties are available:

Arns List<string>

Set of Amazon Resource Name (ARN) specifying the instance profile.

Id string

The provider-assigned unique ID for this managed resource.

Names List<string>

Set of IAM instance profile names.

Paths List<string>

Set of IAM instance profile paths.

RoleName string
Arns []string

Set of Amazon Resource Name (ARN) specifying the instance profile.

Id string

The provider-assigned unique ID for this managed resource.

Names []string

Set of IAM instance profile names.

Paths []string

Set of IAM instance profile paths.

RoleName string
arns List<String>

Set of Amazon Resource Name (ARN) specifying the instance profile.

id String

The provider-assigned unique ID for this managed resource.

names List<String>

Set of IAM instance profile names.

paths List<String>

Set of IAM instance profile paths.

roleName String
arns string[]

Set of Amazon Resource Name (ARN) specifying the instance profile.

id string

The provider-assigned unique ID for this managed resource.

names string[]

Set of IAM instance profile names.

paths string[]

Set of IAM instance profile paths.

roleName string
arns Sequence[str]

Set of Amazon Resource Name (ARN) specifying the instance profile.

id str

The provider-assigned unique ID for this managed resource.

names Sequence[str]

Set of IAM instance profile names.

paths Sequence[str]

Set of IAM instance profile paths.

role_name str
arns List<String>

Set of Amazon Resource Name (ARN) specifying the instance profile.

id String

The provider-assigned unique ID for this managed resource.

names List<String>

Set of IAM instance profile names.

paths List<String>

Set of IAM instance profile paths.

roleName String

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.