Use the AWS CLI
Install and use Granica AWS CLI plugin for S3 bucket management.
The Granica AWS CLI plugin allows you to manage crunched data using standard AWS CLI S3 commands. With the plugin installed, S3 API requests made with the CLI will be redirected to Granica for handling by Crunch. With the Granica plugin you can easily and consistently access all your data, whether crunched or not, without complicated environment modifications. Any requests for objects not crunched by Crunch are simply passed through directly to S3, and requests for other AWS services will continue to work normally. Having Granica as the single endpoint for all S3 requests greatly simplifies your application code.
Install AWS CLI
note
If you set up a Granica Admin Server using the setup script from our installation guide, then the Python 3 version of the AWS CLI and the Granica plugin will both be preinstalled, so you can skip ahead to the configuration step below.
The Granica plugin works with the AWS CLI, so first install the AWS CLI on the host where you will deploy the plugin:
Enable Python 3
After installing and configuring the plugin ensure that AWS CLI utilizes Python 3 (Python 3 is required).
On Linux AMI instances, the default installation in usr/bin/aws
uses Python 2. To override this, add an entry to your PATH
that will load in the newly installed version.
The AWS CLI and corresponding version of Python can be also verified by executing:
Install Granica plugin
To install the plugin package, run:
Configure AWS profile to use Granica
To configure the plugin after it has been installed, use aws configure
command:
For example, to activate a Granica service using a load balancer hosted at https://bolt.us-east-1.jrn.granica.ai
for the staging
AWS profile, run:
Here is a sample ~/.aws/config
file with the Granica plugin installed and configured for the staging
profile:
Verify plugin
To verify the plugin functionality simply issue an aws s3 CLI command directed at an S3 bucket. For example:
or
In the example above bucket1
can be any S3 bucket, regardless whether or not it is crunched by Granica Crunch.
note
The IAM principal (user or role) used to make the requests to Granica must be granted the necessary permissions.
See the command documentation for permissions
for more info on authorizing access through Granica.
AWS CLI v2
This plugin has been tested for compatibility with AWS CLI version 2, but please take note of the plugins configuration breaking changes. In particular, you will need to add a block like:
in your ~/.aws/config
file for the plugin registration to succeed.
To find the correct location for cli_legacy_plugin_path after installing the plugin, run: