-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproviders.tf
81 lines (73 loc) · 2.26 KB
/
providers.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
terraform {
required_version = ">= 1"
backend "gcs" {
bucket = "diamonds-terraform-state"
}
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "3.4.0"
}
google = {
source = "hashicorp/google"
}
google-beta = {
source = "hashicorp/google-beta"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "2.6.1"
}
helm = {
source = "hashicorp/helm"
version = "2.4.1"
}
mysql = {
source = "terraform-providers/mysql"
}
circleci = {
source = "mrolla/circleci"
}
}
}
# In case of Terraform Cloud project setup this env vars MUST be defined:
# - GOOGLE_CREDENTIALS : Service account key JSON file without line breaks
# - GOOGLE_PROJECT : GCP Project ID
# - GOOGLE_REGION : Preferred region
# - GOOGLE_ZONE : Preferred zone
provider "google" {
project = "sustained-truck-300419"
region = "europe-west3"
zone = "europe-west3-a"
}
provider "google-beta" {
project = "sustained-truck-300419"
region = "europe-west3"
zone = "europe-west3-a"
}
provider "kubernetes" {
host = "https://${google_container_cluster.this.endpoint}"
token = data.google_client_config.this.access_token
cluster_ca_certificate = base64decode(google_container_cluster.this.master_auth[0].cluster_ca_certificate)
}
provider "helm" {
kubernetes {
host = "https://${google_container_cluster.this.endpoint}"
token = data.google_client_config.this.access_token
cluster_ca_certificate = base64decode(google_container_cluster.this.master_auth.0.cluster_ca_certificate)
}
}
provider "cloudflare" {
api_token = data.google_secret_manager_secret_version.this["cf_api_token"].secret_data
api_user_service_key = data.google_secret_manager_secret_version.this["cf_api_user_service_key"].secret_data
}
provider "mysql" {
endpoint = google_sql_database_instance.mysql.public_ip_address
username = google_sql_user.mysql_root.name
password = random_password.mysql_root_password.result
}
provider "circleci" {
api_token = data.google_secret_manager_secret_version.this["circleci_token"].secret_data
vcs_type = "github"
organization = "AlexShuraits"
}