Skip to content

BUG: Cannot Create Org and Org Resources in one Terraform Apply #1695

@ehuizar1028

Description

@ehuizar1028

Not sure if I'm missing anything, but while trying to create an org and an org web hook, I get this error
this resource can only be used in the context of an organization

I am using a PAT to authenticate.

Meaning that the Terraform Github Provider does not detect the Org during the first apply, I'm assuming the Provider is not recognizing the Org.

Subsequent applies works after. Is there a way to get this to work in one terraform operation?

Steps to reproduce

resource "github_enterprise_organization" "org" {
  enterprise_id = data.github_enterprise.enterprise.id
  name          = "some-awesome-org"
  description   = "Organization created with terraform"
  billing_email = "[email protected]"
  admin_logins  = [
    "jon-snow"
  ]
}

resource "github_organization_webhook" "foo" {
  name = "web"

  configuration {
    url          = "https://google.de/"
    content_type = "form"
    insecure_ssl = false
  }

  active = false

  events = ["issues"]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleUsed by stalebot to clean houseStatus: Up for grabsIssues that are ready to be worked on by anyoneType: BugSomething isn't working as documentedhacktoberfestIssues for participation in Hacktoberfest

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions