- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateWorkspaceCommand
Creates a Prometheus workspace. A workspace is a logical space dedicated to the storage and querying of Prometheus metrics. You can have one or more workspaces in each Region in your account.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { AmpClient, CreateWorkspaceCommand } from "@aws-sdk/client-amp"; // ES Modules import
// const { AmpClient, CreateWorkspaceCommand } = require("@aws-sdk/client-amp"); // CommonJS import
const client = new AmpClient(config);
const input = { // CreateWorkspaceRequest
alias: "STRING_VALUE",
clientToken: "STRING_VALUE",
tags: { // TagMap
"<keys>": "STRING_VALUE",
},
kmsKeyArn: "STRING_VALUE",
};
const command = new CreateWorkspaceCommand(input);
const response = await client.send(command);
// { // CreateWorkspaceResponse
// workspaceId: "STRING_VALUE", // required
// arn: "STRING_VALUE", // required
// status: { // WorkspaceStatus
// statusCode: "STRING_VALUE", // required
// },
// tags: { // TagMap
// "<keys>": "STRING_VALUE",
// },
// kmsKeyArn: "STRING_VALUE",
// };
CreateWorkspaceCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
alias | string | undefined | An alias that you assign to this workspace to help you identify it. It does not need to be unique. Blank spaces at the beginning or end of the alias that you specify will be trimmed from the value used. |
clientToken | string | undefined | A unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive. |
kmsKeyArn | string | undefined | (optional) The ARN for a customer managed KMS key to use for encrypting data within your workspace. For more information about using your own key in your workspace, see Encryption at rest in the Amazon Managed Service for Prometheus User Guide. |
tags | Record<string, string> | undefined | The list of tag keys and values to associate with the workspace. |
CreateWorkspaceCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
arn Required | string | undefined | The ARN for the new workspace. |
status Required | WorkspaceStatus | undefined | The current status of the new workspace. Immediately after you create the workspace, the status is usually |
workspaceId Required | string | undefined | The unique ID for the new workspace. |
kmsKeyArn | string | undefined | (optional) If the workspace was created with a customer managed KMS key, the ARN for the key used. |
tags | Record<string, string> | undefined | The list of tag keys and values that are associated with the workspace. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient access to perform this action. |
ConflictException | client | The request would cause an inconsistent state. |
InternalServerException | server | An unexpected error occurred during the processing of the request. |
ServiceQuotaExceededException | client | Completing the request would cause a service quota to be exceeded. |
ThrottlingException | client | The request was denied due to request throttling. |
ValidationException | client | The input fails to satisfy the constraints specified by an Amazon Web Services service. |
AmpServiceException | Base exception class for all service exceptions from Amp service. |