class Group (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Synthetics.Group |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awssynthetics#Group |
Java | software.amazon.awscdk.services.synthetics.Group |
Python | aws_cdk.aws_synthetics.Group |
TypeScript (source) | aws-cdk-lib » aws_synthetics » Group |
Implements
IConstruct, IDependable, IResource, IEnvironment, IGroup, IGroup
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.
Example
declare const canary: synthetics.ICanary;
const group = new synthetics.Group(this, 'MyCanaryGroup');
// Add canary to group
group.addCanary(canary);
Initializer
new Group(scope: Construct, id: string, props?: GroupProps)
Parameters
- scope
Construct - id
string - props
GroupProps
Construct Props
| Name | Type | Description |
|---|---|---|
| canaries? | ICanary[] | List of canaries to associate with this group. |
| group | string | A name for the group. Must contain only lowercase alphanumeric characters, hyphens, or underscores, and be at most 64 characters. |
canaries?
Type:
ICanary[]
(optional, default: No canaries are associated with the group initially)
List of canaries to associate with this group.
Each group can contain as many as 10 canaries.
groupName?
Type:
string
(optional, default: A unique name will be generated from the construct ID)
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.
Properties
| Name | Type | Description |
|---|---|---|
| canaries | ICanary[] | Get all canaries associated with this group. |
| env | Resource | The environment this resource belongs to. |
| group | string | The ARN of the group. |
| group | string | The ID of the group. |
| group | string | The name of the group. |
| group | Group | A reference to the group. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
canaries
Type:
ICanary[]
Get all canaries associated with this group.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
groupArn
Type:
string
The ARN of the group.
groupId
Type:
string
The ID of the group.
groupName
Type:
string
The name of the group.
groupRef
Type:
Group
A reference to the group.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| add | Add a canary to this group. |
| apply | Apply the given removal policy to this resource. |
| to | Returns a string representation of this construct. |
| with(...mixins) | Applies one or more mixins to this construct. |
| static from | Import an existing group by ARN. |
| static from | Import an existing group by name. |
addCanary(canary)
public addCanary(canary: ICanary): void
Parameters
- canary
ICanary— The canary to add to the group [disable-awslint:prefer-ref-interface].
Add a canary to this group.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
with(...mixins)
public with(...mixins: IMixin[]): IConstruct
Parameters
- mixins
IMixin
Returns
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
static fromGroupArn(scope, id, groupArn)
public static fromGroupArn(scope: Construct, id: string, groupArn: string): IGroup
Parameters
- scope
Construct - id
string - groupArn
string
Returns
Import an existing group by ARN.
static fromGroupName(scope, id, groupName)
public static fromGroupName(scope: Construct, id: string, groupName: string): IGroup
Parameters
- scope
Construct - id
string - groupName
string
Returns
Import an existing group by name.

.NET
Go
Java
Python
TypeScript (