Check in to allow collaboration.

This commit is contained in:
Curtis Wilson
2022-01-19 14:05:23 -05:00
parent 8283730606
commit d610a72022
5 changed files with 79 additions and 22 deletions
+8 -1
View File
@@ -48,7 +48,14 @@ locals {
# us-gov-west-1
owner-id = "219670896067"
name = "RHEL-8.*HVM*x86_64*GP2"
}
},
win-srv-2019 = {
# us-east-2
# owner-id = "???"
# us-gov-west-1
owner-id = "077303321853"
name = "Windows_Server-2019-English-Full-Base*"
},
}
}
+6 -2
View File
@@ -8,8 +8,12 @@ resource "aws_instance" "nodes" {
# the IP.
private_ip = length(var.private-ips) == 0 ? null : element(var.private-ips, count.index)
vpc_security_group_ids = var.security-group-ids
user_data = element(var.user-datas.*.rendered, count.index)
count = var.num-nodes
user_data = element(var.user-datas.*.rendered, count.index)
root_block_device {
volume_size = var.disk-size
delete_on_termination = true
}
count = var.num-nodes
tags = {
Name = "${var.name-prefix}-${count.index}"
+17 -11
View File
@@ -1,30 +1,36 @@
variable "ami" {
description = "The AWS AMI to be used for all the nodes"
type = string
type = string
}
variable "disk-size" {
default = 8
description = "The size of the root FS disk in GB."
type = number
}
variable "ec2-instance-type" {
default = "t2.micro"
default = "t2.micro"
description = "The AWS instance type to use for all nodes."
type = string
type = string
}
variable "name-prefix" {
default = "tf-node"
default = "tf-node"
description = "This prefix will be applied to all names created by this module."
type = string
type = string
}
variable "num-nodes" {
default = 1
default = 1
description = "The number of nodes to create from the given input parameters."
type = number
type = number
}
variable "private-ips" {
default = []
default = []
description = "A list of private IP addresses to use for the nodes. If the list is empty then each node will get an IP assigned from AWS."
type = list(string)
type = list(string)
}
variable "user-datas" {
@@ -33,10 +39,10 @@ variable "user-datas" {
variable "subnet-ids" {
description = "An array of subnet ids. These subnets will be round robined as the subnet to use for each node."
type = list(string)
type = list(string)
}
variable "security-group-ids" {
description = "A list of security group IDs to be applied to all the nodes."
type = list(string)
type = list(string)
}