# S3

Saves the received message to an Amazon S3 bucket and, optionally, publishes a notification to Amazon SNS.

Extends: S3
Implements: IReceiptRuleAction

- Source: [`aws-ses-actions/lib/s3.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-ses-actions/lib/s3.ts#L44)
- Type last changed: v2.235.0 · 15 Jan 2026

## Example

```ts
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as actions from 'aws-cdk-lib/aws-ses-actions';

const bucket = new s3.Bucket(this, 'Bucket');
const topic = new sns.Topic(this, 'Topic');

new ses.ReceiptRuleSet(this, 'RuleSet', {
  rules: [
    {
      recipients: ['hello@aws.com'],
      actions: [
        new actions.AddHeader({
          name: 'X-Special-Header',
          value: 'aws',
        }),
        new actions.S3({
          bucket,
          objectKeyPrefix: 'emails/',
          topic,
        }),
      ],
    },
    {
      recipients: ['aws.com'],
      actions: [
        new actions.Sns({
          topic,
        }),
      ],
    },
  ],
});
```

## Initializer

```ts
new S3(props: S3Props)
```

## Methods

- `bind(rule: IReceiptRuleRef): ReceiptRuleActionConfig` — Returns the receipt rule action specification.
