Skip to content

Deploy a Connector without Serverless Application Repository

Michael Hackett edited this page May 4, 2023 · 2 revisions

AWS Serverless Application Repository is not available in all Athena regions. However, Athena Federation is available in all regions where Athena is offered, so long as the underlying data source is available in that region. This page discusses how to deploy a connector without the use of SAR. This page assumes users have access to CloudFormation. If a user has neither access to SAR nor CloudFormation, they will have to follow a procedure such as our page on deploying the DynamoDB connector without SAR or CFN permissions, or adapt it for their specific connector.

Setup

Follow this guide to set up your development environment. You should clone the repository, but you do not need to build the modules. This page assumes you are using the same java and gh cli versions as the development environment in the guide.

Please fulfill the following prereqs first:

  • Export AWS credentials to terminal environment variables (or, just use your ~/.aws/credentials file).
  • cd into your Athena Federation repository.

Deployment

cd into the connector module you are deploying.

Paste the following into your terminal to download the latest jar for the connector and update your yaml template.

export CONNECTOR_MODULE=`basename $PWD`
export LATEST_VERSION=$(gh release list --exclude-drafts -L 1 | sed 's/.*\s\+Latest\s\+v\(.*\)\s\+.*/\1/g')
export RELEASE_NAME=v$LATEST_VERSION
gh release download $RELEASE_NAME -p "$CONNECTOR_MODULE-$LATEST_VERSION.jar" -D target
sed -i "s#CodeUri: \"./target/.*\"#CodeUri: \"./target/$CONNECTOR_MODULE-$LATEST_VERSION.jar\"#" $CONNECTOR_MODULE.yaml

Now paste the following and follow the interactive SAM deployment. You can append the --profile flag if you want to use an existing profile for credentials. Once you are done, you will be able to see your successfully deployed CloudFormation stack in your AWS account.

sam deploy -g --template-file $CONNECTOR_MODULE.yaml