Create a new manifest called github.tf in the directory, and paste that into there:
Copy the use provider code to create your first block
terraform {
required_providers {
github = {
source = "integrations/github"
version = "4.30.0"
}
}
}
provider "github" {
# Configuration options
}
Under authenticate in https://registry.terraform.io/providers/integrations/github/latest/docs,
you see that a token is required. Generate a token in your github accoundt under the developer settings within settings . When creating the token, select the operations for repo and
delete_repo.
- Navigate to github_repository in the documentation and copy the example usage into your VS Code, You can remove the template and description part since they are optional, change the
visibility to public/private and name it as terraform repo
Run Following Commands
$ terraform init
- Download Providers & Modules
$ terraform validate
- Validate .tf profile
$ terraform plan
- DRY RUN
$ terraform apply
- Create a resources &&& store a resonse IN STATE file(json)
Now go to your github and you can see your repo
Top comments (0)