security-groups.tf 779 B

12345678910111213141516171819202122232425262728
  1. # Rather than pass in the aws security group, we just look it up. This will
  2. # probably be useful other places, as well.
  3. data "aws_security_group" "typical-host" {
  4. name = "typical-host"
  5. vpc_id = var.vpc_id
  6. }
  7. data "aws_security_group" "aws_endpoints" {
  8. name = "aws_endpoints"
  9. vpc_id = var.vpc_id
  10. }
  11. resource "aws_security_group" "instance" {
  12. name = local.server_name_stem
  13. description = "${local.server_name_stem} Instances"
  14. vpc_id = var.vpc_id
  15. tags = merge(var.standard_tags, var.tags)
  16. }
  17. resource "aws_security_group_rule" "instance-https-in" {
  18. description = "Access TQ/TQ API from internal IPs"
  19. type = "ingress"
  20. from_port = "443"
  21. to_port = "443"
  22. protocol = "tcp"
  23. cidr_blocks = var.supernets
  24. security_group_id = aws_security_group.instance.id
  25. }