nimate
nimate

Reputation: 175

Failed to set up up DAX with DynamoDB in python

I set up a DAX cluster which seems to work. I can connect to it with a telnet.

Here is my part of my script which works with DynamoDB

dynamodb = boto3.resource('dynamodb', region_name='us-east-1')

But it I only add there DAX endpoint

dynamodb = boto3.resource('dynamodb', region_name='us-east-1', 
               endpoint_url='dax-test.awj2jy.clustercfg.dax.use1.cache.amazonaws.com:8111'
                      )

script fails

Traceback (most recent call last): File "get.py", line 25, in <module> endpoint_url='dax-test.awj2jy.clustercfg.dax.use1.cache.amazonaws.com:8111' File "/home/ubuntu/dax/lib/python3.5/site-packages/boto3/__init__.py", line 92, in resource return _get_default_session().resource(*args, **kwargs) File "/home/ubuntu/dax/lib/python3.5/site-packages/boto3/session.py", line 389, in resource aws_session_token=aws_session_token, config=config) File "/home/ubuntu/dax/lib/python3.5/site-packages/boto3/session.py", line 263, in client aws_session_token=aws_session_token, config=config) File "/home/ubuntu/dax/lib/python3.5/site-packages/botocore/session.py", line 836, in create_client client_config=config, api_version=api_version) File "/home/ubuntu/dax/lib/python3.5/site-packages/botocore/client.py", line 71, in create_client verify, credentials, scoped_config, client_config, endpoint_bridge) File "/home/ubuntu/dax/lib/python3.5/site-packages/botocore/client.py", line 281, in _get_client_args verify, credentials, scoped_config, client_config, endpoint_bridge) File "/home/ubuntu/dax/lib/python3.5/site-packages/botocore/args.py", line 79, in get_client_args timeout=(new_config.connect_timeout, new_config.read_timeout)) File "/home/ubuntu/dax/lib/python3.5/site-packages/botocore/endpoint.py", line 273, in create_endpoint raise ValueError("Invalid endpoint: %s" % endpoint_url) ValueError: Invalid endpoint: dax-test.awj2jy.clustercfg.dax.use1.cache.amazonaws.com:8111

Is there something more I should do? I'm using boto3 v1.4.5

Upvotes: 3

Views: 1678

Answers (1)

Abdelrahman Elhaddad
Abdelrahman Elhaddad

Reputation: 841

DAX wire protocol is not compatible with HTTP-based DynamoDB protocol. DAX currently has an SDK for Java. SDKs for other languages are being actively developed. For more information about how to use the Java SDK for DAX, please refer to the user guide.

While you may use boto3 for provisioning your DAX cluster. You cannot connect to the cluster using Python just yet.

Upvotes: 6

Related Questions