Wondering if anyone has ideas for this situation: ...
# help
l
Wondering if anyone has ideas for this situation: • Function A creates new ACM certificate in AWS • By default, when created, ACM certificate does not have DNS verification information in it. It 'appears' after a couple of seconds • This makes for quite an awkward situation. Ideally, I would do this: • Function B is invoked by Function A, with the id of the new ACM certificate. Checks to see if ACM certificate has DNS verification information in it. If yes, invokes Function C. If no, invokes itself tl;dr: what's a simple/elegant way to allow a function in
sst
to invoke itself after a [2] second time out? It needs to know the endpoint it's at so it can call that endpoint. I guess I can get this through some context-like object, just not sure where to access that.
f
Step functions is better for any workflow involving a wait.
Or does
setTimeout(…, 2000)
work for u
l
OK interesting. setTimeout works for me, but step functions sounds appealing - is that sst-able?
It would be fine to just do this though: • Function B runs • Checks if X exists • If X doesn't exist, setTimeout 2000ms, run Function B again The thing I'm not sure about is how to do 'run Function B again' from within Function B
f
l
Thanks! What I'm going to do in the end is grab the domain and path of the request made to Function B from its
event
object and then simply do another request to that same endpoint using
node-fetch
That way it'll always be self-referencing