aws

Drew Verlee 2022-08-22T19:13:00.546039Z

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...

ghadi 2022-08-22T19:17:54.545619Z

You're missing a literal key named :Parameters

ghadi 2022-08-22T19:18:12.414199Z

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

Drew Verlee 2022-08-22T19:20:05.595859Z

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

Drew Verlee 2022-08-22T19:20:18.702269Z

err

Drew Verlee 2022-08-22T19:20:28.904269Z

{: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

Drew Verlee 2022-08-22T19:25:12.394949Z

hmm yes

Drew Verlee 2022-08-22T19:45:38.792939Z

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