Here is my first attempt at generating some terraform from within emacs org-mode. It went quite well, I must admit.
It turns out we already have a ttc-dbt repository, but I don’t know where this might have been created.
It looks like it’s actually in sql/dbt/main.tf, which is not an obvious location for terraform, honestly
However, I ended up just deleting the repository and creating it from scratch from inside the infra/terraform/dbt folder.
On the first apply, I got an error about a missing role_arn in the event_target, which was quickly rectified once I pointed it out. I then prompted the model for way too long, asking it to trigger the target, but that was not the proper thing to do. What you actually want to do is instantiate the task.
Here is the conversation about creating a script to trigger the event, but as mentioned, it turns out that the proper way to do so is to create a task manually in the console.
It answered that prompt way too fast, so I asked it to tell me which model it was, to check if it was hitting the right model. It seems that I sometimes hit a gpt-3.5-turbo? Or just a fast gpt-4.
Here I ask it to reformat the script using a here string, which worked (but was useless).
After triggering the event and noticing I wasn’t getting very far, I asked how to test the task by prompting it with the terraform itself.
Using the answer above, I was able to instantiate and test the container in the ecs cluster, and have it fail because it wasn’t providing any arguments to the dbt binary. That was quite successful already, so I was quite pleased. I then asked it how to pass those commands in, and it was kind of wrong, because it didn’t split the command into individual argument strings, but that was an easy fix.
I struggled a bit calling it locally with the env-file, and honestly I could have just looked up the docs with the CLI help, but this was worth a try.