Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Support granting source security group IDs access to consul-cluster #13

Closed
sclausson opened this issue Oct 9, 2017 · 3 comments
Closed

Comments

@sclausson
Copy link
Contributor

sclausson commented Oct 9, 2017

To be consistent with vault-cluster module there should be variables for allowed_ssh_security_group_ids and allowed_inbound_security_group_ids to allow security group IDs to access the cluster (in addition to, or instead of cidr_blocks).

Could be implemented exactly the same way in consul-cluster/main.tf

resource "aws_security_group_rule" "allow_ssh_inbound_from_security_group_ids" {
  count                    = "${length(var.allowed_ssh_security_group_ids)}"
  type                     = "ingress"
  from_port                = "${var.ssh_port}"
  to_port                  = "${var.ssh_port}"
  protocol                 = "tcp"
  source_security_group_id = "${element(var.allowed_ssh_security_group_ids, count.index)}"

  security_group_id = "${aws_security_group.lc_security_group.id}"
}

and multiple aws_security_group_rule resources in consul-security-group-rules/main.tf

resource "aws_security_group_rule" "allow_<some_protocol>_inbound_from_security_group_ids" {
  count                    = "${length(var.allowed_inbound_security_group_ids)}"
  type                     = "ingress"
  from_port                = "${var.<some_protocol>_port}"
  to_port                  = "${var.<some_protocol>_port}"
  protocol                 = "<tcp or udp>"
  source_security_group_id = "${element(var.allowed_inbound_security_group_ids, count.index)}"

  security_group_id = "${var.security_group_id}"
}
@brikis98
Copy link
Collaborator

brikis98 commented Oct 9, 2017

Agreed! PR welcome :)

@sclausson
Copy link
Contributor Author

#14

@sclausson
Copy link
Contributor Author

Thanks for merging!

Etiene pushed a commit that referenced this issue Mar 14, 2019
Allow 0 or more CIDR blocks in allow_ssh_cidr_blocks list
aedades pushed a commit to dreamboxlearning/terraform-aws-consul that referenced this issue Dec 6, 2022
Automatically publish AMIs for new releases.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants