Tuesday, July 25, 2023

How to Create github repository using terraform ?

terraform {

  required_providers {

    github = {

      source  = "integrations/github"

      version = "~> 5.0"

    }

  }

}


# Configure the GitHub Provider

provider "github" {


    token = "Put-Github-Token"

}



resource "github_repository" "MyFirstRepo" {

  name = "terraform-module1"

  description = "This Module contain code for Start"

  visibility = "public"

}



Terraform commands


terraform init

terraform plan

terraform apply

No comments:

Post a Comment