AWS::APS::Workspace - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWS::APS::Workspace

The AWS::APS::Workspace type specifies an Amazon Managed Service for Prometheus (Amazon Managed Service for Prometheus) workspace. A workspace is a logical and isolated Prometheus server dedicated to Prometheus resources such as metrics. You can have one or more workspaces in each Region in your account.

Syntax

To declare this entity in your Amazon CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::APS::Workspace", "Properties" : { "AlertManagerDefinition" : String, "Alias" : String, "LoggingConfiguration" : LoggingConfiguration, "Tags" : [ Tag, ... ] } }

YAML

Type: AWS::APS::Workspace Properties: AlertManagerDefinition: String Alias: String LoggingConfiguration: LoggingConfiguration Tags: - Tag

Properties

AlertManagerDefinition

The alert manager definition for the workspace, as a string. For more information, see Alert manager and templating.

Required: No

Type: String

Update requires: No interruption

Alias

An alias that you assign to this workspace to help you identify it. It does not need to be unique.

The alias can be as many as 100 characters and can include any type of characters. Amazon Managed Service for Prometheus automatically strips any blank spaces from the beginning and end of the alias that you specify.

Required: No

Type: String

Update requires: No interruption

LoggingConfiguration

The LoggingConfiguration attribute is used to set the logging configuration for the workspace.

Required: No

Type: LoggingConfiguration

Update requires: No interruption

Tags

A list of tag keys and values to associate with the workspace.

Required: No

Type: List of Tag

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Reffunction, Refreturns the ARN of the workspace. For example, arn:aws:aps:us-west-2:123456789012:workspace/ws-EXAMPLE-3687-4ac9-853c-EXAMPLEe8f.

For more information about using the Reffunction, see Ref.

Fn::GetAtt

The Fn::GetAttintrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAttintrinsic function, see Fn::GetAtt.

Arn

The ARN of the workspace. For example: arn:aws:aps:us-west-2:123456789012:workspace/ws-EXAMPLE-3687-4ac9-853c-EXAMPLEe8f.

PrometheusEndpoint

The Prometheus endpoint attribute of the workspace. This is the endpoint prefix without the remote_write or query API appended. For example: https://aps-workspaces.us-west-2.amazonaws.com/workspaces/ws-EXAMPLE-3687-4ac9-853c-EXAMPLEe8f/.

WorkspaceId

The workspace ID. For example: ws-EXAMPLE-3687-4ac9-853c-EXAMPLEe8f.

Examples

Amazon Managed Service for Prometheus workspace example

The following example creates an Amazon Managed Service for Prometheus workspace with an alias and one tag.

JSON

{ "Resources": { "APSWorkspace": { "Type": "AWS::APS::Workspace", "Properties": { "Alias": "TestWorkspace" "Tags": [ { "Key": "BusinessPurpose", "Value": "LoadTesting" } ] } } } }

YAML

Resources: APSWorkspace: Type: AWS::APS::Workspace Properties: Alias: TestWorkspace Tags: - Key: BusinessPurpose Value: LoadTesting

Amazon Managed Service for Prometheus logging configuration example

The following example creates a new workspace and sets a new logging configuration.

JSON

{ "Resources": { "APSWorkspace": { "Type": "AWS::APS::Workspace", "Properties": { "Alias": "TestWorkspace", "LoggingConfiguration": { "LogGroupArn": "arn:aws:logs:{region}:{account}:log-group:test-log-group:*" }, "Tags": [ { "Key": "BusinessPurpose", "Value": "LoadTesting" } ] } } } }

YAML

Resources: APSWorkspace: Type: AWS::APS::Workspace Properties: Alias: TestWorkspace LoggingConfiguration: LogGroupArn: "arn:aws:logs:{region}:{account}:log-group:test-log-group:*" Tags: - Key: BusinessPurpose Value: LoadTesting