Destroying Codebuild resources

Hi i’m using AWS pipeline to push my waf and other resources, I want to take it all down, but I can only think to do it one by one and it will take a while. How do I set the pipeline to run a terraform destroy, within codebuild?