Created
June 1, 2016 12:35
-
-
Save swade1987/d3ac437aa40ee3216247c53a20982fef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -v http://<instance ip>:2375 | |
* Rebuilt URL to: http://<instance ip>:2375/ | |
* Hostname was NOT found in DNS cache | |
* Trying <instance ip>... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ====== Security group for traffic into the ELB ====== # | |
resource "aws_security_group" "ingress_to_elb" { | |
name = "search-for-member - traffic to elb" | |
description = "search-for-member - traffic to elb" | |
vpc_id = "${var.vpc_id}" | |
ingress { | |
from_port = 80 | |
to_port = 80 | |
protocol = "tcp" | |
cidr_blocks = ["${var.ingress_cidr_blocks}"] | |
} | |
ingress { | |
from_port = 2375 | |
to_port = 2375 | |
protocol = "tcp" | |
cidr_blocks = ["${var.ingress_cidr_blocks}"] | |
} | |
} | |
# ====== Security group for traffic from the ELB ====== # | |
resource "aws_security_group" "egress_from_elb" { | |
name = "search-for-member - traffic from elb" | |
description = "search-for-member - traffic from elb" | |
vpc_id = "${var.vpc_id}" | |
egress { | |
from_port = 0 | |
to_port = 0 | |
protocol = "-1" | |
cidr_blocks = ["${var.ingress_cidr_blocks}"] | |
} | |
} | |
# ====== Security group for traffic into the instances. ====== # | |
resource "aws_security_group" "ingress_to_instances" { | |
name = "search-for-member - traffic to instances" | |
description = "search-for-member - traffic to instances" | |
vpc_id = "${var.vpc_id}" | |
ingress { | |
from_port = 22 | |
to_port = 22 | |
protocol = "tcp" | |
cidr_blocks = ["${var.ingress_cidr_blocks}"] | |
} | |
# HTTP from ELB | |
ingress { | |
from_port = 80 | |
to_port = 80 | |
protocol = "tcp" | |
security_groups = ["${aws_elb.search_for_member.source_security_group_id}"] | |
} | |
ingress { | |
from_port = 2375 | |
to_port = 2375 | |
protocol = "tcp" | |
security_groups = ["${aws_elb.search_for_member.source_security_group_id}"] | |
} | |
ingress { | |
from_port = 2375 | |
to_port = 2375 | |
protocol = "tcp" | |
cidr_blocks = ["${var.ingress_cidr_blocks}"] | |
} | |
} | |
# ====== Security group for traffic from the instances. ====== # | |
resource "aws_security_group" "egress_from_instances" { | |
name = "search-for-member - traffic from instances" | |
description = "search-for-member - traffic from instances" | |
vpc_id = "${var.vpc_id}" | |
egress { | |
from_port = 0 | |
to_port = 0 | |
protocol = "-1" | |
cidr_blocks = ["${var.ingress_cidr_blocks}"] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_security_group" "swarm_manager" { | |
name = "swarm-manager-security-group" | |
description = "Security group for Swarm Manager" | |
ingress { | |
from_port = 4000 | |
to_port = 4000 | |
protocol = "tcp" | |
cidr_blocks = ["${var.ingress_cidr_blocks}"] | |
} | |
ingress { | |
from_port = 22 | |
to_port = 22 | |
protocol = "tcp" | |
cidr_blocks = ["${var.ingress_cidr_blocks}"] | |
} | |
ingress { | |
from_port = 0 | |
to_port = 0 | |
protocol = "-1" | |
self = true | |
} | |
egress { | |
from_port = 0 | |
to_port = 0 | |
protocol = "-1" | |
cidr_blocks = ["${var.ingress_cidr_blocks}"] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment