1
votes

I have setup terraform for AWS infrastructure but was not able to set a workflow where I can trigger destroying of the infrastructure created using Terraform Plan/Apply.

Can a github action be triggered manually without code being pushed or pull request being created?

I don't want to register a workspace on hashicorp and want to run the pipelines on Github Actions itself.

There is this resource for destroying infrastructure but it only works on Pull request close.

1
actions have a [Re-run jobs] that you can use to trigger it manually ... is that what you are looking for?Helder Sepulveda
no, so I wanted to trigger a manual destroy of terraform infrastructure if something goes wrong. Plan fails if the resource already exist. Hence wanted to create a job which will delete infra whenever required.Vaulstein
Have found this resource on Manual workflows but how do I tie this up with the state file of previous terraform planVaulstein
I don't get it ... Plan fails if the resource already exist that will happen only if someone manually created the resource, running a terraform destroy will not "fix" those errorsHelder Sepulveda
Okay but if I have created a feature branch and want to destroy the resources after testing, can I trigger a manual destroy from Github actions?Vaulstein

1 Answers