diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4fc98d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.idea/ +.terraform/ +common.tfvars +tfe-init.tfvars \ No newline at end of file diff --git a/workspaces/.gitignore b/workspaces/.gitignore new file mode 100644 index 0000000..db997fc --- /dev/null +++ b/workspaces/.gitignore @@ -0,0 +1,2 @@ +*.auto.tfvars +terraform.tfstate* \ No newline at end of file diff --git a/workspaces/backend.tf b/workspaces/backend.tf new file mode 100644 index 0000000..32b035c --- /dev/null +++ b/workspaces/backend.tf @@ -0,0 +1,7 @@ +terraform { +# backend "remote" { +# workspaces { +# name = "tfe-state" +# } +# } +} \ No newline at end of file diff --git a/workspaces/common.auto.tfvars b/workspaces/common.auto.tfvars new file mode 120000 index 0000000..726c7e7 --- /dev/null +++ b/workspaces/common.auto.tfvars @@ -0,0 +1 @@ +../common.tfvars \ No newline at end of file diff --git a/workspaces/main.tf b/workspaces/main.tf new file mode 100644 index 0000000..de47e25 --- /dev/null +++ b/workspaces/main.tf @@ -0,0 +1,8 @@ +resource "tfe_workspace" "ws" { + name = "infra-devs" + organization = var.terraform_cloud_org + vcs_repo { + identifier = "ops-guru/gcp-terraform-cloud" + oauth_token_id = var.oauth_token_id + } +} \ No newline at end of file diff --git a/workspaces/provider.tf b/workspaces/provider.tf new file mode 100644 index 0000000..cd3e9e7 --- /dev/null +++ b/workspaces/provider.tf @@ -0,0 +1,2 @@ +provider "tfe" { +} \ No newline at end of file diff --git a/workspaces/variables.tf b/workspaces/variables.tf new file mode 100644 index 0000000..558f527 --- /dev/null +++ b/workspaces/variables.tf @@ -0,0 +1,7 @@ +variable "terraform_cloud_org" { + description = "Organization in your terraform cloud" +} + +variable "oauth_token_id" { + description = "Oauth Token for Github access" +} \ No newline at end of file