# RuleActionProperty

The action for a rule to take. Only one of the contained actions can be set.

> This data type is a UNION, so only one of the following members can be specified when used or returned.

- Source: Generated code
- Type last changed: v2.251.0 · 24 Apr 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ses as ses } from 'aws-cdk-lib';

declare const drop: any;
const ruleActionProperty: ses.CfnMailManagerRuleSet.RuleActionProperty = {
  addHeader: {
    headerName: 'headerName',
    headerValue: 'headerValue',
  },
  archive: {
    targetArchive: 'targetArchive',

    // the properties below are optional
    actionFailurePolicy: 'actionFailurePolicy',
  },
  bounce: {
    diagnosticMessage: 'diagnosticMessage',
    roleArn: 'roleArn',
    sender: 'sender',
    smtpReplyCode: 'smtpReplyCode',
    statusCode: 'statusCode',

    // the properties below are optional
    actionFailurePolicy: 'actionFailurePolicy',
    message: 'message',
  },
  deliverToMailbox: {
    mailboxArn: 'mailboxArn',
    roleArn: 'roleArn',

    // the properties below are optional
    actionFailurePolicy: 'actionFailurePolicy',
  },
  deliverToQBusiness: {
    applicationId: 'applicationId',
    indexId: 'indexId',
    roleArn: 'roleArn',

    // the properties below are optional
    actionFailurePolicy: 'actionFailurePolicy',
  },
  drop: drop,
  invokeLambda: {
    functionArn: 'functionArn',
    invocationType: 'invocationType',
    roleArn: 'roleArn',

    // the properties below are optional
    actionFailurePolicy: 'actionFailurePolicy',
    retryTimeMinutes: 123,
  },
  publishToSns: {
    roleArn: 'roleArn',
    topicArn: 'topicArn',

    // the properties below are optional
    actionFailurePolicy: 'actionFailurePolicy',
    encoding: 'encoding',
    payloadType: 'payloadType',
  },
  relay: {
    relay: 'relay',

    // the properties below are optional
    actionFailurePolicy: 'actionFailurePolicy',
    mailFrom: 'mailFrom',
  },
  replaceRecipient: {
    replaceWith: ['replaceWith'],
  },
  send: {
    roleArn: 'roleArn',

    // the properties below are optional
    actionFailurePolicy: 'actionFailurePolicy',
  },
  writeToS3: {
    roleArn: 'roleArn',
    s3Bucket: 's3Bucket',

    // the properties below are optional
    actionFailurePolicy: 'actionFailurePolicy',
    s3Prefix: 's3Prefix',
    s3SseKmsKeyId: 's3SseKmsKeyId',
  },
};
```

## Properties

- `addHeader`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMailManagerRuleSet.AddHeaderActionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ses.CfnMailManagerRuleSet.AddHeaderActionProperty.html) — This action adds a header.

  This can be used to add arbitrary email headers.

- `archive`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMailManagerRuleSet.ArchiveActionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ses.CfnMailManagerRuleSet.ArchiveActionProperty.html) — This action archives the email.

  This can be used to deliver an email to an archive.

- `bounce`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMailManagerRuleSet.BounceActionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ses.CfnMailManagerRuleSet.BounceActionProperty.html)

- `deliverToMailbox`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMailManagerRuleSet.DeliverToMailboxActionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ses.CfnMailManagerRuleSet.DeliverToMailboxActionProperty.html) — This action delivers an email to a WorkMail mailbox.

- `deliverToQBusiness`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMailManagerRuleSet.DeliverToQBusinessActionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ses.CfnMailManagerRuleSet.DeliverToQBusinessActionProperty.html) — This action delivers an email to an Amazon Q Business application for ingestion into its knowledge base.

- `drop`: any — This action terminates the evaluation of rules in the rule set.

- `invokeLambda`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMailManagerRuleSet.InvokeLambdaActionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ses.CfnMailManagerRuleSet.InvokeLambdaActionProperty.html)

- `publishToSns`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMailManagerRuleSet.SnsActionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ses.CfnMailManagerRuleSet.SnsActionProperty.html) — This action publishes the email content to an Amazon SNS topic.

- `relay`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMailManagerRuleSet.RelayActionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ses.CfnMailManagerRuleSet.RelayActionProperty.html) — This action relays the email to another SMTP server.

- `replaceRecipient`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMailManagerRuleSet.ReplaceRecipientActionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ses.CfnMailManagerRuleSet.ReplaceRecipientActionProperty.html) — The action replaces certain or all recipients with a different set of recipients.

- `send`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMailManagerRuleSet.SendActionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ses.CfnMailManagerRuleSet.SendActionProperty.html) — This action sends the email to the internet.

- `writeToS3`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMailManagerRuleSet.S3ActionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ses.CfnMailManagerRuleSet.S3ActionProperty.html) — This action writes the MIME content of the email to an S3 bucket.
