Creates a new secret access key and corresponding access key ID for the specified Machine User. The default status for new keys is Active.

To ensure the security of your account, the secret access key is accessible only during key and user creation. You must save the key (for example, in a text file) if you want to be able to access it again.

If a secret key is lost, you can delete the access keys for the associated user and then create new keys.

Example

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

import { IdentityClient, CreateAccessKeyCommand } from "@stedi/sdk-client-identity"; // ES Modules import
// const { IdentityClient, CreateAccessKeyCommand } = require("@stedi/sdk-client-identity"); // CommonJS import
const client = new IdentityClient(config);
const input = { // CreateAccessKeyInput
machineUserName: "STRING_VALUE", // required
};
const command = new CreateAccessKeyCommand(input);
const response = await client.send(command);
// { // AccessKeyItemWithSecret
// accessKeyId: "STRING_VALUE", // required
// secretAccessKey: "STRING_VALUE", // required
// createDate: new Date("TIMESTAMP"), // required
// status: "Active" || "Inactive", // required
// lastUsed: new Date("TIMESTAMP"), // required
// };

Param

CreateAccessKeyCommandInput

Returns

CreateAccessKeyCommandOutput

See

Throws

AccessDeniedException (client fault)

Throws

ProductUnavailableException (client fault)

Throws

ResourceAlreadyExistsException (client fault)

Throws

ResourceNotFoundException (client fault)

Throws

ResourceUnderChangeException (client fault)

Throws

ServiceException (server fault)

Throws

IdentityServiceException

Base exception class for all service exceptions from Identity service.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods

  • Returns EndpointParameterInstructions