Skip to content

Commit

Permalink
Merge pull request #4 from Geartrixy/master
Browse files Browse the repository at this point in the history
hotfix/security_group_changes
  • Loading branch information
Geartrixy authored Jan 18, 2018
2 parents 31f2588 + 0d2313e commit 023cbc2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ In behind coreOS and docker is used.
module "account" {
source = "zoitech/concourse/aws"
instance_name = "concourse"
instance_sg_id = "${aws_security_group.allow_all.id}"
instance_sg_id = "${aws_security_group.group_concourse.id}"
alb_sg_id = "${aws_security_group.allow_all.id}"
concourse_username = "concourse"
concourse_password = "Sup3rS3cur3"
instance_key_name = "my_key"
Expand Down
2 changes: 1 addition & 1 deletion ec2_alb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resource "aws_lb_target_group_attachment" "concourse" {
resource "aws_lb" "concourse" {
name = "${var.prefix}-concourse-alb"
internal = false
security_groups = ["${aws_security_group.GroupLB.id}","${var.instance_sg_id}"]
security_groups = ["${aws_security_group.GroupLB.id}","${var.alb_sg_id}"]
subnets = ["${var.public_sn_a}","${var.public_sn_b}"]

enable_deletion_protection = false
Expand Down
2 changes: 1 addition & 1 deletion ec2_instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ data "aws_ami" "coreos" {
resource "aws_instance" "ec2_linux_instance" {
ami = "${data.aws_ami.coreos.id}"
instance_type = "${var.instance_size}"
vpc_security_group_ids = ["${aws_security_group.RuleGroupLBHttpIn.id}"]
vpc_security_group_ids = ["${aws_security_group.RuleGroupLBHttpIn.id}", "${var.instance_sg_id}"]
subnet_id = "${var.private_sn_a}"
key_name = "${var.instance_key_name}"
user_data = "${replace(data.template_file.userdata.rendered,"/\\r/","")}"
Expand Down
9 changes: 8 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,20 @@ variable "instance_name" {
description = "The name of the Instance."
}
variable "instance_sg_id" {
description = "The Security Group ID which should be attached to the Instance."
type = "list"
description = "The Security Group ID/s which should be attached to the Instance."
}
variable "instance_size" {
description = "The size of the Instance's disk."
default = "t2.medium"
}

# Loadbalancer
variable "alb_sg_id" {
type = "list"
description = "The Security Group ID/s which should be attached to the Loadbalancer."
}

# Role
variable "role_policies" {
description = "The policies which would be attached to the EC2 Role."
Expand Down

0 comments on commit 023cbc2

Please sign in to comment.