Skip to content
v2.278.0

CfnWorkspaceProps Struct ​

Properties for defining a CfnWorkspace.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_aps as aps } from 'aws-cdk-lib';
const cfnWorkspaceProps: aps.CfnWorkspaceProps = {
  alertManagerDefinition: 'alertManagerDefinition',
  alias: 'alias',
  kmsKeyArn: 'kmsKeyArn',
  loggingConfiguration: {
    logGroupArn: 'logGroupArn',
  },
  queryLoggingConfiguration: {
    destinations: [{
      cloudWatchLogs: {
        logGroupArn: 'logGroupArn',
      },
      filters: {
        qspThreshold: 123,
      },
    }],
  },
  tags: [{
    key: 'key',
    value: 'value',
  }],
  workspaceConfiguration: {
    limitsPerLabelSets: [{
      labelSet: [{
        name: 'name',
        value: 'value',
      }],
      limits: {
        maxSeries: 123,
      },
    }],
    outOfOrderTimeWindowInSeconds: 123,
    retentionPeriodInDays: 123,
    ruleQueryOffsetInSeconds: 123,
  },
};
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_aps as aps

cfn_workspace_props = aps.CfnWorkspaceProps(
    alert_manager_definition="alertManagerDefinition",
    alias="alias",
    kms_key_arn="kmsKeyArn",
    logging_configuration=aps.CfnWorkspace.LoggingConfigurationProperty(
        log_group_arn="logGroupArn"
    ),
    query_logging_configuration=aps.CfnWorkspace.QueryLoggingConfigurationProperty(
        destinations=[aps.CfnWorkspace.LoggingDestinationProperty(
            cloud_watch_logs=aps.CfnWorkspace.CloudWatchLogDestinationProperty(
                log_group_arn="logGroupArn"
            ),
            filters=aps.CfnWorkspace.LoggingFilterProperty(
                qsp_threshold=123
            )
        )]
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    workspace_configuration=aps.CfnWorkspace.WorkspaceConfigurationProperty(
        limits_per_label_sets=[aps.CfnWorkspace.LimitsPerLabelSetProperty(
            label_set=[aps.CfnWorkspace.LabelProperty(
                name="name",
                value="value"
            )],
            limits=aps.CfnWorkspace.LimitsPerLabelSetEntryProperty(
                max_series=123
            )
        )],
        out_of_order_time_window_in_seconds=123,
        retention_period_in_days=123,
        rule_query_offset_in_seconds=123
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.aps.*;

CfnWorkspaceProps cfnWorkspaceProps = CfnWorkspaceProps.builder()
        .alertManagerDefinition("alertManagerDefinition")
        .alias("alias")
        .kmsKeyArn("kmsKeyArn")
        .loggingConfiguration(LoggingConfigurationProperty.builder()
                .logGroupArn("logGroupArn")
                .build())
        .queryLoggingConfiguration(QueryLoggingConfigurationProperty.builder()
                .destinations(List.of(LoggingDestinationProperty.builder()
                        .cloudWatchLogs(CloudWatchLogDestinationProperty.builder()
                                .logGroupArn("logGroupArn")
                                .build())
                        .filters(LoggingFilterProperty.builder()
                                .qspThreshold(123)
                                .build())
                        .build()))
                .build())
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .workspaceConfiguration(WorkspaceConfigurationProperty.builder()
                .limitsPerLabelSets(List.of(LimitsPerLabelSetProperty.builder()
                        .labelSet(List.of(LabelProperty.builder()
                                .name("name")
                                .value("value")
                                .build()))
                        .limits(LimitsPerLabelSetEntryProperty.builder()
                                .maxSeries(123)
                                .build())
                        .build()))
                .outOfOrderTimeWindowInSeconds(123)
                .retentionPeriodInDays(123)
                .ruleQueryOffsetInSeconds(123)
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APS;

var cfnWorkspaceProps = new CfnWorkspaceProps {
    AlertManagerDefinition = "alertManagerDefinition",
    Alias = "alias",
    KmsKeyArn = "kmsKeyArn",
    LoggingConfiguration = new LoggingConfigurationProperty {
        LogGroupArn = "logGroupArn"
    },
    QueryLoggingConfiguration = new QueryLoggingConfigurationProperty {
        Destinations = new [] { new LoggingDestinationProperty {
            CloudWatchLogs = new CloudWatchLogDestinationProperty {
                LogGroupArn = "logGroupArn"
            },
            Filters = new LoggingFilterProperty {
                QspThreshold = 123
            }
        } }
    },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    WorkspaceConfiguration = new WorkspaceConfigurationProperty {
        LimitsPerLabelSets = new [] { new LimitsPerLabelSetProperty {
            LabelSet = new [] { new LabelProperty {
                Name = "name",
                Value = "value"
            } },
            Limits = new LimitsPerLabelSetEntryProperty {
                MaxSeries = 123
            }
        } },
        OutOfOrderTimeWindowInSeconds = 123,
        RetentionPeriodInDays = 123,
        RuleQueryOffsetInSeconds = 123
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnWorkspaceProps := &CfnWorkspaceProps{
	AlertManagerDefinition: jsii.String("alertManagerDefinition"),
	Alias: jsii.String("alias"),
	KmsKeyArn: jsii.String("kmsKeyArn"),
	LoggingConfiguration: &LoggingConfigurationProperty{
		LogGroupArn: jsii.String("logGroupArn"),
	},
	QueryLoggingConfiguration: &QueryLoggingConfigurationProperty{
		Destinations: []interface{}{
			&LoggingDestinationProperty{
				CloudWatchLogs: &CloudWatchLogDestinationProperty{
					LogGroupArn: jsii.String("logGroupArn"),
				},
				Filters: &LoggingFilterProperty{
					QspThreshold: jsii.Number(123),
				},
			},
		},
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	WorkspaceConfiguration: &WorkspaceConfigurationProperty{
		LimitsPerLabelSets: []interface{}{
			&LimitsPerLabelSetProperty{
				LabelSet: []interface{}{
					&LabelProperty{
						Name: jsii.String("name"),
						Value: jsii.String("value"),
					},
				},
				Limits: &LimitsPerLabelSetEntryProperty{
					MaxSeries: jsii.Number(123),
				},
			},
		},
		OutOfOrderTimeWindowInSeconds: jsii.Number(123),
		RetentionPeriodInDays: jsii.Number(123),
		RuleQueryOffsetInSeconds: jsii.Number(123),
	},
}

Properties ​

alertManagerDefinitionoptionalstringalert_manager_definitionoptionalstralertManagerDefinitionoptionalStringAlertManagerDefinitionoptionalstringAlertManagerDefinitionoptional*string #
The alert manager definition, a YAML configuration for the alert manager in your Amazon Managed Service for Prometheus workspace.
notes

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}' -

aliasoptionalstringaliasoptionalstraliasoptionalStringAliasoptionalstringAliasoptional*string #
The alias that is assigned to this workspace to help identify it.

It does not need to be unique.

kmsKeyArnoptionalstringkms_key_arnoptionalstrkmsKeyArnoptionalStringKmsKeyArnoptionalstringKmsKeyArnoptional*string #
(optional) The ARN for a customer managed AWS key to use for encrypting data within your workspace.
notes

For more information about using your own key in your workspace, see Encryption at rest in the Amazon Managed Service for Prometheus User Guide .

loggingConfigurationoptionalIResolvable | CfnWorkspace.LoggingConfigurationPropertylogging_configurationoptionaltyping.Union[IResolvable, LoggingConfigurationProperty]loggingConfigurationoptionalIResolvableLoggingConfigurationoptionalIResolvableLoggingConfigurationoptionalinterface{} #
Contains information about the logging configuration for the workspace.
queryLoggingConfigurationoptionalIResolvable | CfnWorkspace.QueryLoggingConfigurationPropertyquery_logging_configurationoptionaltyping.Union[IResolvable, QueryLoggingConfigurationProperty]queryLoggingConfigurationoptionalIResolvableQueryLoggingConfigurationoptionalIResolvableQueryLoggingConfigurationoptionalinterface{} #
The definition of logging configuration in an Amazon Managed Service for Prometheus workspace.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #
The list of tag keys and values that are associated with the workspace.
workspaceConfigurationoptionalIResolvable | CfnWorkspace.WorkspaceConfigurationPropertyworkspace_configurationoptionaltyping.Union[IResolvable, WorkspaceConfigurationProperty]workspaceConfigurationoptionalIResolvableWorkspaceConfigurationoptionalIResolvableWorkspaceConfigurationoptionalinterface{} #
Use this structure to define label sets and the ingestion limits for time series that match label sets, and to specify the retention period of the workspace.