AWS::APS::Workspace - AWS CloudFormation

AWS::APS::Workspace

An Amazon Managed Service for Prometheus workspace is a logical and isolated Prometheus server dedicated to ingesting, storing, and querying your Prometheus-compatible metrics.

Syntax

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

JSON

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

YAML

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

Properties

AlertManagerDefinition

The alert manager definition, a YAML configuration for the alert manager in your Amazon Managed Service for Prometheus workspace.

For details about the alert manager definition, see Creating an alert manager configuration files in the Amazon Managed Service for Prometheus User Guide.

The following example shows part of a CloudFormation YAML file with an embedded alert manager definition (following the - |-).

Workspace: Type: AWS::APS::Workspace .... Properties: .... AlertManagerDefinition: Fn::Sub: - |- alertmanager_config: | templates: - 'default_template' route: receiver: example-sns receivers: - name: example-sns sns_configs: - topic_arn: 'arn:aws:sns:${AWS::Region}:${AWS::AccountId}:${TopicName}' -

Required: No

Type: String

Update requires: No interruption

Alias

The alias that is assigned to this workspace to help identify it. It does not need to be unique.

Required: No

Type: String

Minimum: 0

Maximum: 100

Update requires: No interruption

KmsKeyArn

(optional) The ARN for a customer managed AWS 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.

Required: No

Type: String

Pattern: ^arn:aws[-a-z]*:kms:[-a-z0-9]+:[0-9]{12}:key/.+$

Minimum: 20

Maximum: 2048

Update requires: Replacement

LoggingConfiguration

Contains information about the logging configuration for the workspace.

Required: No

Type: LoggingConfiguration

Update requires: No interruption

Tags

The list of tag keys and values that are associated with the workspace.

Required: No

Type: Array of Tag

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the resource name. For example:

{ "Ref": "Id" }

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic 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::GetAtt intrinsic function, see Fn::GetAtt.

Arn

The ARN of the workspace. For example, arn:aws:aps:<region>:123456789012:workspace/ws-example1-1234-abcd-5678-ef90abcd1234.

PrometheusEndpoint

The Prometheus endpoint available for this workspace. For example, https://aps-workspaces.<region>.amazonaws.com/workspaces/ws-example1-1234-abcd-5678-ef90abcd1234/api/v1/.

WorkspaceId

The unique ID for the workspace. For example, ws-example1-1234-abcd-5678-ef90abcd1234.

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. You must replace the LogGroupArn with a valid ARN for your system.

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