Professional Documents
Culture Documents
I am Making a CI/CD pipeline with terraform AWS. This pipeline works 100 percent perfect if I
don't configure webhooks rather than goes with default option i.e AWS CodePipeline which
1 periodically checks for changes in github.
When I configure webhooks for my pipeline to make it start automatically on every push. I am
getting below error which is at the end after the code. I understand one solution that is "if I make
1 an organization and set individual=false in my providers settings" it will work.
But I don't want to make an organization rather wants to work with individual = true. Is there any
way by which I can solve this problem?
P.S: I added only those files in this question which are related to my problem. If you want me to
add my whole code please request revision
Filename: Provider.tf
provider "aws" {
region = var.aws_region
version = "2.55"
provider "github" {
token = var.github_token
individual = true
terraform {
backend "s3" {
key = "ecs_fargate/infrastructure.tfstate"
bucket = "umartahir-terraform-buckettestus-east-1"
region = "us-east-1"
Filename: Codepipeline.tf
#Code Pipeline
name = var.pipeline_name
role_arn
Join Stack Overflow= to
aws_iam_role.codepipeline_role.arn
https://stackoverflow.com/questions/61214656/terraform-resource-github-repository-webhook-requires-github-organization-to-be 1/4
4/13/22, 12:08 PM amazon web services - Terraform resource github_repository_webhook requires GitHub organization to be set on the provider - …
location = var.bucket_for_codepipeline
type = var.artifact_store_type
stage {
name = "Source"
action {
name = "Source"
category = "Source"
owner = var.source_stage_owner
provider = var.source_stage_provider
version = "1"
output_artifacts = var.source_stage_output_artifact_name
configuration = {
PollForSourceChanges = false
OAuthToken = var.github_token
Owner = var.git_hub_owner
Repo = var.repo_name
Branch = var.branch_name
stage {
name = "Build"
action {
name = "Build"
category = "Build"
owner = "AWS"
provider = "CodeBuild"
input_artifacts = var.source_stage_output_artifact_name
output_artifacts = ["build_output"]
version = "1"
configuration = {
ProjectName = aws_codebuild_project.code_build_stage_pipeline.name
locals {
webhook_secret = "super-secret"
name = var.github_hook_name
authentication = "GITHUB_HMAC"
target_action = "Source"
target_pipeline = aws_codepipeline.codepipeline.name
Join Stack Overflow to find the best answer to your technical question, help others
Sign up
answer theirs.
https://stackoverflow.com/questions/61214656/terraform-resource-github-repository-webhook-requires-github-organization-to-be 2/4
4/13/22, 12:08 PM amazon web services - Terraform resource github_repository_webhook requires GitHub organization to be set on the provider - …
authentication_configuration {
secret_token = "${local.webhook_secret}"
filter {
json_path = "$.ref"
repository = var.repo_name
configuration {
url = aws_codepipeline_webhook.github_hook.url
content_type = "json"
insecure_ssl = true
secret = local.webhook_secret
events = ["push"]
Logs:
aws_iam_role.example: Creating...
aws_iam_role.codepipeline_role: Creating...
aws_iam_role_policy.codepipeline_policy: Creating...
aws_iam_role_policy.example: Creating...
aws_codebuild_project.code_build_stage_pipeline: Creating...
aws_codepipeline.codepipeline: Creating...
aws_codepipeline_webhook.github_hook: Creating...
github_repository_webhook.web_hook_github: Creating...
ShareOverflow
Join Stack Follow to find the best answer toedited
yourApr 14, 2020question,
technical at 18:44 help others
asked Apr 14, 2020 at 18:26
Sign up
answer theirs. Umar Tahir
https://stackoverflow.com/questions/61214656/terraform-resource-github-repository-webhook-requires-github-organization-to-be 3/4
4/13/22, 12:08 PM amazon web services - Terraform resource github_repository_webhook requires GitHub organization to be set on the provider - …
536 4 19
Sorted by:
1 Answer
Highest score (default)
Join Stack Overflow to find the best answer to your technical question, help others
Sign up
answer theirs.
https://stackoverflow.com/questions/61214656/terraform-resource-github-repository-webhook-requires-github-organization-to-be 4/4