ec2_associate_iam_instance_profile: Associates an IAM instance profile with a running or stopped...

Description Usage Arguments Value Request syntax Examples

View source: R/ec2_operations.R

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

1
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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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

1
2
3
4
5
6
7
svc$associate_iam_instance_profile(
  IamInstanceProfile = list(
    Arn = "string",
    Name = "string"
  ),
  InstanceId = "string"
)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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)

paws.compute documentation built on Aug. 23, 2021, 9:09 a.m.