forked from babashka/pod-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tzzh_aws.clj
33 lines (25 loc) · 1.22 KB
/
tzzh_aws.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(require '[babashka.pods :as pods])
(pods/load-pod 'tzzh/aws "0.0.3")
(require '[pod.tzzh.dynamodb :as d])
(require '[pod.tzzh.s3 :as s3])
(require '[pod.tzzh.paginator :as p])
(d/list-tables)
(d/batch-get-item {:RequestItems
{"AmazingTable" {:Keys [{:some-property {:S "SomeValue"}
:something-else {:S "SomethingSomething"}}]}}})
(d/batch-write-item {:RequestItems
{"AmazingTable" [{:PutRequest {:Item {:some-property {:S "abxdggje"}
:something-else {:S "zxcmbnj"}
:another-thing {:S "asdasdsa"}}}}]}})
(d/get-item {:Key {:lalala {:S "zzzzzzzz"}
:bbbbbb {:S "abxbxbxx"}}
:TableName "SomeTable"})
(d/describe-table {:TableName "SomeTable"})
(s3/list-buckets)
;; Paginators example
(let [s3-paginator (p/get-paginator s3/list-objects-v2-pages)]
(s3-paginator {:Bucket "some-bucket"
:Prefix "some-prefix/something/"}))
;; this returns a list of all the pages i.e a list of ListObjectsV2Output that are lazily fetched
(let [glue-paginator (p/get-paginator p/list-crawlers)]
(glue-paginator))