Ways to trigger Terraform cloud runs from GitHub
brendanthompson.com
Ways to trigger Terraform cloud runs from GitHub
1–7 of 7 posts
Re: Ways to trigger Terraform cloud runs from GitHub
#2Re: Ways to trigger Terraform cloud runs from GitHub
#3You can, but do you really need to?
People do all sorts of things with terraform, if you need to is down to what you're doing and the context of your problem.
I've even run terraform on a cron like schedule before to ensure configuration of a web service matched what we defined rather than the constant small edits people were making in the console. Eventually the behaviour stopped but no reason not to.
Re: Ways to trigger Terraform cloud runs from GitHub
#4You can, but do you really need to?
As opposed to just running it ad-hoc when a change is made? People do all sorts of things with terraform, if you need to is down to what you're doing and the context of your problem. I've even run terraform on a cron like schedule before to ensure configuration of a web service matched what we defined rather than the constant small edits people were making in the console. Eventually the behaviour stopped but no reaso…
Yes. I worked at a shop that made a terrible mess (at least IMHO) of things by using Terraform from Jenkins for everything. So build and rollout new Docker image -> `terraform apply` entire infrastructure from Jenkins.
To me use Terraform for Day-0 to build your infrastructure and CI/CD pipeline then occasional updates. CI/CD for the day-to-day, if you can get away with it.
I have read lots of people are doing Terraform from Jenkins. I guess there is a use case, just saying, probably best to think first.
Re: Ways to trigger Terraform cloud runs from GitHub
#5Earlier quoted context omitted.
As opposed to just running it ad-hoc when a change is made? People do all sorts of things with terraform, if you need to is down to what you're doing and the context of your problem. I've even run terraform on a cron like schedule before to ensure configuration of a web service matched what we defined rather than the constant small edits people were making in the console. Eventually the behaviour stopped but no reaso…
> As opposed to just running it ad-hoc when a change is made? Yes. I worked at a shop that made a terrible mess (at least IMHO) of things by using Terraform from Jenkins for everything. So build and rollout new Docker image -> `terraform apply` entire infrastructure from Jenkins. To me use Terraform for Day-0 to build your infrastructure and CI/CD pipeline then occasional updates. CI/CD for the day-to-day, if you can…
Re: Ways to trigger Terraform cloud runs from GitHub
#6While you can do this by embedding an AWS IAM secret as a GitHub secret, it may lead to the secret escaping. Instead, you can configure AWS to trust GitHub actions, And set up passwordless trust between the two.
I wrote up how to do it here at StackOverflow if you’re interested:
Re: Ways to trigger Terraform cloud runs from GitHub
#7You can, but do you really need to?