forked from cognitect-labs/aws-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathssm_examples.clj
More file actions
36 lines (26 loc) · 1020 Bytes
/
ssm_examples.clj
File metadata and controls
36 lines (26 loc) · 1020 Bytes
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
34
35
36
;; Copyright (c) Cognitect, Inc.
;; All rights reserved.
(require '[clojure.spec.alpha :as s]
'[clojure.pprint :as pp]
'[cognitect.aws.client.api :as aws])
(def ssm-client (aws/client {:api :ssm}))
;; guard against invalid :request map
(aws/validate-requests ssm-client true)
;; what ops are available
(aws/ops ssm-client)
(-> (aws/ops client) keys sort)
;; print docs
(aws/doc ssm-client :PutParameter)
;; or describe args as data
(pp/pprint (s/describe (aws/request-spec-key ssm-client :PutParameter)))
;; describe an op param
(s/form :cognitect.aws.ssm.PutParameterRequest/Type)
;; jam!
(aws/invoke ssm-client {:op :PutParameter
:request {:Name "aws-api-example"
:Value "example-value"
:Type "SecureString"}})
;; see spec fail
(aws/invoke ssm-client {:op :PutParameter
:request {:Value "example-value"
:Type "SecureString"}})