Skip to content
GitHubXDiscord

Group

The Group resource lets you manage AWS XRay Groups for organizing and analyzing traces from your applications.

Create a basic XRay Group with a specified name and a filter expression.

import AWS from "alchemy/aws/control";
const xrayGroup = await AWS.XRay.Group("myXRayGroup", {
GroupName: "MyApplicationGroup",
FilterExpression: "service('MyService')"
});

Configure a group with insights enabled and additional tags.

const insightsGroup = await AWS.XRay.Group("insightsXRayGroup", {
GroupName: "InsightsEnabledGroup",
FilterExpression: "service('MyService')",
InsightsConfiguration: {
InsightsEnabled: true,
NotificationsEnabled: false
},
Tags: [
{ Key: "Environment", Value: "Production" },
{ Key: "Project", Value: "MyProject" }
]
});

Adopt an existing XRay Group instead of failing when the resource already exists.

const existingGroup = await AWS.XRay.Group("existingXRayGroup", {
GroupName: "ExistingGroup",
adopt: true
});

Define a group with customized insights configuration.

const customInsightsGroup = await AWS.XRay.Group("customInsightsXRayGroup", {
GroupName: "CustomInsightsGroup",
InsightsConfiguration: {
InsightsEnabled: true,
NotificationsEnabled: true
}
});