···11+.POSIX:
22+33+.PHONY: infra
44+infra:
55+ make -C infra
+1-1
infra/Makefile
···11-default: init apply
11+default: init plan
2233init:
44 terraform init
+16-3
infra/main.tf
···11+# TODO The private key generated by this resource will be stored unencrypted in your Terraform state file.
22+# Generate a private key file outside of Terraform and distribute it securely to the system where Terraform will be run instead.
33+resource "tls_private_key" "ssh" {
44+ algorithm = "ECDSA"
55+ ecdsa_curve = "P256"
66+}
77+88+module "network" {
99+ source = "./modules/network"
1010+}
1111+112module "k3s_cluster" {
22- source = "./modules/k3s-cluster"
33- server_count = 1
44- agent_count = 3
1313+ source = "./modules/k3s-cluster"
1414+ server_count = 1
1515+ agent_count = 3
1616+ ssh_public_key = tls_private_key.ssh.public_key_openssh
1717+ subnet_id = module.network.subnet_id
518}