Repository navigation
Expand file tree
/
Copy pathmain.tf
More file actions
65 lines (54 loc) · 1.4 KB
/
Copy pathmain.tf
File metadata and controls
65 lines (54 loc) · 1.4 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
55
56
57
58
59
60
61
62
63
64
65
terraform {
required_version = "~> 1.13"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 6.10.0"
}
local = {
source = "hashicorp/local"
version = "~> 2.6.0"
}
tls = {
source = "hashicorp/tls"
version = "~> 4.1.0"
}
}
backend "s3" {
bucket = "k8s-project-state"
key = "terraform.tfstate"
region = "us-east-1"
}
}
provider "aws" {
region = "us-east-1"
profile = "devops"
}
module "aws" {
source = "./modules/aws"
}
module "rke2" {
source = "./modules/rke2"
ansible_private_key_path = module.aws.ssh_key_path
token_secret_key = "devops-final-project"
rke2_engine_version = "v1.34.2+rke2r1"
server_ips = [module.aws.k8s_master_ip]
agent_ips = [module.aws.k8s_worker1_ip, module.aws.k8s_worker2_ip]
utility_ip = module.aws.utility_vm_ip
}
output "aws_k8s_master_ip" {
value = module.aws.k8s_master_ip
description = "The IP address of the K8s master node."
}
output "aws_k8s_worker1_ip" {
value = module.aws.k8s_worker1_ip
description = "The IP address of the K8s worker1 node."
}
output "aws_k8s_worker2_ip" {
value = module.aws.k8s_worker2_ip
description = "The IP address of the K8s worker2 node."
}
output "aws_utility_vm_ip" {
value = module.aws.utility_vm_ip
description = "The IP address of the utility VM."
}