Skip to content

Commit

Permalink
change map() to {}
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jun 3, 2022
1 parent e3efa60 commit f0fb3f7
Show file tree
Hide file tree
Showing 13 changed files with 119 additions and 97 deletions.
10 changes: 6 additions & 4 deletions general/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
)
}
48 changes: 25 additions & 23 deletions it-linux-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,46 +22,48 @@ module "it-linux-base" {

| Name | Version |
|------|---------|
| terraform | >= 0.12 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12 |

## Providers

| Name | Version |
|------|---------|
| aws | n/a |
| <a name="provider_aws"></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)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | 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)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | 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` | <pre>{<br> "CostAllocation": "csvd:infrastructure",<br> "Environment": "csvd-infrastructure"<br>}</pre> | 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 |
| <a name="input_description"></a> [description](#input\_description) | Security Group Description | `string` | `"Linux Common Base Security Group"` | no |
| <a name="input_egress_networks"></a> [egress\_networks](#input\_egress\_networks) | List of egress networks (all ports) | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| <a name="input_egress_security_groups"></a> [egress\_security\_groups](#input\_egress\_security\_groups) | List of egress security groups (all ports) | `list(string)` | `[]` | no |
| <a name="input_enable_self"></a> [enable\_self](#input\_enable\_self) | Enable\|Disable self full access | `bool` | `false` | no |
| <a name="input_ingress_networks"></a> [ingress\_networks](#input\_ingress\_networks) | List of ingress networks for external access (not all ports) | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| <a name="input_ingress_security_groups"></a> [ingress\_security\_groups](#input\_ingress\_security\_groups) | List of ingress security groups for all ports | `list(string)` | `[]` | no |
| <a name="input_name"></a> [name](#input\_name) | Security Group Name | `string` | `"it-linux-base"` | no |
| <a name="input_short_description"></a> [short\_description](#input\_short\_description) | Security Group Short Description | `string` | `"Linux"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Extra security group tags | `map` | <pre>{<br> "CostAllocation": "csvd:infrastructure",<br> "Environment": "csvd-infrastructure"<br>}</pre> | no |
| <a name="input_use_vpc_cidr"></a> [use\_vpc\_cidr](#input\_use\_vpc\_cidr) | Enable\|Disable use of VPC CIDR block in the ingress\_networks | `bool` | `false` | no |
| <a name="input_vpc_full_name"></a> [vpc\_full\_name](#input\_vpc\_full\_name) | VPC Name | `string` | `""` | no |
| <a name="input_vpc_id"></a> [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 |
| <a name="output_this_security_group_arn"></a> [this\_security\_group\_arn](#output\_this\_security\_group\_arn) | Created security group ARN |
| <a name="output_this_security_group_id"></a> [this\_security\_group\_id](#output\_this\_security\_group\_id) | Created security group ID |
10 changes: 6 additions & 4 deletions it-linux-base/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
)
}
10 changes: 6 additions & 4 deletions it-windows-base/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
)
}
10 changes: 6 additions & 4 deletions kafka/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
)
}
50 changes: 25 additions & 25 deletions ois-scanner/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -22,46 +22,46 @@ module "ois-scanner" {

| Name | Version |
|------|---------|
| terraform | >= 0.12 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12 |

## Providers

| Name | Version |
|------|---------|
| aws | n/a |
| <a name="provider_aws"></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)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | 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)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | 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` | <pre>{<br> "CostAllocation": "csvd:infrastructure",<br> "Environment": "csvd-infrastructure"<br>}</pre> | 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 |
| <a name="input__module_version"></a> [\_module\_version](#input\_\_module\_version) | Module version number | `string` | `"1.17"` | no |
| <a name="input_description"></a> [description](#input\_description) | Security Group Description | `string` | `"OIS Scanner Security Group"` | no |
| <a name="input_egress_networks"></a> [egress\_networks](#input\_egress\_networks) | List of egress networks (all ports) | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| <a name="input_egress_security_groups"></a> [egress\_security\_groups](#input\_egress\_security\_groups) | List of egress security groups (all ports) | `list(string)` | `[]` | no |
| <a name="input_enable_self"></a> [enable\_self](#input\_enable\_self) | Enable\|Disable self full access | `bool` | `false` | no |
| <a name="input_ingress_networks"></a> [ingress\_networks](#input\_ingress\_networks) | List of ingress networks for external access (not all ports) | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| <a name="input_ingress_security_groups"></a> [ingress\_security\_groups](#input\_ingress\_security\_groups) | List of ingress security groups for all ports | `list(string)` | `[]` | no |
| <a name="input_name"></a> [name](#input\_name) | Security Group Name | `string` | `"ois-scanner"` | no |
| <a name="input_short_description"></a> [short\_description](#input\_short\_description) | Security Group Short Description | `string` | `"OIS"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Extra security group tags | `map` | <pre>{<br> "CostAllocation": "csvd:infrastructure",<br> "Environment": "csvd-infrastructure"<br>}</pre> | no |
| <a name="input_use_vpc_cidr"></a> [use\_vpc\_cidr](#input\_use\_vpc\_cidr) | Enable\|Disable use of VPC CIDR block in the ingress\_networks | `bool` | `false` | no |
| <a name="input_vpc_full_name"></a> [vpc\_full\_name](#input\_vpc\_full\_name) | VPC Name | `string` | `""` | no |
| <a name="input_vpc_id"></a> [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 |
| <a name="output_this_security_group_arn"></a> [this\_security\_group\_arn](#output\_this\_security\_group\_arn) | Created security group ARN |
| <a name="output_this_security_group_id"></a> [this\_security\_group\_id](#output\_this\_security\_group\_id) | Created security group ID |
9 changes: 6 additions & 3 deletions ois-scanner/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
)
}

Expand Down
10 changes: 6 additions & 4 deletions rds-maria/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
)
}
24 changes: 12 additions & 12 deletions rds-mssql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,36 @@ module "rds-mssql" {

| Name | Version |
|------|---------|
| terraform | >= 0.12 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12 |

## Providers

| Name | Version |
|------|---------|
| aws | n/a |
| <a name="provider_aws"></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` | <pre>{<br> "CostAllocation": "csvd:infrastructure",<br> "Environment": "csvd-infrastructure"<br>}</pre> | no |
| vpc\_full\_name | VPC full name | `string` | `""` | no |
| vpc\_id | VPC ID Number | `string` | n/a | yes |
| <a name="input_name"></a> [name](#input\_name) | Security group Name | `string` | `"m-rds-mssql"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Extra security group tags | `map` | <pre>{<br> "CostAllocation": "csvd:infrastructure",<br> "Environment": "csvd-infrastructure"<br>}</pre> | no |
| <a name="input_vpc_full_name"></a> [vpc\_full\_name](#input\_vpc\_full\_name) | VPC full name | `string` | `""` | no |
| <a name="input_vpc_id"></a> [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 |
| <a name="output_this_security_group_arn"></a> [this\_security\_group\_arn](#output\_this\_security\_group\_arn) | Created security group ARN |
| <a name="output_this_security_group_id"></a> [this\_security\_group\_id](#output\_this\_security\_group\_id) | Created security group ID |
9 changes: 6 additions & 3 deletions rds-mssql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
)
}
10 changes: 6 additions & 4 deletions rds-mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
)
}
6 changes: 3 additions & 3 deletions rds-oracle/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
})
}
)
}
10 changes: 6 additions & 4 deletions rds-postgres/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
)
}

0 comments on commit f0fb3f7

Please sign in to comment.