Segment
The Segment resource lets you manage AWS Evidently Segments for targeting specific user groups in your experiments and feature launches.
Minimal Example
Section titled “Minimal Example”Create a basic segment with a pattern and description.
import AWS from "alchemy/aws/control";
const userSegment = await AWS.Evidently.Segment("user-segment", { Name: "ActiveUsers", Pattern: "{ \"type\": \"user\", \"active\": true }", Description: "Segment for users who are currently active."});
Advanced Configuration
Section titled “Advanced Configuration”Configure a segment with tags for better organization and management.
const taggedSegment = await AWS.Evidently.Segment("tagged-segment", { Name: "VIPUsers", Pattern: "{ \"type\": \"user\", \"status\": \"VIP\" }", Description: "Segment for VIP users.", Tags: [ { Key: "Environment", Value: "Production" }, { Key: "Team", Value: "Marketing" } ]});
Adopting an Existing Segment
Section titled “Adopting an Existing Segment”Use the adopt
property to adopt an existing segment instead of failing if it already exists.
const existingSegment = await AWS.Evidently.Segment("existing-segment", { Name: "ExistingSegmentName", Pattern: "{ \"type\": \"user\", \"existing\": true }", Description: "This segment is adopted to avoid conflicts.", adopt: true});