https://github.com/senora-dev/terraform-aws-security-group
This Terraform module creates and manages security groups with configurable ingress and egress rules.
https://github.com/senora-dev/terraform-aws-security-group
Last synced: 4 months ago
JSON representation
This Terraform module creates and manages security groups with configurable ingress and egress rules.
- Host: GitHub
- URL: https://github.com/senora-dev/terraform-aws-security-group
- Owner: Senora-dev
- Created: 2025-06-12T06:31:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-25T14:49:31.000Z (12 months ago)
- Last Synced: 2025-09-13T12:45:13.007Z (9 months ago)
- Language: HCL
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS Security Group Terraform Module
This Terraform module creates and manages security groups with configurable ingress and egress rules.
## Features
- Create security groups
- Define multiple ingress and egress rules
- Support for self-referencing rules
- Tagging support
## Usage
```hcl
module "security_group" {
source = "Senora-dev/security-group/aws"
name = "my-sg"
description = "Security group for my app"
vpc_id = "vpc-12345678"
ingress_rules = [
{
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
]
egress_rules = [
{
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
]
tags = {
Environment = "dev"
Terraform = "true"
}
}
```
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| name | Name of the security group | `string` | n/a | yes |
| description | Description of the security group | `string` | n/a | yes |
| vpc_id | VPC ID | `string` | n/a | yes |
| ingress_rules | List of ingress rules | `list(object)` | `[]` | no |
| egress_rules | List of egress rules | `list(object)` | `[]` | no |
| tags | A map of tags to add to all resources | `map(string)` | `{}` | no |
## Outputs
| Name | Description |
|------|-------------|
| security_group_id | The ID of the security group |
| security_group_arn | The ARN of the security group |
## Maintainers
This module is maintained by [Senora.dev](https://senora.dev).