iam_add_role_to_instance_profile: Adds the specified IAM role to the specified instance profile

Description Usage Arguments Details Request syntax Examples

View source: R/iam_operations.R

Description

Adds the specified IAM role to the specified instance profile. An instance profile can contain only one role, and this limit cannot be increased. You can remove the existing role and then add a different role to an instance profile. You must then wait for the change to appear across all of AWS because of eventual consistency. To force the change, you must disassociate the instance profile and then associate the instance profile, or you can stop your instance and then restart it.

Usage

1
iam_add_role_to_instance_profile(InstanceProfileName, RoleName)

Arguments

InstanceProfileName

[required] The name of the instance profile to update.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: \_+=,[email protected]

RoleName

[required] The name of the role to add.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: \_+=,[email protected]

Details

The caller of this API must be granted the PassRole permission on the IAM role by a permissions policy.

For more information about roles, go to Working with Roles. For more information about instance profiles, go to About Instance Profiles.

Request syntax

1
2
3
4
svc$add_role_to_instance_profile(
  InstanceProfileName = "string",
  RoleName = "string"
)

Examples

1
2
3
4
5
6
# The following command adds the role named S3Access to the instance
# profile named Webserver:
svc$add_role_to_instance_profile(
  InstanceProfileName = "Webserver",
  RoleName = "S3Access"
)

paws.security.identity documentation built on Oct. 30, 2019, 11:26 a.m.