UPD: updated readme and formated main.tf
This commit is contained in:
parent
697ce226d2
commit
6a330b123a
@ -1,54 +1,43 @@
|
|||||||
# security-groups-gen2
|
# security-group
|
||||||
This module create security groups from a map
|
This module create security group.
|
||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
| Name | Description | Type | Default | Required |
|
| Name | Description | Type | Default | Required |
|
||||||
|------|-------------|------|---------|:-----:|
|
|---------|-------------------|----------|---------|:--------:|
|
||||||
| tags | tags | List | n/a | yes |
|
|
||||||
| vpc-id | VPC id | string | n/a | yes |
|
| vpc-id | VPC id | string | n/a | yes |
|
||||||
| security-groups | See example below | map | n/a | yes |
|
| ingress | See example below | map | n/a | yes |
|
||||||
|
| egress | See example below | map | n/a | yes |
|
||||||
### security-groups input
|
|
||||||
Below is a sample security-groups map this module ingests
|
|
||||||
|
|
||||||
```
|
|
||||||
module "bea-bast-sg" {
|
|
||||||
source = "../../modules/compute/security_groups"
|
|
||||||
|
|
||||||
security-groups = [
|
|
||||||
{
|
|
||||||
name = "RackspaceAdmin2"
|
|
||||||
description = "Allow rdp/ssh access from Rackspace"
|
|
||||||
ingress = {
|
|
||||||
r1 = "icmp,-1,-1,0.0.0.0/0,ICMP ping"
|
|
||||||
r2 = "-1,-1,-1,1.2.3.4/32,Foo access"
|
|
||||||
}
|
|
||||||
egress = {
|
|
||||||
r1 = "-1,-1,-1,0.0.0.0/0,Default egress rule"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = "RackspaceAdmin"
|
|
||||||
description = "Allow rdp/ssh access from Rackspace"
|
|
||||||
ingress = {
|
|
||||||
r1 = "tcp,443,443,${aws_ec2_managed_prefix_list.rsip_range.id},Bar ip ranges"
|
|
||||||
r2 = "tcp,22,22,2.3.4.5/32,Joe Blow"
|
|
||||||
}
|
|
||||||
egress = {
|
|
||||||
r1 = "-1,-1,-1,0.0.0.0/0,Default egress rule"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
tags = local.default-tags
|
|
||||||
vpc-id = "vpc-xxx"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
|------|-------------|
|
|------------|--------------------------------|
|
||||||
| sg-id-name | A map of SG id and their names |
|
| sg-id-name | A map of SG id and their names |
|
||||||
|
|
||||||
|
### Example
|
||||||
|
Below is a sample root module calling this shared module
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
module "admin-sg" {
|
||||||
|
|
||||||
|
source = "../../modules/compute/security_group"
|
||||||
|
|
||||||
|
description = "Security group for admins"
|
||||||
|
egress = {
|
||||||
|
r1 = "tcp,4750,4750,1.2.3.4/32,Patch Management Tool"
|
||||||
|
r2 = "tcp,22,22,1.2.3.4/32,Patch Management Tool"
|
||||||
|
r3 = "tcp,52311,52311,${aws_ec2_managed_prefix_list.bigfix.id},Client to BigFix server"
|
||||||
|
}
|
||||||
|
ingress = {
|
||||||
|
r1 = "tcp,4750,4750,1.2.3.4/32,Patch Management Tool"
|
||||||
|
r2 = "tcp,22,22,1.2.3.4/32,Patch Management Tool"
|
||||||
|
r3 = "tcp,52311,52311,${aws_ec2_managed_prefix_list.bigfix.id},BigFix server to client"
|
||||||
|
}
|
||||||
|
name = "admin-sg"
|
||||||
|
vpc-id = "vpc-01a10b033169f89a8"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user