Skip to content

Commit

Permalink
working example of terraform github - only working if provider is spe…
Browse files Browse the repository at this point in the history
…cified in modules main.tf file - possible mitigation -> integrations/terraform-provider-github#652
  • Loading branch information
Dennis Sobczak authored and Dennis Sobczak committed Feb 23, 2023
1 parent 102c9e0 commit 8cec23d
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions terraform_github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.terraform.lock.hcl
terraform.tfstate
terraform.tfstate.backup
.terraform
3 changes: 3 additions & 0 deletions terraform_github/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module "github" {
source = "./modules/github"
}
19 changes: 19 additions & 0 deletions terraform_github/modules/github/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
provider "github" {
token = "<token>"
owner = "<name_of_user>"
}

resource "github_repository" "example" {
name = "example"
description = "My awesome codebase"

visibility = "public"

/*
template {
owner = "<name_of_user>"
repository = "terraform-template-module"
include_all_branches = true
}
*/
}
6 changes: 6 additions & 0 deletions terraform_github/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
provider "github" {
token = "<token>"
owner = "<name>"
}
*/
9 changes: 9 additions & 0 deletions terraform_github/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = "~> 1.3"
required_providers {
github = {
source = "integrations/github"
version = "~> 4.0"
}
}
}

0 comments on commit 8cec23d

Please sign in to comment.