Docschargebeedocs

HomeBillingPaymentsRevRecGrowthReveal
Support

Product Updates


  • Release Notes

Getting Started


  • Overview
  • Chargebee Billing Data Centers
  • Object Relationship Model
  • Understanding Sites
  • Chargebee Tech Glossary
  • Articles and FAQ

Implementing Chargebee


  • Implementation Guide
  • Go-live Checklist
  • Articles and FAQ

AI in Chargebee


  • Chargebee Agents
  • Chargebee Copilot
  • Chargebee MCP Server (Model Context Protocol)

Developer Resources


  • Developer Resources Overview
  • Articles and FAQ

Product Catalog


  • Product Catalog Overview
  • Coupons
  • Articles and FAQ

Subscriptions


  • Working with Subscriptions
  • Billing
  • Orders
  • Articles and FAQ

Customers


  • Managing Customers
  • Account Hierarchy
  • Email Notifications
  • Branding
  • Configure Multiple Languages
  • Articles and FAQ

Entitlements


  • Entitlements Overview
  • Features Overview
  • Feature Management
  • Managing Product Entitlements
  • Subscription Entitlements
  • Customer Entitlements
  • Grandfathering Entitlements
  • Articles and FAQ

Usage Based Billing


  • Understanding Usages
  • Setting up Usage Based Billing
  • Metered Billing
  • Articles and FAQ

Chargebee CPQ


  • Chargebee CPQ
  • Chargebee CPQ for Salesforce
  • Chargebee CPQ for HubSpot

Invoices, Credit Notes, and Quotes


  • Invoices
  • Credit Notes
  • Quotes [Legacy]
  • Transactions
  • Articles and FAQ

Taxes


  • Overview
  • Configuring Taxes
  • Country-specific Taxes
  • Articles and FAQ

Hosted Capabilities


  • Overview
  • Hosted Checkout
  • Hosted Self-Serve Portal
  • Hosted Pages Features
  • Additional Hosted Pages
  • Payment Components
  • Pricing Table
  • Managing Payments with Chargebee.js
  • Mobile-Optimized Hosted Pages
  • Articles and FAQ

Site Configuration


  • Users & Roles
  • Custom Fields & Metadata
  • Approvals
  • Mandatory Fields
  • File Attachments & Comments
  • Advanced Filter Options
  • Multicurrency Pricing
  • Multi-decimal Support
  • Configuring Reason Codes
  • Events and Webhooks
  • API Keys
  • Time Zone
  • Time Machine
  • Transfer Configurations
  • Articles and FAQ

Multi Business Entity


  • Multi Business Entity Overview
  • Customer Transfer Overview
  • Articles and FAQ

Mobile Subscriptions


  • Overview
  • Omnichannel Subscriptions
  • Omnichannel One-Time Orders
  • Mobile Subscriptions (Legacy)

Reports and Analytics


  • RevenueStory
  • Home Dashboard
  • Frequently Asked Questions
  • FAQs for Classic Reports Sunset
  • Articles and FAQ

Integrations


  • Sales
  • Customer Support and Success
  • Finance
  • Tax
  • Marketing
  • Stitch
  • Collaboration
  • Contract Management
  • Ecommerce Management
  • Articles and FAQ

Data Privacy & Security


  • Two Factor Authentication
  • SAML Single Sign-On
  • System for Cross-Domain Identity Management (SCIM)
  • EU-GDPR
  • Consent Management
  • Personal Data Management
  • Compliance Certificates
  • HIPAA Guidelines
  • PCI Recommendations and Integration Types
  • Articles and FAQ

Data Operations


  • Bulk Operations
  • Migration
  • Articles and FAQ
  1. Billing
  2. Data Operations
  3. Automatic Export Set Up Automatic Export To Amazon S3
  1. Billing
  2. Data Operations
  3. Automatic Export Set Up Automatic Export To Amazon S3

Set up Automatic Exports to Amazon S3

To set up Automatic Export with Amazon S3, follow these steps:

Step 1: Create an S3 bucket
Step 2: Create a folder in your AWS S3 bucket
Step 3: Configure the inline policy with bucket access
Step 4: Create an IAM role

Step 1: Create an S3 bucket

Your Chargebee data will be copied to an Amazon S3 bucket.

We highly recommend creating a new S3 bucket for Chargebee Exports to maintain separation of concerns.

To create an S3 bucket, follow these steps:

  1. Log in to the AWS Management Console. Click Create bucket.

  2. Enter a meaningful name for your S3 bucket.

  3. Follow the workflow to set the appropriate settings for your S3 bucket.

  4. Click Create bucket at the bottom of the form. You will be redirected to your S3 buckets page, where a banner appears at the top.

  5. Click View details and navigate to the Properties tab.

  6. Note the Amazon Resource Name (ARN) as <BUCKET_ARN> for use in the role access steps below.

Ensure that Object Lock and Requester Pays are disabled.

Step 2: Create a folder in your AWS S3 bucket

To create a folder in your AWS S3 bucket, follow these steps:

  1. In the Objects tab, click Create folder.

  2. Enter a meaningful name for your folder <EXPORTS_FOLDER>. For example, in the following image, chargebee-exports is the folder name.

  3. Follow the workflow to set the appropriate settings for your AWS S3 folder as shown in the image below. Note: Ensure the configuration disables the encryption key as shown above for enabling Chargebee to write data. 

  4. Click Create folder to save the folder.

Step 3: Configure the inline policy with bucket access

Configure your bucket to allow PutObject permissions to anyone in the role you created. This grants write permissions on the bucket to the newly created IAM role.

To configure the inline policy with bucket access, follow these steps:

  1. Log in to the AWS Management Console.

  2. Navigate to Access management > Policies.

  3. Click Create policy.

  4. Select the S3 option using the Service drop-down to configure AWS S3 policies.

  5. A message appears to provide permissions for your AWS S3 bucket. Click the JSON tab to provide a custom policy.

  6. Under the editor, insert the following JSON and replace appropriate values for SID, BUCKET_ARN, and EXPORTS_FOLDER. Learn more about these values.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "<UNIQUE_APPROPRIATE_SID",
          "Effect": "Allow",
          "Action": [
            "s3:GetBucketLocation",
            "s3:ListBucket*"
          ],
          "Resource": "<BUCKET_ARN>"
        },
        {
          "Sid": "<UNIQUE_APPROPRIATE_SID>",
          "Effect": "Allow",
          "Action": [
            "s3:Get*",
            "s3:PutObject",
            "s3:PutObjectAcl",
            "s3:DeleteObject",
            "s3:AbortMultipartUpload"
          ],
          "Resource": "<BUCKET_ARN>/<EXPORTS_FOLDER>/*"
        }
      ]
    }
    
    

    Note: These are the minimum privileges required ONLY FOR Chargebee Data Exports. If you want to add any more privileges for any other folders, it is recommended that you create another inline policy for them and attach the same.

  7. Click Next > Save Changes.

Step 4: Create an IAM role

This setup involves creating an IAM role for Chargebee. The role has the write permission to the S3 bucket that you have created for Chargebee data export.

  1. Log in to the AWS Management Console.

  2. Navigate to Access management > Roles.

  3. Select Create role at the top right of the page.

  4. Select Custom trust policy under the trusted entity type and in the JSON editor, paste the following policy to enable a cross-account trust relationship. You can also copy and paste the Custom trust policy in the JSON editor from this step during automatic export configuration in Chargebee. Learn more about CB ROLE ARN, Unique and Appropriate SID, and EXTERNAL ID values.

    
    {
    "Version": "2012-10-17",
    "Statement": [
            {
            "Sid": "<UNIQUE_APPROPRIATE_SID>",
            "Effect": "Allow",
            "Principal": {
                "AWS": "<CB_ROLE_ARN>"
            },
            "Action": "sts:AssumeRole",
            "Condition": \{"StringEquals": \{"sts:ExternalId": <EXTERNAL_ID>}}
            }
        ]
    }
    
    
  5. Add the above-created inline policy to grant S3 privileges to this role. 

  6. Select the policy using the drop-down, and click Next.

  7. Create the role with a name. Ensure that the role name includes the mandatory prefix chargebee-exports- for allowlisting access from the Chargebee account. The role name can follow any format that begins with this prefix, such as chargebee-exports-role or chargebee-exports-prod-role, as shown in the following image.

  8. Click Create role.

JSON field details

NameDescription
<BUCKET_ARN>Bucket ARN refers to the Amazon Resource Names generated by AWS. You can find your ARN here.
<EXPORTS_FOLDER>This refers to the folder you created inside your buckets for Chargebee to write the data.
<CB_ROLE_ARN>This refers to the ARN that you will get here. For example: arn:aws:iam::84XXXXXXXX93:role/service-role/cb-edpprod-us-e1-edp-emr-ec2-exporter-role
<UNIQUE_APPROPRIATE_SID>Sid (statement ID) as an optional identifier for the policy statement. Please set an appropriate Statement ID for your use case which helps you identify and segregate them
<EXTERNAL_ID>An external ID is a unique key passed to the AssumeRole API of AWS's Security Token Service (STS).

Next Step Once you have completed all the above steps, follow the instructions to set up Automatic Export in Chargebee.

Was this article helpful?