or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

configuration-sets.mdemail-sending.mdidentity-management.mdindex.mdreceipt-processing.mdstatistics-monitoring.mdtemplate-management.mdutilities.md
tile.json

configuration-sets.mddocs/

Configuration Sets

Email tracking and analytics configuration with event destinations, reputation metrics, and delivery options for detailed email performance monitoring. Configuration sets enable you to track email sending metrics and configure how SES handles your emails.

Capabilities

Configuration Set Management

Create, manage, and configure email tracking sets.

/**
 * Creates a configuration set for email tracking
 * @param input - Configuration set definition
 * @returns Promise with operation result
 */
interface CreateConfigurationSetCommandInput {
  /** Configuration set definition */
  ConfigurationSet: ConfigurationSet;
}

interface CreateConfigurationSetCommandOutput {
  $metadata: ResponseMetadata;
}

/**
 * Deletes a configuration set
 * @param input - Configuration set name to delete
 * @returns Promise with operation result
 */
interface DeleteConfigurationSetCommandInput {
  /** Name of configuration set to delete */
  ConfigurationSetName: string;
}

interface DeleteConfigurationSetCommandOutput {
  $metadata: ResponseMetadata;
}

/**
 * Gets configuration set details and attributes
 * @param input - Configuration set name and optional attribute filters
 * @returns Promise with configuration set information
 */
interface DescribeConfigurationSetCommandInput {
  /** Name of configuration set to describe */
  ConfigurationSetName: string;
  /** List of attributes to retrieve */
  ConfigurationSetAttributeNames?: ConfigurationSetAttribute[];
}

interface DescribeConfigurationSetCommandOutput {
  /** Configuration set information */
  ConfigurationSet?: ConfigurationSet;
  /** Event destinations */
  EventDestinations?: EventDestination[];
  /** Tracking options */
  TrackingOptions?: TrackingOptions;
  /** Delivery options */
  DeliveryOptions?: DeliveryOptions;
  /** Reputation tracking options */
  ReputationOptions?: ReputationOptions;
  $metadata: ResponseMetadata;
}

/**
 * Lists all configuration sets
 * @param input - Optional pagination parameters
 * @returns Promise with configuration set list
 */
interface ListConfigurationSetsCommandInput {
  /** Token for pagination */
  NextToken?: string;
  /** Maximum number of results */
  MaxItems?: number;
}

interface ListConfigurationSetsCommandOutput {
  /** List of configuration sets */
  ConfigurationSets?: ConfigurationSet[];
  /** Token for next page of results */
  NextToken?: string;
  $metadata: ResponseMetadata;
}

Usage Example:

import { 
  SESClient, 
  CreateConfigurationSetCommand,
  DescribeConfigurationSetCommand,
  ListConfigurationSetsCommand 
} from "@aws-sdk/client-ses";

const client = new SESClient({ region: "us-east-1" });

// Create configuration set
const createCommand = new CreateConfigurationSetCommand({
  ConfigurationSet: {
    Name: "marketing-emails",
  },
});
await client.send(createCommand);

// List all configuration sets
const listCommand = new ListConfigurationSetsCommand({});
const configSets = await client.send(listCommand);
console.log("Configuration sets:", configSets.ConfigurationSets);

// Get detailed information
const describeCommand = new DescribeConfigurationSetCommand({
  ConfigurationSetName: "marketing-emails",
  ConfigurationSetAttributeNames: ["eventDestinations", "trackingOptions"],
});
const details = await client.send(describeCommand);

Event Destinations

Configure destinations for email events (opens, clicks, bounces, complaints).

/**
 * Creates an event destination for a configuration set
 * @param input - Configuration set name and event destination
 * @returns Promise with operation result
 */
interface CreateConfigurationSetEventDestinationCommandInput {
  /** Name of configuration set */
  ConfigurationSetName: string;
  /** Event destination configuration */
  EventDestination: EventDestination;
}

interface CreateConfigurationSetEventDestinationCommandOutput {
  $metadata: ResponseMetadata;
}

/**
 * Updates an event destination
 * @param input - Configuration set name and updated event destination
 * @returns Promise with operation result
 */
interface UpdateConfigurationSetEventDestinationCommandInput {
  /** Name of configuration set */
  ConfigurationSetName: string;
  /** Updated event destination configuration */
  EventDestination: EventDestination;
}

interface UpdateConfigurationSetEventDestinationCommandOutput {
  $metadata: ResponseMetadata;
}

/**
 * Deletes an event destination
 * @param input - Configuration set and event destination names
 * @returns Promise with operation result
 */
interface DeleteConfigurationSetEventDestinationCommandInput {
  /** Name of configuration set */
  ConfigurationSetName: string;
  /** Name of event destination to delete */
  EventDestinationName: string;
}

interface DeleteConfigurationSetEventDestinationCommandOutput {
  $metadata: ResponseMetadata;
}

Usage Example:

import { 
  SESClient, 
  CreateConfigurationSetEventDestinationCommand 
} from "@aws-sdk/client-ses";

const client = new SESClient({ region: "us-east-1" });

// Create CloudWatch event destination
const cloudWatchDestination = new CreateConfigurationSetEventDestinationCommand({
  ConfigurationSetName: "marketing-emails",
  EventDestination: {
    Name: "cloudwatch-events",
    Enabled: true,
    MatchingEventTypes: ["send", "bounce", "complaint", "delivery", "click", "open"],
    CloudWatchDestination: {
      DimensionConfigurations: [
        {
          DimensionName: "MessageTag",
          DimensionValueSource: "messageTag",
          DefaultDimensionValue: "default",
        },
        {
          DimensionName: "EmailAddress", 
          DimensionValueSource: "emailHeader",
          DefaultDimensionValue: "unknown",
        },
      ],
    },
  },
});
await client.send(cloudWatchDestination);

// Create SNS event destination
const snsDestination = new CreateConfigurationSetEventDestinationCommand({
  ConfigurationSetName: "marketing-emails",
  EventDestination: {
    Name: "sns-notifications",
    Enabled: true,
    MatchingEventTypes: ["bounce", "complaint"],
    SNSDestination: {
      TopicArn: "arn:aws:sns:us-east-1:123456789012:ses-events",
    },
  },
});
await client.send(snsDestination);

Tracking Options

Configure custom domain for click and open tracking.

/**
 * Creates tracking options for a configuration set
 * @param input - Configuration set name and tracking options
 * @returns Promise with operation result
 */
interface CreateConfigurationSetTrackingOptionsCommandInput {
  /** Name of configuration set */
  ConfigurationSetName: string;
  /** Tracking options configuration */
  TrackingOptions: TrackingOptions;
}

interface CreateConfigurationSetTrackingOptionsCommandOutput {
  $metadata: ResponseMetadata;
}

/**
 * Updates tracking options for a configuration set
 * @param input - Configuration set name and updated tracking options
 * @returns Promise with operation result
 */
interface UpdateConfigurationSetTrackingOptionsCommandInput {
  /** Name of configuration set */
  ConfigurationSetName: string;
  /** Updated tracking options configuration */
  TrackingOptions: TrackingOptions;
}

interface UpdateConfigurationSetTrackingOptionsCommandOutput {
  $metadata: ResponseMetadata;
}

/**
 * Deletes tracking options from a configuration set
 * @param input - Configuration set name
 * @returns Promise with operation result
 */
interface DeleteConfigurationSetTrackingOptionsCommandInput {
  /** Name of configuration set */
  ConfigurationSetName: string;
}

interface DeleteConfigurationSetTrackingOptionsCommandOutput {
  $metadata: ResponseMetadata;
}

Delivery Options

Configure TLS requirements for email delivery.

/**
 * Sets delivery options for a configuration set
 * @param input - Configuration set name and delivery options
 * @returns Promise with operation result
 */
interface PutConfigurationSetDeliveryOptionsCommandInput {
  /** Name of configuration set */
  ConfigurationSetName: string;
  /** Delivery options configuration */
  DeliveryOptions?: DeliveryOptions;
}

interface PutConfigurationSetDeliveryOptionsCommandOutput {
  $metadata: ResponseMetadata;
}

Configuration Set Settings

Enable or disable sending and reputation tracking for configuration sets.

/**
 * Enables or disables email sending for a configuration set
 * @param input - Configuration set name and enabled status
 * @returns Promise with operation result
 */
interface UpdateConfigurationSetSendingEnabledCommandInput {
  /** Name of configuration set */
  ConfigurationSetName: string;
  /** Whether sending is enabled */
  Enabled: boolean;
}

interface UpdateConfigurationSetSendingEnabledCommandOutput {
  $metadata: ResponseMetadata;
}

/**
 * Enables or disables reputation metrics for a configuration set
 * @param input - Configuration set name and enabled status
 * @returns Promise with operation result
 */
interface UpdateConfigurationSetReputationMetricsEnabledCommandInput {
  /** Name of configuration set */
  ConfigurationSetName: string;
  /** Whether reputation metrics are enabled */
  Enabled: boolean;
}

interface UpdateConfigurationSetReputationMetricsEnabledCommandOutput {
  $metadata: ResponseMetadata;
}

Core Types

Configuration Set Definition

interface ConfigurationSet {
  /** Unique configuration set name */
  Name: string;
}

type ConfigurationSetAttribute = 
  | "eventDestinations" 
  | "trackingOptions" 
  | "deliveryOptions" 
  | "reputationOptions";

Event Destinations

interface EventDestination {
  /** Event destination name */
  Name: string;
  /** Whether the destination is enabled */
  Enabled?: boolean;
  /** Types of events to capture */
  MatchingEventTypes: EventType[];
  /** CloudWatch destination configuration */
  CloudWatchDestination?: CloudWatchDestination;
  /** Kinesis Firehose destination configuration */
  KinesisFirehoseDestination?: KinesisFirehoseDestination;
  /** SNS destination configuration */
  SNSDestination?: SNSDestination;
}

interface CloudWatchDestination {
  /** Dimension configurations for metrics */
  DimensionConfigurations: CloudWatchDimensionConfiguration[];
}

interface CloudWatchDimensionConfiguration {
  /** Dimension name */
  DimensionName: string;
  /** Source of dimension value */
  DimensionValueSource: DimensionValueSource;
  /** Default value when source is unavailable */
  DefaultDimensionValue: string;
}

interface KinesisFirehoseDestination {
  /** IAM role ARN for Kinesis Firehose access */
  IAMRoleArn: string;
  /** Kinesis Firehose delivery stream ARN */
  DeliveryStreamArn: string;
}

interface SNSDestination {
  /** SNS topic ARN */
  TopicArn: string;
}

type EventType = 
  | "send" 
  | "reject" 
  | "bounce" 
  | "complaint" 
  | "delivery" 
  | "click" 
  | "open" 
  | "renderingFailure";

type DimensionValueSource = "messageTag" | "emailHeader" | "linkTag";

Tracking and Delivery Options

interface TrackingOptions {
  /** Custom domain for tracking links */
  CustomRedirectDomain?: string;
}

interface DeliveryOptions {
  /** TLS policy for email delivery */
  TlsPolicy?: TlsPolicy;
}

interface ReputationOptions {
  /** Whether reputation tracking is enabled */
  ReputationMetricsEnabled?: boolean;
  /** Last time reputation was reset */
  LastFreshStart?: Date;
}

type TlsPolicy = "Require" | "Optional";

Error Handling

class ConfigurationSetAlreadyExistsException extends SESServiceException {
  name: "ConfigurationSetAlreadyExistsException";
}

class ConfigurationSetDoesNotExistException extends SESServiceException {
  name: "ConfigurationSetDoesNotExistException";
}

class InvalidConfigurationSetException extends SESServiceException {
  name: "InvalidConfigurationSetException";
}

class EventDestinationAlreadyExistsException extends SESServiceException {
  name: "EventDestinationAlreadyExistsException";
}

class EventDestinationDoesNotExistException extends SESServiceException {
  name: "EventDestinationDoesNotExistException";
}

class InvalidCloudWatchDestinationException extends SESServiceException {
  name: "InvalidCloudWatchDestinationException";
}

class InvalidFirehoseDestinationException extends SESServiceException {
  name: "InvalidFirehoseDestinationException";
}

class InvalidSNSDestinationException extends SESServiceException {
  name: "InvalidSNSDestinationException";
}

class InvalidTrackingOptionsException extends SESServiceException {
  name: "InvalidTrackingOptionsException";
}

class TrackingOptionsAlreadyExistsException extends SESServiceException {
  name: "TrackingOptionsAlreadyExistsException";
}

class InvalidDeliveryOptionsException extends SESServiceException {
  name: "InvalidDeliveryOptionsException";
}

Complete Configuration Set Setup Example:

import { 
  SESClient, 
  CreateConfigurationSetCommand,
  CreateConfigurationSetEventDestinationCommand,
  CreateConfigurationSetTrackingOptionsCommand,
  PutConfigurationSetDeliveryOptionsCommand,
  UpdateConfigurationSetReputationMetricsEnabledCommand 
} from "@aws-sdk/client-ses";

const client = new SESClient({ region: "us-east-1" });

// 1. Create configuration set
await client.send(new CreateConfigurationSetCommand({
  ConfigurationSet: { Name: "newsletter-tracking" },
}));

// 2. Add CloudWatch event destination
await client.send(new CreateConfigurationSetEventDestinationCommand({
  ConfigurationSetName: "newsletter-tracking",
  EventDestination: {
    Name: "analytics",
    Enabled: true,
    MatchingEventTypes: ["send", "bounce", "complaint", "delivery", "click", "open"],
    CloudWatchDestination: {
      DimensionConfigurations: [
        {
          DimensionName: "Campaign",
          DimensionValueSource: "messageTag",
          DefaultDimensionValue: "unknown",
        },
        {
          DimensionName: "List",
          DimensionValueSource: "messageTag", 
          DefaultDimensionValue: "general",
        },
      ],
    },
  },
}));

// 3. Add SNS destination for issues
await client.send(new CreateConfigurationSetEventDestinationCommand({
  ConfigurationSetName: "newsletter-tracking",
  EventDestination: {
    Name: "alerts",
    Enabled: true,
    MatchingEventTypes: ["bounce", "complaint"],
    SNSDestination: {
      TopicArn: "arn:aws:sns:us-east-1:123456789012:email-issues",
    },
  },
}));

// 4. Configure custom tracking domain
await client.send(new CreateConfigurationSetTrackingOptionsCommand({
  ConfigurationSetName: "newsletter-tracking",
  TrackingOptions: {
    CustomRedirectDomain: "links.newsletter.com",
  },
}));

// 5. Require TLS for delivery
await client.send(new PutConfigurationSetDeliveryOptionsCommand({
  ConfigurationSetName: "newsletter-tracking",
  DeliveryOptions: {
    TlsPolicy: "Require",
  },
}));

// 6. Enable reputation tracking
await client.send(new UpdateConfigurationSetReputationMetricsEnabledCommand({
  ConfigurationSetName: "newsletter-tracking",
  Enabled: true,
}));

console.log("Configuration set 'newsletter-tracking' fully configured");

// Now use in email sending
import { SendEmailCommand } from "@aws-sdk/client-ses";

const emailCommand = new SendEmailCommand({
  Source: "newsletter@company.com",
  Destination: { ToAddresses: ["subscriber@example.com"] },
  Message: {
    Subject: { Data: "Weekly Newsletter" },
    Body: { Html: { Data: "<h1>This Week's News</h1><p>Content here...</p>" } },
  },
  ConfigurationSetName: "newsletter-tracking",
  Tags: [
    { Name: "Campaign", Value: "weekly" },
    { Name: "List", Value: "subscribers" },
  ],
});

await client.send(emailCommand);