aws 2022-08-22

The value for an aws-api CreateStack is described like this

:Parameters
 [:seq-of
  {:ParameterKey string,
   :ParameterValue string,
   :UsePreviousValue boolean,
   :ResolvedValue string}]
So what i supply is like this:
[{:ParameterKey "AppName", :ParameterValue "api"}]
And the warnings me the key should be a string
{ :path [ :Parameters :ParameterValue ], :pred clojure.core/string?, :val 2, :via [ :cognitect.aws.cloudformation/CreateStackInput :cognitect.aws.cloudformation/Parameters :cognitect.aws.cloudformation/Parameter :cognitect.aws.cloudformation/ParameterValue ], :in [ :Parameters 1 :ParameterValue ] }
So i make the key a string and try again and i'm told the parameters don't have values...
"Parameters: [AppName ...] must have values
i'm starting to guess the warnings are coming from the spec (aws/validate-requests cf-with-assumed-role true) and that there wrong...

You're missing a literal key named :Parameters

Nested under the :request

Alex Miller (Clojure team) 2022-08-22T19:18:42.170859Z

(def cf (aws/client {:api :cloudformation}))
(aws/doc cf :CreateStack)

👍 1
Alex Miller (Clojure team) 2022-08-22T19:19:54.596659Z

^^ to figure this kind of thing out using the built-ins

the abbreviated request is {:Parameters [{"ParameterKey" "AppName", "ParameterValue" "api"} ...]} Maybe it's supposed to just be {:Parameters {"AppName" "api"}}

{:Parameters [{"AppName" "api"}...]}

Alex Miller (Clojure team) 2022-08-22T19:22:07.818389Z

the error you had was { :path [ :Parameters :ParameterValue ], :pred clojure.core/string?, :val 2 - which looks like the :ParameterValue value was supposed to be a string, but was the number 2

👀 1
Alex Miller (Clojure team) 2022-08-22T19:23:26.439079Z

then you "So i make the key a string" - I think you took the wrong turn here

Thanks Alex, i forgot the first rule (for me at least) is to just use expound rather then try to manually read the spec. It was the fact that one of the values wasn't a string