Comments (14)
not sure what the problem was, maybe some old dynamodb running
I've changed the dynamolocal, and it is working fine now
tks
from faraday.
Glad it's all working now.
from faraday.
version: [com.taoensso/faraday "1.11.0-alpha1"]
from faraday.
maybe you have a .aws config that is shadowing your current ":endpoint" keyword value, maybe pass :endpoint "http://localhost:6798" to client-opts map?
from faraday.
I have this
(def client-opts { :access-key 'access-key' :secret-key 'secret-key' :endpoint 'http://localhost:8000'})
is this enough?
how can I debug this further?
from faraday.
Shouldn't the values be in double quotes to make them into strings? Perhaps a copy/paste issue?
(def client-opts { :access-key "" :secret-key "" :endpoint ""})
Though I expect you would see some exceptions if they weren't strings
from faraday.
I've tried this
(def client-opts { :access-key "" :secret-key "" :endpoint "http://localhost:8000"})
and it is not working as well
from faraday.
this is how I'm creating my tables
table definition: based on https://github.com/runopsio/sequence
{
"TableName": "decimals",
"ProvisionedThroughput": { "ReadCapacityUnits": 1, "WriteCapacityUnits": 1 },
"AttributeDefinitions": [
{ "AttributeName": "PK", "AttributeType": "S" },
{ "AttributeName": "SK", "AttributeType": "S" },
{ "AttributeName": "GSI1_PK", "AttributeType": "S" },
{ "AttributeName": "LSI1_SK", "AttributeType": "S" },
{ "AttributeName": "GSI1_SK", "AttributeType": "S" }
],
"KeySchema": [
{ "AttributeName": "PK", "KeyType": "HASH" },
{ "AttributeName": "SK", "KeyType": "RANGE" }
],
"GlobalSecondaryIndexes": [
{
"IndexName": "LSI1",
"KeySchema": [
{ "AttributeName": "PK", "KeyType": "HASH" },
{ "AttributeName": "LSI1_SK", "KeyType": "RANGE" }
],
"Projection": { "ProjectionType": "ALL" },
"ProvisionedThroughput": {
"ReadCapacityUnits": 1,
"WriteCapacityUnits": 1
}
},
{
"IndexName": "GSI1",
"KeySchema": [
{ "AttributeName": "GSI1_PK", "KeyType": "HASH" },
{ "AttributeName": "GSI1_SK", "KeyType": "RANGE" }
],
"Projection": { "ProjectionType": "ALL" },
"ProvisionedThroughput": {
"ReadCapacityUnits": 1,
"WriteCapacityUnits": 1
}
}
]
}
create table using dynamodb cli
aws dynamodb create-table --cli-input-json file://sequence.json --endpoint-url http://localhost:8000
list tables
aws dynamodb list-tables --endpoint-url http://localhost:8000
from faraday.
Do these steps work for you as they do for me?
docker run -p 8000:8000 amazon/dynamodb-local
(require '[taoensso.faraday :as far])
(def client-opts {:access-key "" :secret-key "" :endpoint "http://localhost:8000"})
(far/list-tables client-opts)
;; => ()
;; from the docs
(far/create-table client-opts :my-table
[:id :n] ; Primary key named "id", (:n => number type)
{:throughput {:read 1 :write 1} ; Read & write capacity (units/sec)
:block? true ; Block thread during table creation
})
(far/list-tables client-ops)
;; => (:my-table)
Almost certainly not related, but are you able to upgrade to the latest release from the alpha?
from faraday.
I've made a javascript script to list tables similar to far/list-tables
https://gist.github.com/sibelius/6430d1ad9390b83a40f1c600d7c159f1
If I do (far/create-table) I can see the table in (far/list-tables)
the problem is to list already existing tables
one problem that I see with (far/create-table) is that I can't see that table using
aws dynamodb cli, neither using dynamodb admin (https://github.com/aaronshaf/dynamodb-admin)
it looks like it is querying a different database
can I specify the region of my database?
from faraday.
I agree. Seems like somehow you are connecting to a different database.
You can pass in :region
in the client-opts map instead of the :endpoint
(as of version 1.11.0 I think)
from faraday.
(def client-opts { :access-key "dummy" :secret-key "dummy" :endpoint "http://localhost:8000" :region "us-east-1"})
this get me this error on region
Cannot cast java.lang.String to com.amazonaws.regions.Region
from faraday.
I'm not sure it makes sense to set a region as well as an endpoint, but in any case, I think you've stumbled on a bug. I've raised it here.
However, I think bug #152 is unrelated to what you are seeing with the different databases - you should be able to continue using endpoint
in client-opts.
from faraday.
this stackoverflow can give more insights for the issue
it looks like if you are using different profiles you get different databases
can I set a profile in client-opts
?
from faraday.
Related Issues (20)
- CI integration HOT 5
- Remove support for `:expected` HOT 3
- attribute_not_exists not respected consistently HOT 3
- Support for Streams HOT 8
- missing ScanIndexForward option with far/scan HOT 1
- Request: custom keywordization routine HOT 3
- Is the scan function safe for large tables? HOT 7
- Upgrade to 1.11.16+ of aws-sdk-java for task-level IAM role support in AWS ECS HOT 9
- Add support for DynamoDB Transactions HOT 6
- Upgrade to 1.11.459 of aws-sdk-java for management of On Demand tables
- Upload all doc versions to http://taoensso.github.io/faraday/{version}
- Porting to AWS SDK v2 HOT 16
- missing page-size/max-result-size option with query HOT 1
- Support empty strings HOT 4
- Setting `region` in client-opts causes ClassCastException
- String index names cause type error HOT 3
- Local docker example from readme only with `-p 8000:8000` arg HOT 1
- Possibly confusing dependencies found HOT 3
- FYI: have pushed some superficial changes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faraday.