main.tf 1.3 KB

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