|
@@ -37,6 +37,44 @@ module "nodes" {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+# Start CP Redis Testernode
|
|
|
+
|
|
|
+resource "aws_instance" "re" {
|
|
|
+ ami = data.aws_ami.re-ami.id
|
|
|
+ instance_type = "m5.4xlarge"
|
|
|
+ availability_zone = "${element(var.vpc-azs, 1)}"
|
|
|
+ subnet_id = "${element(module.vpc.subnets-public, 1)}"
|
|
|
+ vpc_security_group_ids = [module.nodes.re-security-group]
|
|
|
+ source_dest_check = false
|
|
|
+ key_name = var.vpc-name
|
|
|
+ tags = merge({ Name = "Tester-${var.vpc-name}-1" }, var.common-tags)
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+resource "aws_eip" "re-eip" {
|
|
|
+ vpc = true
|
|
|
+ tags = merge({ Name = "${var.vpc-name}-node-eip-1" }, var.common-tags)
|
|
|
+}
|
|
|
+
|
|
|
+resource "aws_eip_association" "re-eip-assoc" {
|
|
|
+ instance_id = "${element(aws_instance.re.*.id, 1)}"
|
|
|
+ allocation_id = "${element(aws_eip.re-eip.*.id, 1)}"
|
|
|
+ depends_on = ["aws_instance.re", "aws_eip.re-eip"]
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+resource "null_resource" "remote-config" {
|
|
|
+ provisioner "remote-exec" {
|
|
|
+ connection {
|
|
|
+ user = "ubuntu"
|
|
|
+ host = aws_eip.re-eip.public_ip
|
|
|
+ private_key = "${file("~/.ssh/${var.vpc-name}.pem")}"
|
|
|
+ agent = true
|
|
|
+ }
|
|
|
+ inline = ["sudo apt update > /dev/null && sudo apt install -y python python-pip > /dev/null"]
|
|
|
+ }
|
|
|
+ depends_on = ["aws_instance.re", "aws_eip_association.re-eip-assoc"]
|
|
|
+}
|
|
|
|
|
|
|
|
|
output "node-ips" {
|