|
| 1 | +--- |
| 2 | +title: AWS S3 (Actions) Destination |
| 3 | +hide-boilerplate: true |
| 4 | +hide-dossier: false |
| 5 | +id: 66eaa166f650644f04389e2c |
| 6 | +private: true |
| 7 | +beta: true |
| 8 | +# versions: |
| 9 | +# - name: AWS S3 (Classic) |
| 10 | +# link: /docs/connections/destinations/catalog/aws-s3/ |
| 11 | +--- |
| 12 | +{% include content/plan-grid.md name="actions" %} |
| 13 | + |
| 14 | +The AWS S3 (Actions) destination allows you to store event data as objects in a secure, scalable cloud storage solution. Each event is written to your S3 bucket, organized into a customizable folder structure such as by event type or timestamp. This makes it easy to manage, archive, and analyze data using downstream tools or AWS services. |
| 15 | + |
| 16 | + |
| 17 | +## Benefits of AWS S3 (Actions) vs AWS S3 Classic |
| 18 | +The traditional AWS S3 Classic destination enabled the storage of raw logs containing data Segment received, directly into your S3 bucket. While this provided a straightforward data storage solution, users often needed to implement additional processing to standardize or transform these logs (in JSON format) for downstream analytics or integrations. |
| 19 | + |
| 20 | +The AWS S3 (Actions) destination enhances this capability by introducing configurable options to format and structure event data prior to storage. This new approach offers several key benefits: |
| 21 | + |
| 22 | +* **Standardized Data Formatting**. AWS S3 (Actions) lets you define consistent output formats for your data, either CSV or TXT file formats, in a folder definition that you choose. The previous AWS S3 Classic Destination only allowed raw JSON payloads stored within a specific folder called `"segment-logs"`. |
| 23 | + |
| 24 | +* **Configurable Data Translation**. AWS S3 (Actions) supports translation rules that can map raw event attributes to more meaningful or actionable representations. You can configure these rules to meet specific data schema requirements by either adding in custom columns or using the default ones. |
| 25 | + |
| 26 | +* **Enhanced Delivery Controls**. The destination provides advanced options for batch size controls and file naming conventions. These controls can help optimize efficiency and simplify data retrieval workflows. |
| 27 | + |
| 28 | +## Getting started |
| 29 | +Setting up the AWS S3 (Actions) destination is a straightforward process designed to help you configure and deploy standardized event data to your Amazon S3 bucket. Follow these steps to get started: |
| 30 | + |
| 31 | +### Prerequisites |
| 32 | +Ensure you have the following in place before configuring the AWS S3 (Actions) destination: |
| 33 | + |
| 34 | +- Amazon S3 Bucket: Create a bucket in your AWS account or use an existing one where you want to store the event data. |
| 35 | +- AWS IAM Permissions: Verify that you have appropriate IAM roles with write access to the S3 bucket and permissions for the Segment connection. |
| 36 | +- IAM Access IDs: Prepare your AWS IAM ARN ID and IAM External ID. These will be needed to authenticate and authorize Segment with your S3 bucket. |
| 37 | + |
| 38 | + |
| 39 | +### Step 1: Create an IAM role in the AWS console |
| 40 | +To set up the IAM role to properly authorize Segment with the AWS S3 (Actions) destination: |
| 41 | + |
| 42 | +1. Log in to your AWS account. |
| 43 | +2. Create a new or use an existing bucket with `PutObject`, `GetObject`, `ListObject` access to the S3 bucket. |
| 44 | +3. Navigate to **IAM > Roles > Create Role**. |
| 45 | +4. Provide the following policy permissions for the IAM that was just created: |
| 46 | +```json |
| 47 | +{ |
| 48 | + "Version": "2012-10-17", |
| 49 | + "Statement": [ |
| 50 | + { |
| 51 | + "Sid": "PutObjectsInBucket", |
| 52 | + "Effect": "Allow", |
| 53 | + "Action": [ |
| 54 | + "s3:PutObject", |
| 55 | + "s3:PutObjectAcl" |
| 56 | + ], |
| 57 | + "Resource": "arn:aws:s3:::<YOUR_BUCKET_NAME>/*" |
| 58 | + } |
| 59 | + ] |
| 60 | +} |
| 61 | +``` |
| 62 | +5. Click on the Trust Relationships tab and edit the trust policy to allow the IAM user to assume the role. If a user is not already created, refer to the AWS documentation to create a user. |
| 63 | +```json |
| 64 | +{ |
| 65 | + "Version": "2012-10-17", |
| 66 | + "Statement": [ |
| 67 | + { |
| 68 | + "Sid": "", |
| 69 | + "Effect": "Allow", |
| 70 | + "Principal": { |
| 71 | + "AWS": |
| 72 | + "arn:aws:iam::595280932656:role/customer-s3-prod-action-destination-access" |
| 73 | + }, |
| 74 | + "Action": "sts:AssumeRole", |
| 75 | + "Condition": { |
| 76 | + "StringEquals": { |
| 77 | + "sts:ExternalId": "<YOUR_EXTERNAL_ID>" |
| 78 | + } |
| 79 | + } |
| 80 | + } |
| 81 | + ] |
| 82 | + } |
| 83 | +``` |
| 84 | +## Step 2: Add the AWS S3 (Actions) Destination in Segment |
| 85 | +To finish the configuration, enable the AWS S3 (Actions) Destination in your workspace. |
| 86 | + |
| 87 | +1. Add the **AWS S3 (Actions)** destination from the Destinations tab of the catalog. |
| 88 | +2. Select the data source you want to connect to the destination. |
| 89 | +3. Provide a unique name for the destination. |
| 90 | +4. Complete the destination settings: |
| 91 | + * Enter the name of the region in which the bucket you created above resides. |
| 92 | + * Enter the name of the bucket you created above. Be sure to enter the bucket's **name** and not URI. |
| 93 | + * Enter the ARN of the IAM role you created above. The ARN should follow the format `arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME.` |
| 94 | + * Enter the IAM External ID, which is a value set in the Trust Relationship under your AWS IAM Role. |
| 95 | +5. Enable the destination. |
| 96 | +6. Verify the Segment data is stored in the S3 bucket by navigating to the `<your_S3_bucket>/` in the AWS console. |
| 97 | + |
| 98 | +{% include components/actions-fields.html settings="true"%} |
| 99 | + |
| 100 | + |
0 commit comments