diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 19b5625..981deae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.31.0 + rev: v1.47.0 hooks: # - id: terraform_validate - id: terraform_fmt diff --git a/it-linux-base/.x/main.tf b/it-linux-base/.x/main.tf index fd805bc..23fc593 100644 --- a/it-linux-base/.x/main.tf +++ b/it-linux-base/.x/main.tf @@ -18,38 +18,38 @@ */ locals { - description = "Linux Common Base Ports" + description = "Linux Common Base Ports" short_description = "Linux" - name = var.name + name = var.name ports = [ - [ 1433, 1433, "tcp" ], - [ 5023, 5023, "tcp" ] + [1433, 1433, "tcp"], + [5023, 5023, "tcp"] ] } resource "aws_security_group" "this_security_group" { - name = local.name + name = local.name description = local.description - vpc_id = var.vpc_id + vpc_id = var.vpc_id dynamic "ingress" { for_each = local.ports iterator = p content { description = local.description - from_port = p.value[0] - to_port = p.value[1] - protocol = p.value[2] - cidr_blocks = [ "0.0.0.0/0" ] + from_port = p.value[0] + to_port = p.value[1] + protocol = p.value[2] + cidr_blocks = ["0.0.0.0/0"] } } egress { description = "ALL ${local.description}" - from_port = 0 - to_port = 0 - protocol = -1 - cidr_blocks = [ "0.0.0.0/0" ] + from_port = 0 + to_port = 0 + protocol = -1 + cidr_blocks = ["0.0.0.0/0"] } tags = merge( diff --git a/it-linux-base/.x/output.tf b/it-linux-base/.x/output.tf index f9c3840..fbdd35a 100644 --- a/it-linux-base/.x/output.tf +++ b/it-linux-base/.x/output.tf @@ -1,9 +1,9 @@ output "this_security_group_id" { description = "Created security group ID" - value = aws_security_group.this_security_group.id + value = aws_security_group.this_security_group.id } output "this_security_group_arn" { description = "Created security group ARN" - value = aws_security_group.this_security_group.arn + value = aws_security_group.this_security_group.arn } diff --git a/it-linux-base/.x/variables.tf b/it-linux-base/.x/variables.tf index f0d6a0e..0049ac2 100644 --- a/it-linux-base/.x/variables.tf +++ b/it-linux-base/.x/variables.tf @@ -1,19 +1,19 @@ variable "vpc_id" { description = "VPC ID Number" - type = string + type = string } variable "name" { description = "Security group Name" - type = string - default = "m-rds-mssql" + type = string + default = "m-rds-mssql" } variable "tags" { description = "Extra security group tags" - type = map - default = { + type = map + default = { "CostAllocation" = "csvd:infrastructure" - "Environment" = "csvd-infrastructure" + "Environment" = "csvd-infrastructure" } } diff --git a/it-linux-base/.x/version.tf b/it-linux-base/.x/version.tf index 82a588a..2d967be 100644 --- a/it-linux-base/.x/version.tf +++ b/it-linux-base/.x/version.tf @@ -1,5 +1,5 @@ variable "_module_version" { description = "Module version number" - type = string - default = "1.4" + type = string + default = "1.4" } diff --git a/it-linux-base/README.md b/it-linux-base/README.md index e22a66c..f2a1c67 100644 --- a/it-linux-base/README.md +++ b/it-linux-base/README.md @@ -64,3 +64,4 @@ No Modules. | Name | Description | |------|-------------| | this\_security\_group\_arn | Created security group ARN | +| this\_security\_group\_id | Created security group ID | diff --git a/it-windows-base/README.md b/it-windows-base/README.md index 83fdc2b..7c2097e 100644 --- a/it-windows-base/README.md +++ b/it-windows-base/README.md @@ -30,6 +30,18 @@ module "it-windows-base" { |------|---------| | aws | n/a | +## Modules + +No Modules. + +## Resources + +| Name | +|------| +| [aws_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/security_group) | +| [aws_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | +| [aws_vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | + ## Inputs | Name | Description | Type | Default | Required | diff --git a/ois-scanner/README.md b/ois-scanner/README.md index e52c791..3c1e4c1 100644 --- a/ois-scanner/README.md +++ b/ois-scanner/README.md @@ -30,6 +30,17 @@ module "ois-scanner" { |------|---------| | aws | n/a | +## Modules + +No Modules. + +## Resources + +| Name | +|------| +| [aws_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | +| [aws_vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | + ## Inputs | Name | Description | Type | Default | Required | diff --git a/rds-mssql/README.md b/rds-mssql/README.md index 5943cbe..063be78 100644 --- a/rds-mssql/README.md +++ b/rds-mssql/README.md @@ -28,6 +28,16 @@ module "rds-mssql" { |------|---------| | aws | n/a | +## Modules + +No Modules. + +## Resources + +| Name | +|------| +| [aws_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | + ## Inputs | Name | Description | Type | Default | Required | diff --git a/rds-oracle/main.tf b/rds-oracle/main.tf index dd3e339..60be493 100644 --- a/rds-oracle/main.tf +++ b/rds-oracle/main.tf @@ -22,7 +22,7 @@ resource "aws_security_group" "this_security_group" { description = local.description vpc_id = var.vpc_id -# portlist + # portlist dynamic "ingress" { for_each = local.ports_map iterator = p diff --git a/rds-oracle/output.tf b/rds-oracle/output.tf index f9c3840..fbdd35a 100644 --- a/rds-oracle/output.tf +++ b/rds-oracle/output.tf @@ -1,9 +1,9 @@ output "this_security_group_id" { description = "Created security group ID" - value = aws_security_group.this_security_group.id + value = aws_security_group.this_security_group.id } output "this_security_group_arn" { description = "Created security group ARN" - value = aws_security_group.this_security_group.arn + value = aws_security_group.this_security_group.arn } diff --git a/rds-oracle/ports.tf b/rds-oracle/ports.tf index 15a2dd0..80c0160 100644 --- a/rds-oracle/ports.tf +++ b/rds-oracle/ports.tf @@ -2,13 +2,13 @@ locals { description = "module: Oracle common ports" name = var.name ports = [ - [ 1521, 1521, "tcp", "oracle-db", [] ], - [ 1570, 1571, "tcp", "oracle-db", [] ], - [ 3872, 3872, "tcp", "inbound-oracle-OEM", [ "172.24.101.9/32", "172.24.101.10/32", "172.24.32.251/32" ] ], - [ 7799, 7799, "tcp", "oracle-OEM", [] ], + [1521, 1521, "tcp", "oracle-db", []], + [1570, 1571, "tcp", "oracle-db", []], + [3872, 3872, "tcp", "inbound-oracle-OEM", ["172.24.101.9/32", "172.24.101.10/32", "172.24.32.251/32"]], + [7799, 7799, "tcp", "oracle-OEM", []], ] ingress_networks = var.networks - egress_networks = var.egress_networks - ports_fields = ["from","to","proto","description","cidr"] - ports_map = [ for p in local.ports: zipmap(local.ports_fields,p) ] + egress_networks = var.egress_networks + ports_fields = ["from", "to", "proto", "description", "cidr"] + ports_map = [for p in local.ports : zipmap(local.ports_fields, p)] } diff --git a/rds-oracle/variables.tf b/rds-oracle/variables.tf index 3da9c4f..5824124 100644 --- a/rds-oracle/variables.tf +++ b/rds-oracle/variables.tf @@ -1,38 +1,38 @@ variable "vpc_id" { description = "VPC ID Number" - type = string + type = string } variable "vpc_full_name" { description = "VPC Name" - type = string - default = "" + type = string + default = "" } variable "name" { description = "Security group Name" - type = string -# default = "m-rds-oracle" + type = string + # default = "m-rds-oracle" default = "m-oracle-db" } variable "networks" { description = "List of ingress networks (applies to all ports)" - type = list(string) - default = [ "0.0.0.0/0" ] + type = list(string) + default = ["0.0.0.0/0"] } variable "egress_networks" { description = "List of egress networks (all ports)" - type = list(string) - default = [ "0.0.0.0/0" ] + type = list(string) + default = ["0.0.0.0/0"] } variable "tags" { description = "Extra security group tags" - type = map + type = map default = { "CostAllocation" = "csvd:infrastructure" - "Environment" = "csvd-infrastructure" + "Environment" = "csvd-infrastructure" } }