Open garysassano opened 1 month ago
Voting for Prioritization
Volunteering to Work on This Issue
Providing additional information.
When creating an aws_codebuild_webhook
resource using Terraform, AWS CodeBuild automatically creates a webhook in GitHub. This webhook should be automatically deleted by Terraform when the resource gets destroyed.
The only exception to this rule is if the user ticked the following option:
In that case, the GitHub webhook is managed manually by the user and Terraform doesn't have to care about deleting it when the aws_codebuild_webhook
resource is destroyed.
For some reasons, I couldn't find any corresponding argument in aws_codebuild_webhook
for the manual creation option which is available in AWS Console.
Hey @garysassano 👋 Thank you for taking the time to raise this! This looks pretty similar to #30551. Can you take a look over that thread and see if you're able to resolve your issue as well?
The linked issue did not provide a conclusive solution, as the author eventually gave up.
There are several things I would like to see from CodeBuild:
Unified Credential Management with CodeConnections
Support Authenticating as a GitHub App installation
Complete Webhook Lifecycle Management
@garysassano - If this is a CodeBuild limitation, there is nothing this provider can do. You feature requests should be submitted to AWS through your assigned TAM.
Terraform Core Version
1.9.2
AWS Provider Version
5.59.0
Affected Resource(s)
aws_codebuild_webhook
Expected Behavior
Destroying an
aws_codebuild_webhook
resource results in the deletion of everything it originally created.Actual Behavior
When deploying an
aws_codebuild_webhook
, AWS CodeBuild automatically creates a GitHub webhook inside the repository, organization or enterprise.When destroying an
aws_codebuild_webhook
, the associated GitHub webhook isn't automatically deleted, requiring user intervention. Instead, Terraform should use theGITHUB_TOKEN
permissions to delete the associated webhook it originally created.Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
You can deploy this project to reproduce the issue.
Steps to Reproduce
see above
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None