# Amazon Web Services (AWS)

{% hint style="warning" %}
**Note**: This guide outlines a reference configuration; specific steps may vary due to provider updates or your organization's security policies. Please share feedback if you encounter any discrepancies that prevent a successful setup.
{% endhint %}

Open Loyalty allows you to export data to an S3 bucket for seamless integration with your data lake. This guide will walk you through two approaches to setting up S3 Bucket integration:

1. **Access to the S3 Bucket**
2. **Replicating Data Between S3 Buckets**

Each method offers flexibility depending on your organization's existing infrastructure and preferences.

## Access to the S3 Bucket

In this method, the client is granted access to the Open Loyalty S3 bucket. Here’s how to set it up:

{% stepper %}
{% step %}
**Create an AWS User**

Create a new user specifically for this integration, enabling relevant access.
{% endstep %}

{% step %}
**Share IAM Role Details**

* After creating the user, attach an [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create.html) with permissions to access the Open Loyalty S3 bucket.
* Share the following details with the Open Loyalty team:
  * **Role ARN:** The Amazon Resource Name of your role.
  * **Account ID:** Your AWS account ID.
    {% endstep %}

{% step %}
**Access the Open Loyalty S3 Bucket**

* The Open Loyalty team will grant access to their S3 bucket for this IAM role.
* Once access is granted, you can start setting up a pipeline to integrate the data directly from the Open Loyalty bucket to your data lake.
  {% endstep %}
  {% endstepper %}

<figure><img src="https://123136216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIv2CyIIYf7vRfuhMKQ6%2Fuploads%2FBtZ0KX9mCpISMpocXleu%2Fimage.png?alt=media&#x26;token=1d9c1f71-c84d-4547-a9b4-2d0a987b1949" alt=""><figcaption></figcaption></figure>

**Advantages:**

* Reduced overhead as you don’t need to maintain your own intermediate bucket.

***

## Replicating Data Between S3 Buckets

In this method, Open Loyalty replicates data to a client’s S3 bucket. This method is beneficial for organizations that prefer to maintain full control over their data pipeline.

{% stepper %}
{% step %}
**Create an S3 Bucket**

Create a new S3 bucket in your account, ensuring proper permissions are configured.
{% endstep %}

{% step %}
**Share Bucket Details**

Provide the following details to the Open Loyalty team:

* **Bucket Name:** The name of the S3 bucket where the data will be replicated.
* **Bucket ARN:** The Amazon Resource Name of the S3 bucket.
* **Account ID:** Your AWS account ID.
* **Bucket Link:** The URL link to your bucket.

{% hint style="warning" %}
Remember to enable bucket versioning.
{% endhint %}
{% endstep %}

{% step %}
**Apply Bucket Policy**

Open Loyalty will share with you the Bucket Policy to be applied to the bucket on your end.
{% endstep %}

{% step %}
**Enable Data Replication**

The Open Loyalty team will configure replication from their bucket to your designated S3 bucket.

{% hint style="info" %}
Delta files are exported daily, after midnight UTC time.
{% endhint %}
{% endstep %}

{% step %}
**Set Up a Pipeline**

Once the data is replicated, you can create a pipeline to transfer data from your S3 bucket to your data lake using tools like AWS Glue, DataSync, or other tools.
{% endstep %}
{% endstepper %}

<figure><img src="https://123136216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIv2CyIIYf7vRfuhMKQ6%2Fuploads%2FuHqjDC0zEGXOXwn83OzU%2Fimage.png?alt=media&#x26;token=30bb76c1-4254-4e83-b9a4-937085c4e43c" alt=""><figcaption></figcaption></figure>

**Advantages:**

* Full control over your S3 bucket and data pipeline.
* Flexibility to apply custom processing on your replicated data before integration.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.openloyalty.io/technical-guide/data-exports/set-up-integration/amazon-web-services-aws.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
