main.tf 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. provider "aws" {
  2. region = var.region
  3. profile = var.profile
  4. }
  5. module "vpc" {
  6. source = "../tfmodule-aws-2tier-vpc"
  7. region = var.region
  8. profile = var.profile
  9. vpc-name = var.vpc-name
  10. vpc-cidr = var.vpc-cidr
  11. vpc-azs = var.vpc-azs
  12. enable-private = false
  13. common-tags = {
  14. "Owner" = "maguec"
  15. }
  16. }
  17. module "nodes" {
  18. source = "../tfmodule-aws-redis-enterprise"
  19. region = var.region
  20. profile = var.profile
  21. open-nets = ["76.14.80.208/32"]
  22. data-node-count = 3
  23. re-volume-size = 500
  24. re-instance-type = "m5.4xlarge"
  25. vpc-cidr = var.vpc-cidr
  26. vpc-azs = var.vpc-azs
  27. vpc-name = var.vpc-name
  28. vpc-id = module.vpc.vpc-id
  29. vpc-subnets = module.vpc.subnets-public
  30. enable-flash = true
  31. common-tags = {
  32. "Owner" = "maguec"
  33. "Project" = "Visa-Backup-Restore-Test"
  34. "Gabe" = "Please-Leave-UP"
  35. }
  36. }
  37. output "node-ips" {
  38. value = <<EOT
  39. %{ for ip in module.nodes.node-ips ~}
  40. ssh -i ~/.ssh/${var.vpc-name}.pem -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ubuntu@${ip}
  41. %{ endfor ~}
  42. EOT
  43. }