-
Notifications
You must be signed in to change notification settings - Fork 28
/
providers.tf
74 lines (68 loc) · 4.19 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
# Configure the Microsoft Azure Provider
provider "azurerm" {
subscription_id = "dff2ec18-6a8e-405c-8e45-b7df7465acf0"
resource_provider_registrations = "none"
features {}
}
provider "azurerm" {
alias = "jenkins-sponsorship"
subscription_id = "1311c09f-aee0-4d6c-99a4-392c2b543204"
resource_provider_registrations = "none"
features {}
}
provider "kubernetes" {
alias = "privatek8s"
host = azurerm_kubernetes_cluster.privatek8s.kube_config.0.host
client_certificate = base64decode(azurerm_kubernetes_cluster.privatek8s.kube_config.0.client_certificate)
client_key = base64decode(azurerm_kubernetes_cluster.privatek8s.kube_config.0.client_key)
cluster_ca_certificate = base64decode(azurerm_kubernetes_cluster.privatek8s.kube_config.0.cluster_ca_certificate)
}
provider "kubernetes" {
alias = "publick8s"
host = data.azurerm_kubernetes_cluster.publick8s.kube_config.0.host
client_certificate = base64decode(data.azurerm_kubernetes_cluster.publick8s.kube_config.0.client_certificate)
client_key = base64decode(data.azurerm_kubernetes_cluster.publick8s.kube_config.0.client_key)
cluster_ca_certificate = base64decode(data.azurerm_kubernetes_cluster.publick8s.kube_config.0.cluster_ca_certificate)
}
provider "kubernetes" {
alias = "cijenkinsio_agents_1"
host = "https://${azurerm_kubernetes_cluster.cijenkinsio_agents_1.fqdn}:443" # Cannot use the kubeconfig host as it provides a private DNS name
client_certificate = base64decode(azurerm_kubernetes_cluster.cijenkinsio_agents_1.kube_config.0.client_certificate)
client_key = base64decode(azurerm_kubernetes_cluster.cijenkinsio_agents_1.kube_config.0.client_key)
cluster_ca_certificate = base64decode(azurerm_kubernetes_cluster.cijenkinsio_agents_1.kube_config.0.cluster_ca_certificate)
}
provider "kubernetes" {
alias = "infracijenkinsio_agents_1"
host = "https://${azurerm_kubernetes_cluster.infracijenkinsio_agents_1.fqdn}:443" # Cannot use the kubeconfig host as it provides a private DNS name
client_certificate = base64decode(azurerm_kubernetes_cluster.infracijenkinsio_agents_1.kube_config.0.client_certificate)
client_key = base64decode(azurerm_kubernetes_cluster.infracijenkinsio_agents_1.kube_config.0.client_key)
cluster_ca_certificate = base64decode(azurerm_kubernetes_cluster.infracijenkinsio_agents_1.kube_config.0.cluster_ca_certificate)
}
provider "postgresql" {
/**
Important: terraform must be allowed to reach this instance through the network. Check the followings:
- If running in Jenkins, ensure that the subnet of the agents is peered to the subnet of this postgreSQL instance
* Don't forget to also check the network security group rules
- If running locally, ensure that:
* your /etc/hosts defines an entry with <azurerm_postgresql_flexible_server.public.fqdn> to 127.0.0.1
* you've opened an SSH tunnel such as `ssh -L 5432:<azurerm_postgresql_flexible_server.public.fqdn>:5432` through a machine of the private network
**/
host = azurerm_postgresql_flexible_server.public_db.fqdn
username = local.public_db_pgsql_admin_login
password = random_password.public_db_pgsql_admin_password.result
superuser = false
}
provider "mysql" {
/**
Important: terraform must be allowed to reach this instance through the network. Check the followings:
- If running in Jenkins, ensure that the subnet of the agents is peered to the subnet of this mysql instance
* Don't forget to also check the network security group rules
- If running locally, ensure that:
* your /etc/hosts defines an entry with <azurerm_mysql_flexible_server.public.fqdn> to 127.0.0.1
* you've opened an SSH tunnel such as `ssh -L 3306:<azurerm_mysql_flexible_server.public.fqdn>:3306` through a machine of the private network
**/
endpoint = "${azurerm_mysql_flexible_server.public_db_mysql.fqdn}:3306"
username = local.public_db_mysql_admin_login
password = random_password.public_db_mysql_admin_password.result
tls = true # Mandatory for Azure MySQL Flexible instances
}