aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
100 lines (99 loc) • 2.83 kB
TypeScript
import type { Construct } from 'constructs';
import type { ICanary } from './canary';
import type { GroupReference, IGroupRef } from './synthetics.generated';
import * as cdk from '../../core';
/**
* Represents a CloudWatch Synthetics Group
*/
export interface IGroup extends cdk.IResource, IGroupRef {
/**
* The ID of the group
* @attribute
*/
readonly groupId: string;
/**
* The name of the group
* @attribute
*/
readonly groupName: string;
/**
* The ARN of the group
* @attribute
*/
readonly groupArn: string;
}
/**
* Properties for defining a CloudWatch Synthetics Group
*/
export interface GroupProps {
/**
* A name for the group. Must contain only lowercase alphanumeric characters,
* hyphens, or underscores, and be at most 64 characters.
*
* The names for all groups in your account, across all Regions, must be unique.
*
* @default - A unique name will be generated from the construct ID
*/
readonly groupName?: string;
/**
* List of canaries to associate with this group.
*
* Each group can contain as many as 10 canaries.
*
* @default - No canaries are associated with the group initially
*/
readonly canaries?: ICanary[];
}
/**
* Define a new CloudWatch Synthetics Group
*
* Groups allow you to associate canaries with each other, including cross-Region canaries.
* Using groups can help you with managing and automating your canaries, and you can also
* view aggregated run results and statistics for all canaries in a group.
*/
export declare class Group extends cdk.Resource implements IGroup {
/**
* Uniquely identifies this class.
*/
static readonly PROPERTY_INJECTION_ID: string;
/**
* Import an existing group by ARN
*/
static fromGroupArn(scope: Construct, id: string, groupArn: string): IGroup;
/**
* Import an existing group by name
*/
static fromGroupName(scope: Construct, id: string, groupName: string): IGroup;
/**
* The ID of the group
* @attribute
*/
readonly groupId: string;
/**
* The ARN of the group
* @attribute
*/
readonly groupArn: string;
/**
* The name of the group
* @attribute
*/
get groupName(): string;
/**
* A reference to the group.
*/
get groupRef(): GroupReference;
private readonly _resource;
private readonly _canaries;
constructor(scope: Construct, id: string, props?: GroupProps);
/**
* Add a canary to this group
*
* @param canary The canary to add to the group [disable-awslint:prefer-ref-interface]
*/
addCanary(canary: ICanary): void;
/**
* Get all canaries associated with this group
*/
get canaries(): ICanary[];
}