Carbone On AWS

Take control of your document generations within your AWS infrastructure with Carbone On-AWS. This solution mirrors the Carbone Cloud API, offering the following advantages:

  • Secure AWS Instance: Run on your private AWS VPC, meeting all your security requirements. Template files, datasets, and generated documents remain within your infrastructure.
  • Offline Operation: Operate without internet access, ensuring data privacy.
  • Quick Installation: Set up in minutes for immediate use.
  • Flexible Payment: Pay according to your usage, with billing conveniently available on your AWS account.
  • Enterprise-Grade Features: Harness all enterprise features, including dynamic images, colors, barcodes, aggregators, HTML rendering, and more.
  • Stateless and Lightweight Carbone Studio Version: Design templates and get a live preview of documents from a streamlined version of Carbone Studio with basic authentication.
  • Extensibility with JS Plugins: Customize your experience by adding JavaScript plugins to override storage, authentication, and formatters.
  • SLA support: Receive top-notch support with Service Level Agreement (SLA) coverage, ensuring peace of mind.
  • Continuous Updates: Stay ahead with all incoming updates, ensuring your Carbone On-premise is always up-to-date.

For inquiries, contact us via chat or email at contact@carbone.io.

Quickstart

1 - Subscribe to Carbone

1 - Go to the AWS product sheet.

Carbone AWS product

2 - Click on "Continue to Subscribe"

🎉 It's done

2 - Launch a new Carbone instance

1 - Go to AWS Marketplace > Manage subscriptions console

Carbone subscription

2 - Click on "Launch new instance

Carbone start AMI Select Carbone version and region and click on "Continue to launch through EC2"

3 - Click on "Cancel" to keep default settings Change settings

4 - Review EC2 options Before launching EC2 Carbone instance, please check following options:

  • Security group: It must contain at least one "Inbound rules" allowing TCP/4000 from API users
  • IAM role: Attach to the instance the following policy:
    {
      "Version": "2012-10-17",
      "Statement": [
          {
              "Action": [
                  "aws-marketplace:MeterUsage"
              ],
              "Effect": "Allow",
              "Resource": "*"
          }
      ]
    }

5 - 🎉 Enjoy 🎉

Verify the Carbone instance is running with the following command:

curl http://"EC2_IP"/status

## Expected result : {"success":true,"code":200,"message":"OK","version":"4.14.3"}

3 - Configure the instance

Carbone on AWS can be configured in the same way as Carbone on-premise : Learn how to configure server and enable options

The configuration is accessible by connecting to the EC2 instance in the file /var/www/carbone-ee/config/config.json. We recommand to use carbone user after connection on ec2 instance to modify config.json After doing modification in config.json file, please restart carbone with following command:

sudo systemctl restart carbone-ee

4 - (Optionnal) Configure Carbone to export logs in CloudWatch

By default Carbone AMI is configured to export application logs on CloudWatch. To enable it, you only need to attach following policy on EC2 IAM role :

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "cloudwatch:PutMetricData",
                "ec2:DescribeVolumes",
                "ec2:DescribeTags",
                "logs:PutLogEvents",
                "logs:DescribeLogStreams",
                "logs:DescribeLogGroups",
                "logs:CreateLogStream",
                "logs:CreateLogGroup"
            ],
            "Resource": ""
        },
        {
            "Effect": "Allow",
            "Action": [
                "ssm:GetParameter"
            ],
            "Resource": "arn:aws:ssm:::parameter/AmazonCloudWatch-"
    }
    ]
}

5 - (Optionnal) Store template on S3 bucket using included plugins

You can use create your own JS plugins to customise some part or Carbone : create Carbone Plugins

Sample S3 plugins is included by default to allow you to load and store templates from you S3 bucket.

To use it, you need to configure bucket name and region in file /var/www/carbone-ee/config/config.json with the following options:

    "templateS3Bucket" : "test-stockage-template",
    "templateS3BucketRegion" : "us-east-1",
    "templateS3Folder" : "prod"

Authentification is done using EC2 IAM role so you need to add following policy to grant S3 access to you EC2 instance :

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject",
                "s3:GetObjectAttributes",
                "s3:ListBucket",
                "s3:DeleteObject"
            ],
            "Resource": [
                "arn:aws:s3:::test-stockage-template",
                "arn:aws:s3:::test-stockage-template/*"
            ]
        }
    ]
}

Upgrade Carbone

To update Carbone on AWS, please follow these steps :

Prerequisites :

  • Carbone Version N is running in your infrastructure

Upgrade path :

  1. Launch new instance with new version
  2. Stop Carbone on new instance with :
    sudo systemctl stop carbone-ee
  3. Copy /var/www/carbone-ee/config form previous EC2 instance to the new one
  4. (If you don't using S3 plugin to store template) Copy /var/www/carbone-ee/template form previous EC2 instance to the new one
  5. (If you include specific plugins) Copy /var/www/carbone-ee/plugin form previous EC2 instance to the new one
  6. Start Carbone
    sudo systemctl start carbone-ee
  7. Enjoy 🎉, you can now take advantage of Carbone's new features and destroy previous Carbone instance

Troubleshooting

Logs access locally

To access to Carbone logs, connect to the EC2 instance with SSH or by the System Manager. Logs are accessible with following command:

journalctl -u carbone-ee -r

Cannot connect to EC2 instance via SSH

If you try to connect through ssh, please check:

  • SSH Key pair was configured when the instance was created
  • Security group contains inbound rule allowing TCP/22

IAM Role errors

If the following error message appears on logs, it's mean that IAM MeterUsage Role is not attach to EC2 instance.

$ Carbone need acces to AWS Marketplace API to check subscription and report usage. Please check if you ec2 instance have correct IAM role

Please check following:

  1. Login to your AWS Management Console, open EC2 Services and click Instances
  2. Select the new EC2 instance deployed from this AMI and click Actions -> Security -> Modify IAM role
  3. Click Create new IAM role (or choose an existing one if created earlier)
  4. Click Create role, select AWS service and EC2, click Next
  5. Select AWSMarketplaceMeteringFullAccess, click Next
  6. Provide a Role name (eg carbone-role), click Create role
  7. In the Modify IAM role browser tab from step 2 above, click the refresh icon, select the new IAM Role, click Update IAM role

Enable Carbone Studio Light

To enable Carbone Studio Light, you need to connect on EC2 instance through SSH, and add "studio": true, option in file /var/www/carbone-ee/config/config.json and restart Carbone service.