main.tf 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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" = "example_terraform"
  16. }
  17. }
  18. module "nodes" {
  19. source = "../tfmodule-aws-redis-enterprise"
  20. region = var.region
  21. profile = var.profile
  22. open-nets = ["76.14.80.208/32"]
  23. data-node-count = 3
  24. re-volume-size = 250
  25. re-instance-type = "m5.4xlarge"
  26. vpc-cidr = var.vpc-cidr
  27. vpc-azs = var.vpc-azs
  28. vpc-name = var.vpc-name
  29. vpc-id = module.vpc.vpc-id
  30. vpc-subnets = module.vpc.subnets-public
  31. enable-flash = true
  32. common-tags = {
  33. "Owner" = "maguec"
  34. "Project" = "example_terraform"
  35. }
  36. }
  37. output "node-ips" {
  38. value = formatlist("ssh -i ~/.ssh/${var.vpc-name}.pem -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ubuntu@%s", module.nodes.node-ips)
  39. }