Posts

Showing posts from May, 2017

Next - Terraform + CloudFormation = ELK Cluster

Next - Terraform + CloudFormation = ELK Cluster

Next - Terraform + CloudFormation = RabbitMQ Cluster with ASG

resource "aws_security_group" "rabbitmq" {
  name   = "rabbitmq"
  vpc_id = "${aws_vpc.vpc.id}"

  ingress {
    protocol    = "tcp"
    from_port   = 5439
    to_port     = 5439
    cidr_blocks = ["0.0.0.0/0"]
  }

  ingress {
    protocol    = "icmp"
    from_port   = -1
    to_port     = -1
    cidr_blocks = ["0.0.0.0/0"]
  }

  egress {
    protocol    = -1
    from_port   = 0
    to_port     = 0
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "template_file" "rabbitmq_cloudformation" {
  template = "${file("rabbitmq.cloudformation")}"

  vars {
    rabbitmq_public_subnet_id  = "${element(split(",",

terraform_remote_state.shared.output.public_subnet_ids), 0)}"
    rabbitmq_security_group_id = "${aws_security_group.rabbitmq.id}"
  }
}

resource "aws_cloudformation_stack" "heavy_rabbitmq" {
  name          = &qu…