Launch the API Server AMI on Amazon Web Services



The API Server is a lightweight Web application that produces OData feeds for 100+ relational, non-relational, cloud, and on-premises data sources. The CData API Server Amazon Machine Instance (AMI) comes as a Linux-based instance with the API Server pre-configured and ready to run, with no additional configuration necessary.

The AMI can be found in the AWS Marketplace as CData API Server. You can launch a new instance of the API Server from the Amazon AMI in three simple steps.

  1. Subscribe to the AMI, and accept the Terms and Conditions. Once you are subscribed, you can launch a new instance of the API Server.

  2. Configure the instance-type, instance details, volume, tags and security group. The API Server runs on the default HTTPS port (443), make sure that this port is accessible from the IP address which will be connecting to the API Server. The last step of the process will prompt you to create a new key-pair, or select an existing one.

  3. Once the instance has launched, it will be listed in your EC2 running instances. You can then access the API Server in your browser at the URL:

    https://<instance_public_dns>

    To log in, the default username is 'admin', and the password is the instance's randomly generated Instance-ID, which you can find from the EC2 management console.

You can now connect to your data sources, secure connections with SSL and the standard authentication methods. See the "Getting Started" chapter in the help for a guide to setting the required connection properties and setting up access control.

Advanced configuration

The API Server AMI works out-of-the-box without additional configuration. However, for advanced users, it is possible to manage the API Server in more details.

Access the Instance via SSH

Connecting to the EC2 instance via SSH can be useful for advanced configuration of the service. The API Server AMI is based of a standard Ubuntu 20.04LTS VM, and the main user is ubuntu. You can connect to it via SSH using the key-pair selected when launching the instance:

ssh -i my_key_pair.pem ubuntu@<instance_public_dns>

Stop, Start, or Restart the API Server service

The API Server runs using Jetty. Once connected to the instance, use systemctl to manage the Jetty service:

sudo systemctl restart cdata-apiserver
sudo systemctl stop cdata-apiserver
sudo systemctl start cdata-apiserver

Connect to Additional Data Sources

The API Server comes with few data sources available, but there are many additional data sources supported. To enable a data source in the API Server instance, download and install the corresponding CData JDBC Driver.

To host the JDBC driver, you will need a license (full or trial) and a Runtime Key (RTK). For more information on obtaining this license, contact our Sales Team.

Copy the JAR file of the JDBC driver on the instance via SSH using your key-pair. The JDBC driver needs to be installed in the directory /opt/apiserver/lib/ext/. For example, you can use the scp command:

scp -i my_key_pair.pem cdata.jdbc.salesforce.jar ubuntu@<instance_public_dns>:/opt/apiserver/lib/ext/

After copying the JAR file, restart the jetty service:

sudo systemctl restart cdata-apiserver

Install a Trusted Certificate

By default, the API Server AMI generates a new self-signed certificate upon creation, preventing any two AMIs from sharing the same certificate. However, not all client applications accept self-signed certificates. To get around this, you can replace the default certificate with a trusted one.

First, obtain a trusted certificate from a certificate provider. This certificate must match the public URL provided by AWS.

In the AMI, the Jetty web-container handles the SSL configuration. Import your certificate as a new keystore file in your EC2 instance. In the file /opt/apiserver/etc/ssl.xml, modify the lines referencing the path to the current certificate keystore with the new path and password:

<Set name='KeyStorePath'><Property name='jetty.base' default='.'/>/etc/my_trusted_keystore</Set>
<Set name='KeyStorePassword'>my_keystore_password</Set>

Note that the keystore path is a relative path starting from the Jetty Base directory (/opt/apiserver). After saving the modifications to this file, restart the Jetty service for these changes to take effect.

Upgrade the API Server AMI

You can upgrade your API Server AMI using the following instructions.

  1. Download the latest version of the API Server and extract the WAR file (apiserver.war): https://www.cdata.com/apiserver/download/
  2. Copy the WAR file onto your AMI instance:
    scp -i your_ssh_key.pem apiserver.war ubuntu@:~/
  3. Log into the EC2 instance via SSH (see instructions above).
  4. Stop the Service (see instructions above).
  5. Overwrite the old apiserver.war file:
    sudo cp ~/apiserver.war /opt/apiserver/webapps/apiserver.war
  6. Restart the service (see instructions above).