Skip to content

Get Authorization Token

ecr_get_authorization_token R Documentation

Retrieves an authorization token

Description

Retrieves an authorization token. An authorization token represents your IAM authentication credentials and can be used to access any Amazon ECR registry that your IAM principal has access to. The authorization token is valid for 12 hours.

The authorizationToken returned is a base64 encoded string that can be decoded and used in a ⁠docker login⁠ command to authenticate to a registry. The CLI offers an get-login-password command that simplifies the login process. For more information, see Registry authentication in the Amazon Elastic Container Registry User Guide.

Usage

ecr_get_authorization_token(registryIds)

Arguments

registryIds

A list of Amazon Web Services account IDs that are associated with the registries for which to get AuthorizationData objects. If you do not specify a registry, the default registry is assumed.

Value

A list with the following syntax:

list(
  authorizationData = list(
    list(
      authorizationToken = "string",
      expiresAt = as.POSIXct(
        "2015-01-01"
      ),
      proxyEndpoint = "string"
    )
  )
)

Request syntax

svc$get_authorization_token(
  registryIds = list(
    "string"
  )
)

Examples

## Not run: 
# This example gets an authorization token for your default registry.
svc$get_authorization_token()

## End(Not run)