Skip to content

Associate Iam Instance Profile

ec2_associate_iam_instance_profile R Documentation

Associates an IAM instance profile with a running or stopped instance

Description

Associates an IAM instance profile with a running or stopped instance. You cannot associate more than one IAM instance profile with an instance.

Usage

ec2_associate_iam_instance_profile(IamInstanceProfile, InstanceId)

Arguments

IamInstanceProfile

[required] The IAM instance profile.

InstanceId

[required] The ID of the instance.

Value

A list with the following syntax:

list(
  IamInstanceProfileAssociation = list(
    AssociationId = "string",
    InstanceId = "string",
    IamInstanceProfile = list(
      Arn = "string",
      Id = "string"
    ),
    State = "associating"|"associated"|"disassociating"|"disassociated",
    Timestamp = as.POSIXct(
      "2015-01-01"
    )
  )
)

Request syntax

svc$associate_iam_instance_profile(
  IamInstanceProfile = list(
    Arn = "string",
    Name = "string"
  ),
  InstanceId = "string"
)

Examples

## Not run: 
# This example associates an IAM instance profile named admin-role with
# the specified instance.
svc$associate_iam_instance_profile(
  IamInstanceProfile = list(
    Name = "admin-role"
  ),
  InstanceId = "i-123456789abcde123"
)

## End(Not run)