-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathself-tfe.tf
33 lines (28 loc) · 995 Bytes
/
self-tfe.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
resource "tfe_organization" "self" {
email = var.tfe_organization_email
name = var.tfe_organization
}
resource "tfe_workspace" "self" {
name = replace(local.self-name, "/^terraform-/", "")
organization = tfe_organization.self.id
terraform_version = "1.1.7"
auto_apply = false
vcs_repo {
identifier = format("%s/%s", var.github_organization, github_repository.self.id)
oauth_token_id = tfe_oauth_client.self-github.oauth_token_id
}
}
resource "tfe_oauth_client" "self-gitlab" {
organization = tfe_organization.self.name
api_url = "https://gitlab.com/api/v4"
http_url = "https://gitlab.com"
oauth_token = var.gitlab_token
service_provider = "gitlab_hosted"
}
resource "tfe_oauth_client" "self-github" {
organization = tfe_organization.self.name
api_url = "https://api.github.com"
http_url = "https://github.com"
oauth_token = var.github_token
service_provider = "github"
}