-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
54 lines (49 loc) · 1.79 KB
/
Copy pathmain.tf
File metadata and controls
54 lines (49 loc) · 1.79 KB
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
# Define required providers
terraform {
# Ensure the use of a compatible Terraform version
required_version = ">= 0.14.0"
required_providers {
# Define OpenStack terraform provider
openstack = {
source = "terraform-provider-openstack/openstack"
version = "~> 2.0.0"
}
infomaniak = {
source = "Infomaniak/infomaniak"
version = "1.4.1"
}
}
}
# Configure the OpenStack Provider
provider "openstack" {
auth_url = "https://api.pub1.infomaniak.cloud/identity"
region = "dc3-a"
user_name = "PCU-XXXXXXX" # TODO: changeme
tenant_name = "PCP-XXXXXXX" # TODO: changeme
password = "password" # TODO: changeme
}
provider "infomaniak" {
# Remember to set the API token as env variable INFOMANIAK_TOKEN
}
resource "infomaniak_kaas" "cluster" {
public_cloud_id = 12345 # TODO: changeme
public_cloud_project_id = 6789 # TODO: changeme
name = "my-cluster"
pack_name = "dedicated_4"
kubernetes_version = "1.33"
region = "dc3-a"
}
resource "infomaniak_kaas_instance_pool" "workers" {
public_cloud_id = infomaniak_kaas.cluster.public_cloud_id
public_cloud_project_id = infomaniak_kaas.cluster.public_cloud_project_id
kaas_id = infomaniak_kaas.cluster.id
name = "worker-pool"
flavor_name = "a4-ram16-disk80-perf1" # TODO: changeme
availability_zone = "dc3-a-04" #TODO: find the difference between [dc3-a-04 dc3-a-09 dc3-a-10
min_instances = 2
max_instances = 2
}
output "kubeconfig" {
value = infomaniak_kaas.cluster.kubeconfig
sensitive = true
}