From f0fb3f7faa7d328fb5104932c83ec0c38b43ed17 Mon Sep 17 00:00:00 2001 From: badra001 Date: Fri, 3 Jun 2022 13:27:00 -0400 Subject: [PATCH] change map() to {} --- general/main.tf | 10 +++++---- it-linux-base/README.md | 48 ++++++++++++++++++++------------------- it-linux-base/main.tf | 10 +++++---- it-windows-base/main.tf | 10 +++++---- kafka/main.tf | 10 +++++---- ois-scanner/README.md | 50 ++++++++++++++++++++--------------------- ois-scanner/main.tf | 9 +++++--- rds-maria/main.tf | 10 +++++---- rds-mssql/README.md | 24 ++++++++++---------- rds-mssql/main.tf | 9 +++++--- rds-mysql/main.tf | 10 +++++---- rds-oracle/main.tf | 6 ++--- rds-postgres/main.tf | 10 +++++---- 13 files changed, 119 insertions(+), 97 deletions(-) diff --git a/general/main.tf b/general/main.tf index 2c45a16..e9f2da2 100644 --- a/general/main.tf +++ b/general/main.tf @@ -112,10 +112,12 @@ resource "aws_security_group" "this_security_group" { } tags = merge( - map("Name", "sg-${local.name}"), var.tags, - map("boc:created_by", "terraform"), - map("boc:tf_module_version", local._module_version), - map("boc:vpc:info", join(" ", compact(list(var.vpc_id, var.vpc_full_name)))), + { + "Name" = "sg-${local.name}" + "boc:created_by" = "terraform" + "boc:tf_module_version" = local._module_version + "boc:vpc:info" = join(" ", compact(list(var.vpc_id, var.vpc_full_name))) + } ) } diff --git a/it-linux-base/README.md b/it-linux-base/README.md index f2a1c67..b8f11a3 100644 --- a/it-linux-base/README.md +++ b/it-linux-base/README.md @@ -2,7 +2,7 @@ This describes how to use the aws-common-security-groups submodule for it-linux-base. -Commonly used ports and services are set up here, including ICMP, SSH, NTP, DNS, SNMP, +Commonly used ports and services are set up here, including ICMP, SSH, NTP, DNS, SNMP, monit, munin, iperf, netperf, NetBackup and Opsware. ## Usage @@ -22,46 +22,48 @@ module "it-linux-base" { | Name | Version | |------|---------| -| terraform | >= 0.12 | +| [terraform](#requirement\_terraform) | >= 0.12 | ## Providers | Name | Version | |------|---------| -| aws | n/a | +| [aws](#provider\_aws) | n/a | ## Modules -No 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) | +| Name | Type | +|------|------| +| [aws_security_group.this_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource | +| [aws_security_group.egress_security_groups](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/security_group) | data source | +| [aws_security_group.ingress_security_groups](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/security_group) | data source | +| [aws_vpc.selected](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source | +| [aws_vpc.this_vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| description | Security Group Description | `string` | `"Linux Common Base Security Group"` | no | -| egress\_networks | List of egress networks (all ports) | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| egress\_security\_groups | List of egress security groups (all ports) | `list(string)` | `[]` | no | -| enable\_self | Enable\|Disable self full access | `bool` | `false` | no | -| ingress\_networks | List of ingress networks for external access (not all ports) | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| ingress\_security\_groups | List of ingress security groups for all ports | `list(string)` | `[]` | no | -| name | Security Group Name | `string` | `"it-linux-base"` | no | -| short\_description | Security Group Short Description | `string` | `"Linux"` | no | -| tags | Extra security group tags | `map` |
{
"CostAllocation": "csvd:infrastructure",
"Environment": "csvd-infrastructure"
}
| no | -| use\_vpc\_cidr | Enable\|Disable use of VPC CIDR block in the ingress\_networks | `bool` | `false` | no | -| vpc\_full\_name | VPC Name | `string` | `""` | no | -| vpc\_id | VPC ID Number | `string` | n/a | yes | +| [description](#input\_description) | Security Group Description | `string` | `"Linux Common Base Security Group"` | no | +| [egress\_networks](#input\_egress\_networks) | List of egress networks (all ports) | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_security\_groups](#input\_egress\_security\_groups) | List of egress security groups (all ports) | `list(string)` | `[]` | no | +| [enable\_self](#input\_enable\_self) | Enable\|Disable self full access | `bool` | `false` | no | +| [ingress\_networks](#input\_ingress\_networks) | List of ingress networks for external access (not all ports) | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [ingress\_security\_groups](#input\_ingress\_security\_groups) | List of ingress security groups for all ports | `list(string)` | `[]` | no | +| [name](#input\_name) | Security Group Name | `string` | `"it-linux-base"` | no | +| [short\_description](#input\_short\_description) | Security Group Short Description | `string` | `"Linux"` | no | +| [tags](#input\_tags) | Extra security group tags | `map` |
{
"CostAllocation": "csvd:infrastructure",
"Environment": "csvd-infrastructure"
}
| no | +| [use\_vpc\_cidr](#input\_use\_vpc\_cidr) | Enable\|Disable use of VPC CIDR block in the ingress\_networks | `bool` | `false` | no | +| [vpc\_full\_name](#input\_vpc\_full\_name) | VPC Name | `string` | `""` | no | +| [vpc\_id](#input\_vpc\_id) | VPC ID Number | `string` | n/a | yes | ## Outputs | Name | Description | |------|-------------| -| this\_security\_group\_arn | Created security group ARN | -| this\_security\_group\_id | Created security group ID | +| [this\_security\_group\_arn](#output\_this\_security\_group\_arn) | Created security group ARN | +| [this\_security\_group\_id](#output\_this\_security\_group\_id) | Created security group ID | diff --git a/it-linux-base/main.tf b/it-linux-base/main.tf index 82a94e5..c9e3a84 100644 --- a/it-linux-base/main.tf +++ b/it-linux-base/main.tf @@ -113,9 +113,11 @@ resource "aws_security_group" "this_security_group" { tags = merge( var.tags, - map("boc:created_by", "terraform"), - map("boc:tf_module_version", local._module_version), - map("boc:vpc:info", join(" ", compact(list(var.vpc_id, var.vpc_full_name)))), - map("Name", "sg-${local.name}"), + { + "Name" = "sg-${local.name}" + "boc:created_by" = "terraform" + "boc:tf_module_version" = local._module_version + "boc:vpc:info" = join(" ", compact(list(var.vpc_id, var.vpc_full_name))) + } ) } diff --git a/it-windows-base/main.tf b/it-windows-base/main.tf index 2c45a16..e9f2da2 100644 --- a/it-windows-base/main.tf +++ b/it-windows-base/main.tf @@ -112,10 +112,12 @@ resource "aws_security_group" "this_security_group" { } tags = merge( - map("Name", "sg-${local.name}"), var.tags, - map("boc:created_by", "terraform"), - map("boc:tf_module_version", local._module_version), - map("boc:vpc:info", join(" ", compact(list(var.vpc_id, var.vpc_full_name)))), + { + "Name" = "sg-${local.name}" + "boc:created_by" = "terraform" + "boc:tf_module_version" = local._module_version + "boc:vpc:info" = join(" ", compact(list(var.vpc_id, var.vpc_full_name))) + } ) } diff --git a/kafka/main.tf b/kafka/main.tf index 1131039..de59946 100644 --- a/kafka/main.tf +++ b/kafka/main.tf @@ -131,10 +131,12 @@ resource "aws_security_group" "this_security_group" { } tags = merge( - map("Name", "sg-${local.name}"), var.tags, - map("boc:created_by", "terraform"), - map("boc:tf_module_version", local._module_version), - map("boc:vpc:info", join(" ", compact(list(var.vpc_id, var.vpc_full_name)))), + { + "Name" = "sg-${local.name}" + "boc:created_by" = "terraform" + "boc:tf_module_version" = local._module_version + "boc:vpc:info" = join(" ", compact(list(var.vpc_id, var.vpc_full_name))) + } ) } diff --git a/ois-scanner/README.md b/ois-scanner/README.md index 3c1e4c1..0b46f89 100644 --- a/ois-scanner/README.md +++ b/ois-scanner/README.md @@ -1,8 +1,8 @@ # About -This describes how to use the aws-common-security-groups submodule for ois-scanner. This sets up -a module for a security group in the respective VPC. When construting a new VPC, we want to include -this module. This should be in each VPC we have, in production. We probably need a similar one +This describes how to use the aws-common-security-groups submodule for ois-scanner. This sets up +a module for a security group in the respective VPC. When construting a new VPC, we want to include +this module. This should be in each VPC we have, in production. We probably need a similar one for the CAT environment, but we'll tackle that when we get to it. # Usage @@ -22,46 +22,46 @@ module "ois-scanner" { | Name | Version | |------|---------| -| terraform | >= 0.12 | +| [terraform](#requirement\_terraform) | >= 0.12 | ## Providers | Name | Version | |------|---------| -| aws | n/a | +| [aws](#provider\_aws) | n/a | ## Modules -No 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) | +| Name | Type | +|------|------| +| [aws_security_group.this_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource | +| [aws_vpc.selected](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| \_module\_version | Module version number | `string` | `"1.17"` | no | -| description | Security Group Description | `string` | `"OIS Scanner Security Group"` | no | -| egress\_networks | List of egress networks (all ports) | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| egress\_security\_groups | List of egress security groups (all ports) | `list(string)` | `[]` | no | -| enable\_self | Enable\|Disable self full access | `bool` | `false` | no | -| ingress\_networks | List of ingress networks for external access (not all ports) | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| ingress\_security\_groups | List of ingress security groups for all ports | `list(string)` | `[]` | no | -| name | Security Group Name | `string` | `"ois-scanner"` | no | -| short\_description | Security Group Short Description | `string` | `"OIS"` | no | -| tags | Extra security group tags | `map` |
{
"CostAllocation": "csvd:infrastructure",
"Environment": "csvd-infrastructure"
}
| no | -| use\_vpc\_cidr | Enable\|Disable use of VPC CIDR block in the ingress\_networks | `bool` | `false` | no | -| vpc\_full\_name | VPC Name | `string` | `""` | no | -| vpc\_id | VPC ID Number | `string` | n/a | yes | +| [\_module\_version](#input\_\_module\_version) | Module version number | `string` | `"1.17"` | no | +| [description](#input\_description) | Security Group Description | `string` | `"OIS Scanner Security Group"` | no | +| [egress\_networks](#input\_egress\_networks) | List of egress networks (all ports) | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_security\_groups](#input\_egress\_security\_groups) | List of egress security groups (all ports) | `list(string)` | `[]` | no | +| [enable\_self](#input\_enable\_self) | Enable\|Disable self full access | `bool` | `false` | no | +| [ingress\_networks](#input\_ingress\_networks) | List of ingress networks for external access (not all ports) | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [ingress\_security\_groups](#input\_ingress\_security\_groups) | List of ingress security groups for all ports | `list(string)` | `[]` | no | +| [name](#input\_name) | Security Group Name | `string` | `"ois-scanner"` | no | +| [short\_description](#input\_short\_description) | Security Group Short Description | `string` | `"OIS"` | no | +| [tags](#input\_tags) | Extra security group tags | `map` |
{
"CostAllocation": "csvd:infrastructure",
"Environment": "csvd-infrastructure"
}
| no | +| [use\_vpc\_cidr](#input\_use\_vpc\_cidr) | Enable\|Disable use of VPC CIDR block in the ingress\_networks | `bool` | `false` | no | +| [vpc\_full\_name](#input\_vpc\_full\_name) | VPC Name | `string` | `""` | no | +| [vpc\_id](#input\_vpc\_id) | VPC ID Number | `string` | n/a | yes | ## Outputs | Name | Description | |------|-------------| -| this\_security\_group\_arn | Created security group ARN | -| this\_security\_group\_id | Created security group ID | +| [this\_security\_group\_arn](#output\_this\_security\_group\_arn) | Created security group ARN | +| [this\_security\_group\_id](#output\_this\_security\_group\_id) | Created security group ID | diff --git a/ois-scanner/main.tf b/ois-scanner/main.tf index 52042ba..c6a0860 100644 --- a/ois-scanner/main.tf +++ b/ois-scanner/main.tf @@ -55,10 +55,13 @@ resource "aws_security_group" "this_security_group" { } tags = merge( - map("Name", "sg-${var.name}"), var.tags, - map("boc:tf_module_version", var._module_version), - map("boc:vpc:info", join(" ", compact(list(var.vpc_id, var.vpc_full_name)))), + { + "Name" = "sg-${var.name}" + "boc:created_by" = "terraform" + "boc:tf_module_version" = local._module_version + "boc:vpc:info" = join(" ", compact(list(var.vpc_id, var.vpc_full_name))) + } ) } diff --git a/rds-maria/main.tf b/rds-maria/main.tf index dc04635..67c8eeb 100644 --- a/rds-maria/main.tf +++ b/rds-maria/main.tf @@ -112,10 +112,12 @@ resource "aws_security_group" "this_security_group" { } tags = merge( - map("Name", "sg-${local.name}"), var.tags, - map("boc:created_by", "terraform"), - map("boc:tf_module_version", local._module_version), - map("boc:vpc:info", join(" ", compact(list(var.vpc_id, var.vpc_full_name)))), + { + "Name" = "sg-${local.name}" + "boc:created_by" = "terraform" + "boc:tf_module_version" = local._module_version + "boc:vpc:info" = join(" ", compact(list(var.vpc_id, var.vpc_full_name))) + } ) } diff --git a/rds-mssql/README.md b/rds-mssql/README.md index 063be78..5e0f57c 100644 --- a/rds-mssql/README.md +++ b/rds-mssql/README.md @@ -20,36 +20,36 @@ module "rds-mssql" { | Name | Version | |------|---------| -| terraform | >= 0.12 | +| [terraform](#requirement\_terraform) | >= 0.12 | ## Providers | Name | Version | |------|---------| -| aws | n/a | +| [aws](#provider\_aws) | n/a | ## Modules -No Modules. +No modules. ## Resources -| Name | -|------| -| [aws_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | +| Name | Type | +|------|------| +| [aws_security_group.this_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| name | Security group Name | `string` | `"m-rds-mssql"` | no | -| tags | Extra security group tags | `map` |
{
"CostAllocation": "csvd:infrastructure",
"Environment": "csvd-infrastructure"
}
| no | -| vpc\_full\_name | VPC full name | `string` | `""` | no | -| vpc\_id | VPC ID Number | `string` | n/a | yes | +| [name](#input\_name) | Security group Name | `string` | `"m-rds-mssql"` | no | +| [tags](#input\_tags) | Extra security group tags | `map` |
{
"CostAllocation": "csvd:infrastructure",
"Environment": "csvd-infrastructure"
}
| no | +| [vpc\_full\_name](#input\_vpc\_full\_name) | VPC full name | `string` | `""` | no | +| [vpc\_id](#input\_vpc\_id) | VPC ID Number | `string` | n/a | yes | ## Outputs | Name | Description | |------|-------------| -| this\_security\_group\_arn | Created security group ARN | -| this\_security\_group\_id | Created security group ID | +| [this\_security\_group\_arn](#output\_this\_security\_group\_arn) | Created security group ARN | +| [this\_security\_group\_id](#output\_this\_security\_group\_id) | Created security group ID | diff --git a/rds-mssql/main.tf b/rds-mssql/main.tf index 1301722..0e87ffc 100644 --- a/rds-mssql/main.tf +++ b/rds-mssql/main.tf @@ -53,9 +53,12 @@ resource "aws_security_group" "this_security_group" { } tags = merge( - map("Name", local.name), var.tags, - map("boc:tf_module_version", local._module_version), - map("boc:vpc:info", join(" ", compact(list(var.vpc_id, var.vpc_full_name)))), + { + "Name" = "sg-${local.name}" + "boc:created_by" = "terraform" + "boc:tf_module_version" = local._module_version + "boc:vpc:info" = join(" ", compact(list(var.vpc_id, var.vpc_full_name))) + } ) } diff --git a/rds-mysql/main.tf b/rds-mysql/main.tf index 6204dc4..b89d375 100644 --- a/rds-mysql/main.tf +++ b/rds-mysql/main.tf @@ -112,10 +112,12 @@ resource "aws_security_group" "this_security_group" { } tags = merge( - map("Name", "sg-${local.name}"), var.tags, - map("boc:created_by", "terraform"), - map("boc:tf_module_version", local._module_version), - map("boc:vpc:info", join(" ", compact(list(var.vpc_id, var.vpc_full_name)))), + { + "Name" = "sg-${local.name}" + "boc:created_by" = "terraform" + "boc:tf_module_version" = local._module_version + "boc:vpc:info" = join(" ", compact(list(var.vpc_id, var.vpc_full_name))) + } ) } diff --git a/rds-oracle/main.tf b/rds-oracle/main.tf index 72893ec..87986cf 100644 --- a/rds-oracle/main.tf +++ b/rds-oracle/main.tf @@ -49,11 +49,11 @@ resource "aws_security_group" "this_security_group" { tags = merge( var.tags, - tomap({ + { "Name" = "sg-${local.name}" - "boc:tf_module_version" = local._module_version "boc:created_by" = "terraform" + "boc:tf_module_version" = local._module_version "boc:vpc:info" = join(" ", compact(list(var.vpc_id, var.vpc_full_name))) - }) + } ) } diff --git a/rds-postgres/main.tf b/rds-postgres/main.tf index 0e1cf60..7ab9257 100644 --- a/rds-postgres/main.tf +++ b/rds-postgres/main.tf @@ -112,10 +112,12 @@ resource "aws_security_group" "this_security_group" { } tags = merge( - map("Name", "sg-${local.name}"), var.tags, - map("boc:created_by", "terraform"), - map("boc:tf_module_version", local._module_version), - map("boc:vpc:info", join(" ", compact(list(var.vpc_id, var.vpc_full_name)))), + { + "Name" = "sg-${local.name}" + "boc:created_by" = "terraform" + "boc:tf_module_version" = local._module_version + "boc:vpc:info" = join(" ", compact(list(var.vpc_id, var.vpc_full_name))) + } ) }