Skip to content

Assume Root

sts_assume_root R Documentation

Returns a set of short term credentials you can use to perform privileged tasks on a member account in your organization

Description

Returns a set of short term credentials you can use to perform privileged tasks on a member account in your organization.

Before you can launch a privileged session, you must have centralized root access in your organization. For steps to enable this feature, see Centralize root access for member accounts in the IAM User Guide.

The STS global endpoint is not supported for AssumeRoot. You must send this request to a Regional STS endpoint. For more information, see Endpoints.

You can track AssumeRoot in CloudTrail logs to determine what actions were performed in a session. For more information, see Track privileged tasks in CloudTrail in the IAM User Guide.

Usage

sts_assume_root(TargetPrincipal, TaskPolicyArn, DurationSeconds)

Arguments

TargetPrincipal

[required] The member account principal ARN or account ID.

TaskPolicyArn

[required] The identity based policy that scopes the session to the privileged tasks that can be performed. You can use one of following Amazon Web Services managed policies to scope root session actions.

DurationSeconds

The duration, in seconds, of the privileged session. The value can range from 0 seconds up to the maximum session duration of 900 seconds (15 minutes). If you specify a value higher than this setting, the operation fails.

By default, the value is set to 900 seconds.

Value

A list with the following syntax:

list(
  Credentials = list(
    AccessKeyId = "string",
    SecretAccessKey = "string",
    SessionToken = "string",
    Expiration = as.POSIXct(
      "2015-01-01"
    )
  ),
  SourceIdentity = "string"
)

Request syntax

svc$assume_root(
  TargetPrincipal = "string",
  TaskPolicyArn = list(
    arn = "string"
  ),
  DurationSeconds = 123
)