AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 2022 by Pulumi

getInstanceProfile

This data source can be used to fetch information about a specific IAM instance profile. 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.GetInstanceProfile.InvokeAsync(new Aws.Iam.GetInstanceProfileArgs
        {
            Name = "an_example_instance_profile_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.LookupInstanceProfile(ctx, &iam.LookupInstanceProfileArgs{
			Name: "an_example_instance_profile_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.getInstanceProfile(GetInstanceProfileArgs.builder()
            .name("an_example_instance_profile_name")
            .build()));

        }
}
import pulumi
import pulumi_aws as aws

example = aws.iam.get_instance_profile(name="an_example_instance_profile_name")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.iam.getInstanceProfile({
    name: "an_example_instance_profile_name",
}));
variables:
  example:
    Fn::Invoke:
      Function: aws:iam:getInstanceProfile
      Arguments:
        name: an_example_instance_profile_name

Using getInstanceProfile

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 getInstanceProfile(args: GetInstanceProfileArgs, opts?: InvokeOptions): Promise<GetInstanceProfileResult>
function getInstanceProfileOutput(args: GetInstanceProfileOutputArgs, opts?: InvokeOptions): Output<GetInstanceProfileResult>
def get_instance_profile(name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetInstanceProfileResult
def get_instance_profile_output(name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetInstanceProfileResult]
func LookupInstanceProfile(ctx *Context, args *LookupInstanceProfileArgs, opts ...InvokeOption) (*LookupInstanceProfileResult, error)
func LookupInstanceProfileOutput(ctx *Context, args *LookupInstanceProfileOutputArgs, opts ...InvokeOption) LookupInstanceProfileResultOutput

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

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

The following arguments are supported:

Name string

The friendly IAM instance profile name to match.

Name string

The friendly IAM instance profile name to match.

name String

The friendly IAM instance profile name to match.

name string

The friendly IAM instance profile name to match.

name str

The friendly IAM instance profile name to match.

name String

The friendly IAM instance profile name to match.

getInstanceProfile Result

The following output properties are available:

Arn string

The Amazon Resource Name (ARN) specifying the instance profile.

CreateDate string

The string representation of the date the instance profile was created.

Id string

The provider-assigned unique ID for this managed resource.

Name string
Path string

The path to the instance profile.

RoleArn string

The role arn associated with this instance profile.

RoleId string

The role id associated with this instance profile.

RoleName string

The role name associated with this instance profile.

Arn string

The Amazon Resource Name (ARN) specifying the instance profile.

CreateDate string

The string representation of the date the instance profile was created.

Id string

The provider-assigned unique ID for this managed resource.

Name string
Path string

The path to the instance profile.

RoleArn string

The role arn associated with this instance profile.

RoleId string

The role id associated with this instance profile.

RoleName string

The role name associated with this instance profile.

arn String

The Amazon Resource Name (ARN) specifying the instance profile.

createDate String

The string representation of the date the instance profile was created.

id String

The provider-assigned unique ID for this managed resource.

name String
path String

The path to the instance profile.

roleArn String

The role arn associated with this instance profile.

roleId String

The role id associated with this instance profile.

roleName String

The role name associated with this instance profile.

arn string

The Amazon Resource Name (ARN) specifying the instance profile.

createDate string

The string representation of the date the instance profile was created.

id string

The provider-assigned unique ID for this managed resource.

name string
path string

The path to the instance profile.

roleArn string

The role arn associated with this instance profile.

roleId string

The role id associated with this instance profile.

roleName string

The role name associated with this instance profile.

arn str

The Amazon Resource Name (ARN) specifying the instance profile.

create_date str

The string representation of the date the instance profile was created.

id str

The provider-assigned unique ID for this managed resource.

name str
path str

The path to the instance profile.

role_arn str

The role arn associated with this instance profile.

role_id str

The role id associated with this instance profile.

role_name str

The role name associated with this instance profile.

arn String

The Amazon Resource Name (ARN) specifying the instance profile.

createDate String

The string representation of the date the instance profile was created.

id String

The provider-assigned unique ID for this managed resource.

name String
path String

The path to the instance profile.

roleArn String

The role arn associated with this instance profile.

roleId String

The role id associated with this instance profile.

roleName String

The role name associated with this instance profile.

Package Details

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

This Pulumi package is based on the aws Terraform Provider.