- Newest
- Most votes
- Most comments
In cloudformation you can enforce order by a few ways:
Reference (!Ref) or get an attribute (!GetAtt) from another resource. The resource using the reference or attribute will wait until the resources is finished
Set the DependsOn parameter to force a resource to wait on another resource. This will be what you need here - you need to set the query resource to depend on the table resource
More complex scenarios where db schema's are not deployed by cloudformation Use a WaitHandle with a WaitCondition. You would give the function (assuming it is a function) deploying your database table the waithandle (which is a presigned cloudformation URL). At the end of deploying the table call the wait handle. The function (assuming it is a function) making the query needs to dependon the waithandle. This will ensure the query doesn't happen until the table is created
Thanks for your answer Peter.
I already set up the dependsOn properties for my resources.
The Timestream Table are not described by a static schema. The schema is built on the fly by ingesting events. So I will try the WaitHandle trick and inject some fake events to Timestream.
I finally managed to deploy the scheduled query with its source table with a custom resource based on a function triggered between the deployments of the table dans the query. This function inject a fake event to the table that force timestream to discover the table schema.
Relevant content
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago