Run a one-shot configuration task after a Terraform Deploy on AWS

Viewed 15

I'm using Terraform to create resources on AWS, which need to be configured after they have been created.

These resources are configured via HTTP queries (OpenSearch), and isolated from the internet, so I must use code running within my VPC. I am looking for a way to launch a one-shot task directly from Terraform (ECS Task or Lambda) that would do the job.

This is a shot in the dark, as I'm not even sure TF is the best way to do it. Currently, I'm leaning toward a manual ECS task invocation directly after the TF deploy from my continuous integration environment.

So, to sum it up :

  • Is there a way to cleanly launch a one-shot task from Terraform after some resource has been created?
  • Is there, similarily, a way to do it BEFORE (to trigger a snapshot)?
  • Is it the prefered way to do it, or should I keep it as a separate CI step?
0 Answers
Related