{"id":49818793,"url":"https://github.com/epsilon-limited-solutions/tf-module-security-groups","last_synced_at":"2026-05-13T09:02:29.871Z","repository":{"id":323073721,"uuid":"1086704543","full_name":"Epsilon-Limited-Solutions/tf-module-security-groups","owner":"Epsilon-Limited-Solutions","description":"Production-ready Terraform module for Security groups with predefined rule templates","archived":false,"fork":false,"pushed_at":"2025-10-30T19:32:04.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-08T00:18:15.103Z","etag":null,"topics":["aws","infrastructure","infrastructure-as-code","terraform","terraform-module"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Epsilon-Limited-Solutions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-30T19:32:00.000Z","updated_at":"2025-10-30T19:32:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Epsilon-Limited-Solutions/tf-module-security-groups","commit_stats":null,"previous_names":["epsilon-limited-solutions/tf-module-security-groups"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Epsilon-Limited-Solutions/tf-module-security-groups","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Epsilon-Limited-Solutions%2Ftf-module-security-groups","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Epsilon-Limited-Solutions%2Ftf-module-security-groups/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Epsilon-Limited-Solutions%2Ftf-module-security-groups/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Epsilon-Limited-Solutions%2Ftf-module-security-groups/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Epsilon-Limited-Solutions","download_url":"https://codeload.github.com/Epsilon-Limited-Solutions/tf-module-security-groups/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Epsilon-Limited-Solutions%2Ftf-module-security-groups/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32975183,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T06:31:55.726Z","status":"ssl_error","status_checked_at":"2026-05-13T06:31:51.336Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","infrastructure","infrastructure-as-code","terraform","terraform-module"],"created_at":"2026-05-13T09:02:28.456Z","updated_at":"2026-05-13T09:02:29.863Z","avatar_url":"https://github.com/Epsilon-Limited-Solutions.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tf-module-security-groups\n\nA flexible Terraform module for creating AWS Security Groups with support for predefined rule templates and custom rules.\n\n## Features\n\n- **Predefined Rule Templates**: HTTP, HTTPS, SSH patterns built-in\n- **Flexible Rule Definition**: Support for CIDR blocks, security groups, and prefix lists\n- **Description Required**: All rules must have descriptions for auditability\n- **Multiple Input Formats**: Simplified or detailed rule definitions\n- **Security Best Practices**: Revoke rules on delete, create before destroy\n\n## Usage\n\n### Basic Web Server Security Group\n\n```hcl\nmodule \"web_sg\" {\n  source = \"./tf-module-security-groups\"\n\n  name        = \"web-server\"\n  description = \"Security group for web servers\"\n  environment = \"production\"\n  vpc_id      = module.vpc.vpc_id\n\n  # Enable predefined rules\n  enable_http_ingress  = true\n  enable_https_ingress = true\n\n  http_ingress_cidr_blocks  = [\"10.0.0.0/8\"]\n  https_ingress_cidr_blocks = [\"10.0.0.0/8\"]\n\n  tags = {\n    Application = \"web\"\n  }\n}\n```\n\n### Database Security Group with Source Security Group\n\n```hcl\nmodule \"database_sg\" {\n  source = \"./tf-module-security-groups\"\n\n  name        = \"database\"\n  description = \"Security group for PostgreSQL database\"\n  environment = \"production\"\n  vpc_id      = module.vpc.vpc_id\n\n  enable_all_egress = false\n\n  ingress_with_source_security_group_id = [\n    {\n      description              = \"PostgreSQL from app servers\"\n      from_port                = 5432\n      protocol                 = \"tcp\"\n      source_security_group_id = module.app_sg.security_group_id\n      to_port                  = 5432\n    }\n  ]\n\n  egress_with_cidr_blocks = [\n    {\n      cidr_blocks = [\"10.0.0.0/8\"]\n      description = \"Allow outbound to VPC\"\n      from_port   = 0\n      protocol    = \"-1\"\n      to_port     = 0\n    }\n  ]\n\n  tags = {\n    Application = \"database\"\n  }\n}\n```\n\n### Complex Rules with Multiple Sources\n\n```hcl\nmodule \"app_sg\" {\n  source = \"./tf-module-security-groups\"\n\n  name        = \"application\"\n  description = \"Security group for application servers\"\n  environment = \"production\"\n  vpc_id      = module.vpc.vpc_id\n\n  # Custom ingress rules\n  ingress_rules = [\n    {\n      cidr_blocks              = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n      description              = \"HTTP from private subnets\"\n      from_port                = 8080\n      ipv6_cidr_blocks         = null\n      prefix_list_ids          = null\n      protocol                 = \"tcp\"\n      source_security_group_id = null\n      to_port                  = 8080\n    },\n    {\n      cidr_blocks              = null\n      description              = \"gRPC from other app servers\"\n      from_port                = 50051\n      ipv6_cidr_blocks         = null\n      prefix_list_ids          = null\n      protocol                 = \"tcp\"\n      source_security_group_id = module.app_sg.security_group_id\n      to_port                  = 50051\n    }\n  ]\n\n  tags = {\n    Application = \"app-tier\"\n  }\n}\n```\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| terraform | \u003e= 1.0 |\n| aws | \u003e= 5.0 |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|----------|\n| name | Name of the security group | `string` | n/a | yes |\n| description | Description of the security group | `string` | n/a | yes |\n| environment | Environment name | `string` | n/a | yes |\n| vpc_id | VPC ID | `string` | n/a | yes |\n| enable_all_egress | Enable all outbound traffic | `bool` | `true` | no |\n| enable_http_ingress | Enable HTTP ingress | `bool` | `false` | no |\n| enable_https_ingress | Enable HTTPS ingress | `bool` | `false` | no |\n| enable_ssh_ingress | Enable SSH ingress | `bool` | `false` | no |\n| ingress_rules | List of ingress rules | `list(object)` | `[]` | no |\n| egress_rules | List of egress rules | `list(object)` | `[]` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| security_group_id | The ID of the security group |\n| security_group_arn | The ARN of the security group |\n| security_group_name | The name of the security group |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepsilon-limited-solutions%2Ftf-module-security-groups","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepsilon-limited-solutions%2Ftf-module-security-groups","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepsilon-limited-solutions%2Ftf-module-security-groups/lists"}