I am trying to configure a button in a Retool dashboard that will trigger a DAG in AWS MWAA.
Unfortunately, AWS MWAA doesn't support the airflow API—I have to send the triggers using the AWS cli API (see the "Add a configuration when triggering a DAG" section in their docs). I can make a post request to trigger the DAG, but this requires creating an AWS cli token (that is only valid for 60 seconds). So essentially, the button in my dashboard would need to trigger:
- creating CLI token
- sending POST request to AWS CLI to trigger the DAG (within 60 seconds)
This doesn't seem reasonable to manage using RESTQuery resource (because I wouldn't have a valid CLI token) or the Run JS Code resource (because I'd have to import the aws library etc. and I'd have to hardcode the access keys and such since I can't access secrets in the query box).
Is there a better way to go about this? I'm wondering both from the perspective of triggering DAGs in AWS MWAA and managing/creating CLI tokens more generally for use in dashboards.