Amazon S3- Contacts Import

Learn how to import contacts from Amazon S3 to Netcore CE .

Overview

The Amazon S3 integration in Netcore enables users to import contact data from an Amazon S3 bucket. This feature allows you to automate data ingestion, ensuring that contact information remains up-to-date.

This document provides step-by-step instructions for setting up the Amazon S3 import, configuring AWS permissions, and ensuring successful data transfer.

Types of Imports

Netcore can import the following from your S3 buckets:

  • Registered Users: These are users who are already registered on Netcore.
  • Anonymous Users: These are users who are not yet registered on Netcore.

Prerequisites

Before configuring the integration, ensure that:

  • You have an Amazon S3 bucket created in your AWS account.
  • You have the necessary AWS IAM permissions to allow Netcore to fetch data.
  • The files follow the naming convention required for import.

Activate Amazon S3 Integration

Import Contacts via Amazon S3

Import Contacts via Amazon S3

Follow the steps below to activate Amazon S3 on the Netcore CE dashboard.

  1. Log in to the Netcore CE dashboard and navigate to Integrations.
  2. Locate Amazon S3 under the Connected section.
  3. Select Integration type as Import and click ADD INTEGRATION.
  4. Provide theConnection Name and enter the Bucket Name as specified in your AWS S3 setup.
  5. Specify the Bucket Path using the following naming convention, "folder_name/subfolder_name/". Ensure that Bucket Path ends with a "/" and do not include bucket name in the bucket path.
  6. Select the Region from the dropdown menu, such as us-west-2, in-2, in-1, and so on.
  7. Select the email addresses from the dropdown menu in the Alert Email field. These email addresses receive notifications if issues arise during the ongoing export process.
  8. Select your preferred Configuration method. The options are IAM (recommended) and Access key.
1. IAM

IAM

Follow the steps given below to configure Amazon S3 using the IAM method.

  1. Once you select the IAM option, relevant credentials appear below.
    1. Copy the policy code snippet provided.
  2. Navigate to the AWS Console > Bucket and select the created bucket.
  3. Navigate to Permissions > Bucket policy > Edit and enter the copied policy code snippet.
  4. Click Save changes to update the policy.
  5. Now, navigate to the Netcore CE dashboard and click the ACTIVATE button on the Amazon S3 configuration screen. Upon successful activation, a test file is sent to the S3 bucket.

📘

Note

When the file is successfully sent, the integration is activated immediately. If it fails, AWS sends an error response that is displayed on the Netcore CE dashboard.

2. Access Key

Access Key

To fetch the access key and secret key, follow the steps below.

  1. Navigate to the AWS Console.
  2. Select the bucket you wish to configure. Click on your bucket list and click Security Credentials.
  3. Navigate to Users > Add User.
  4. In the Add User section, enter your User name and select the Programmatic access checkbox. Click Next: Permissions, and the Set Permission appears.
  5. Click Create Group > Create policy When you click it, the Create Policy page opens in a new tab.
  6. Click the JSON tab and then paste the code snippet provided below:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::sample-bucket"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject"
            ],
            "Resource": [
                "arn:aws:s3:::sample-bucket/*"
            ]
        }
    ]
}

🚧

Warning

Replace all instances of sample-bucket with the actual bucket name you created.

  1. Click Next: Tags > Next: Review, and the Create Policy page appears.
  2. Include a policy name in this section and click Create policy.
  3. Navigate to the Create Group tab and search for the policy you created. Assign this new policy to the new group. A success message appears on your S3 console.
  4. Navigate to Create Group and search for the policy name you provided in Step 8.
    1. Assign this policy to the new group.
    2. Click Create Group, and the page to add users appears.
  5. Click Next: Tags > Next: Review > Create User.

👍

Success!

The Access Key and Secret Key to your S3 bucket are now visible.

You can download these credentials as a .csv file on your device, note them down, and have them ready when configuring the S3 bucket on the Netcore CE Dashboard.

  1. Select the Access Key button, and relevant details appear below
    1. Enter the Access Key
    2. Enter the Secret Key
  2. Click the Activate button and a test file will be sent to the S3 bucket configured on the dashboard.

📘

Note

When the file is successfully sent, the integration is activated immediately. If it fails, AWS sends an error response that is displayed on the Netcore CE dashboard, helping the user understand the issue and adjust the credentials.

Lambda Function

To automate data import, follow these steps to configure an AWS Lambda trigger:

  1. Navigate to the AWS Console> Lambda, and click Create Function.
  2. Enter a Function Name and select Python 3.11 as the runtime.
  3. Click Create Function to complete the setup.
  4. Under the function's settings, click Add Trigger and select S3 as the source.
  5. In the Bucket field, enter the same bucket name used in the CE dashboard.
  6. Set the Event Type to All object create events.
  7. In the Prefix field, specify the folder path defined in the CE panel (Suffix is optional).
  8. Check the acknowledgment box and click Add to finalize the trigger.
  9. To add the Lambda function code, navigate to Lambda > Functions.
  10. Select the created function, paste the provided code (from Netcore documentation) into Code Source, and click Deploy.

📘

Increasing Lambda Function Timeout for Better Performance

We recommend increasing the timeout of your Lambda function to at least 1 minute.
Recommended: 5 minutes for optimal performance.

Steps to Increase Timeout:

  1. Navigate to the Configuration tab.
  2. Click Edit under the Timeout section.
  3. Set the Timeout to 5 minutes.
  4. Click Save to apply the changes.

This ensures your function has enough time to execute without interruptions.

This trigger ensures that Netcore automatically fetches the data whenever a new file is added to the specified S3 folder.

Activate the Integration

  1. Click Activate on the Netcore CE dashboard.
  2. If successful, the integration status will show Connected.

A successful connection ensures any file uploaded to the S3 bucket will be automatically imported into Netcore.

File Naming Conventions

Each file uploaded in the S3 bucket must follow a structured naming convention to be processed correctly. Files that do not follow this convention will be rejected. Here is the structure how to name a file: [Type]~[List Name]~[Timestamp]~[Anonymous/Identified].csv

Example File Names:

L~CustomerList~20240210~Identified.csv → Adds contacts to the "CustomerList".
CM~Users~20240209~Anonymous.csv → Updates Contact Master with anonymous users.

Key Components

  • L → List | CM → Contact Master.
  • CustomerList → The target list name.
  • 202503111530 → Timestamp format: yyyymmddhhMM (to prevent duplication).
  • Identified or Anonymous → Specifies user type.

Check the import status of uploaded files under Logs.