GetManagedEndpointSessionCredentialsCommand

Generate a session token to connect to a managed endpoint.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { EMRContainersClient, GetManagedEndpointSessionCredentialsCommand } from "@aws-sdk/client-emr-containers"; // ES Modules import
// const { EMRContainersClient, GetManagedEndpointSessionCredentialsCommand } = require("@aws-sdk/client-emr-containers"); // CommonJS import
const client = new EMRContainersClient(config);
const input = { // GetManagedEndpointSessionCredentialsRequest
  endpointIdentifier: "STRING_VALUE", // required
  virtualClusterIdentifier: "STRING_VALUE", // required
  executionRoleArn: "STRING_VALUE", // required
  credentialType: "STRING_VALUE", // required
  durationInSeconds: Number("int"),
  logContext: "STRING_VALUE",
  clientToken: "STRING_VALUE",
};
const command = new GetManagedEndpointSessionCredentialsCommand(input);
const response = await client.send(command);
// { // GetManagedEndpointSessionCredentialsResponse
//   id: "STRING_VALUE",
//   credentials: { // Credentials Union: only one key present
//     token: "STRING_VALUE",
//   },
//   expiresAt: new Date("TIMESTAMP"),
// };

GetManagedEndpointSessionCredentialsCommand Input

Parameter
Type
Description
credentialType
Required
string | undefined

Type of the token requested. Currently supported and default value of this field is “TOKEN.”

endpointIdentifier
Required
string | undefined

The ARN of the managed endpoint for which the request is submitted.

executionRoleArn
Required
string | undefined

The IAM Execution Role ARN that will be used by the job run.

virtualClusterIdentifier
Required
string | undefined

The ARN of the Virtual Cluster which the Managed Endpoint belongs to.

clientToken
string | undefined

The client idempotency token of the job run request.

durationInSeconds
number | undefined

Duration in seconds for which the session token is valid. The default duration is 15 minutes and the maximum is 12 hours.

logContext
string | undefined

String identifier used to separate sections of the execution logs uploaded to S3.

GetManagedEndpointSessionCredentialsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
credentials
Credentials | undefined

The structure containing the session credentials.

expiresAt
Date | undefined

The date and time when the session token will expire.

id
string | undefined

The identifier of the session token returned.

Throws

Name
Fault
Details
InternalServerException
server

This is an internal server exception.

RequestThrottledException
client

The request throttled.

ResourceNotFoundException
client

The specified resource was not found.

ValidationException
client

There are invalid parameters in the client request.

EMRContainersServiceException
Base exception class for all service exceptions from EMRContainers service.