12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- provider "aws" {
- region = var.region
- profile = var.profile
- }
- module "vpc" {
- source = "../tfmodule-aws-2tier-vpc"
- region = var.region
- profile = var.profile
- vpc-name = var.vpc-name
- vpc-cidr = var.vpc-cidr
- vpc-azs = var.vpc-azs
- enable-private = false
- common-tags = {
- "Owner" = "maguec"
- "Project" = "example_terraform"
- }
- }
- module "nodes" {
- source = "../tfmodule-aws-redis-enterprise"
- region = var.region
- profile = var.profile
- open-nets = ["76.14.80.208/32"]
- data-node-count = 3
- vpc-cidr = var.vpc-cidr
- vpc-azs = var.vpc-azs
- vpc-name = var.vpc-name
- vpc-id = module.vpc.vpc-id
- vpc-subnets = module.vpc.subnets-public
- common-tags = {
- "Owner" = "maguec"
- "Project" = "example_terraform"
- }
- }
- output "node-ips" {
- value = <<EOT
- %{ for ip in module.nodes.node-ips ~}
- ssh -i ~/.ssh/${var.vpc-name}.pem -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ubuntu@${ip}
- %{ endfor ~}
- EOT
- }
|