-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathssm_examples.clj
41 lines (29 loc) · 1.08 KB
/
ssm_examples.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
34
35
36
37
38
39
40
41
;; Copyright (c) Cognitect, Inc.
;; All rights reserved.
(ns ssm-examples
(:require [clojure.spec.alpha :as s]
[clojure.pprint :as pp]
[cognitect.aws.client.api :as aws]))
(comment
(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 ssm-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"}})
)