Skip to content

Replace Iam Instance Profile Association

ec2_replace_iam_instance_profile_association R Documentation

Replaces an IAM instance profile for the specified running instance

Description

Replaces an IAM instance profile for the specified running instance. You can use this action to change the IAM instance profile that's associated with an instance without having to disassociate the existing IAM instance profile first.

Use describe_iam_instance_profile_associations to get the association ID.

Usage

ec2_replace_iam_instance_profile_association(IamInstanceProfile,
  AssociationId)

Arguments

IamInstanceProfile

[required] The IAM instance profile.

AssociationId

[required] The ID of the existing IAM instance profile association.

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$replace_iam_instance_profile_association(
  IamInstanceProfile = list(
    Arn = "string",
    Name = "string"
  ),
  AssociationId = "string"
)