-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
67 lines (55 loc) · 1.79 KB
/
main.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
terraform {
required_version = ">= 1.4.0"
}
variable "pool" {
description = "Slurm pool of compute nodes"
default = []
}
module "aws" {
cluster_name = "julian"
guest_passwd = "battery-host-typo"
nb_users = 10
domain = "magiccastle.live"
instances = {
mgmt = { type = "t3.large", count = 1, tags = ["mgmt", "puppet", "nfs"] },
login = { type = "t3.medium", count = 1, tags = ["login", "public", "proxy"] },
node = { type = "t3.medium", count = 4, tags = ["node"] }
}
volumes = {
nfs = {
home = { size = 10, type = "gp2" }
project = { size = 10, type = "gp2" }
scratch = { size = 10, type = "gp2" }
}
}
# Rocky Linux 8 - ca-central-1
# https://rockylinux.org/cloud-images
image = "ami-09ada793eea1559e6"
public_keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBblyJ+6JynjS7kxzawodNvRrOTGVGj7266zcFJuq01N 1password_ed25519"]
generate_ssh_key = true
pool = var.pool
# AWS specifics
region = "ca-central-1"
source = "git::https://github.com/ComputeCanada/magic_castle.git//aws?ref=13.1.0"
config_git_url = "https://github.com/ComputeCanada/puppet-magic_castle.git"
config_version = "13.1.0"
}
output "accounts" {
value = module.aws.accounts
}
output "public_ip" {
value = module.aws.public_ip
}
## Uncomment to register your domain name with CloudFlare
module "dns" {
source = "git::https://github.com/ComputeCanada/magic_castle.git//dns/cloudflare"
name = module.aws.cluster_name
domain = module.aws.domain
bastions = module.aws.bastions
public_instances = module.aws.public_instances
ssh_private_key = module.aws.ssh_private_key
sudoer_username = module.aws.accounts.sudoer.username
}
output "hostnames" {
value = module.dns.hostnames
}