Jump to Content

Class CreateAccountAliasCommandProtected

Creates an alias for your Amazon Web Services account. For information about using an Amazon Web Services account alias, see Using an alias for your Amazon Web Services account ID in the IAM User Guide.

Example

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

import { IAMClient, CreateAccountAliasCommand } from "@aws-sdk/client-iam"; // ES Modules import
// const { IAMClient, CreateAccountAliasCommand } = require("@aws-sdk/client-iam"); // CommonJS import
const client = new IAMClient(config);
const input = {
AccountAlias: "STRING_VALUE", // required
};
const command = new CreateAccountAliasCommand(input);
const response = await client.send(command);

Param

CreateAccountAliasCommandInput

Returns

CreateAccountAliasCommandOutput

See

Throws

EntityAlreadyExistsException (client fault)

The request was rejected because it attempted to create a resource that already exists.

Throws

LimitExceededException (client fault)

The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.

Throws

ServiceFailureException (server fault)

The request processing has failed because of an unknown error, exception or failure.

Example

To create an account alias

// The following command associates the alias examplecorp to your AWS account.
const input = {
"AccountAlias": "examplecorp"
};
const command = new CreateAccountAliasCommand(input);
await client.send(command);
// example id: 5adaf6fb-94fc-4ca2-b825-2fbc2062add1

Hierarchy

Constructors

Properties

Methods