Skip to content

Commit

Permalink
add short_description
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jun 21, 2021
1 parent 58d4541 commit ee92799
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion rds-oracle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_description"></a> [description](#input\_description) | Security group description | `string` | `"module: Oracle common ports"` | no |
| <a name="input_description"></a> [description](#input\_description) | Security Group Description | `string` | `"module: Oracle common ports"` | 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_name"></a> [name](#input\_name) | Security group Name | `string` | `"m-oracle-db"` | no |
| <a name="input_networks"></a> [networks](#input\_networks) | List of ingress networks (applies to all ports) | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| <a name="input_short_description"></a> [short\_description](#input\_short\_description) | Security Group Short Description | `string` | `"Oracle"` | 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 Name | `string` | `""` | no |
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | VPC ID Number | `string` | n/a | yes |
Expand Down
11 changes: 6 additions & 5 deletions rds-oracle/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@
*/

resource "aws_security_group" "this_security_group" {
name = local.name
description = local.description
vpc_id = var.vpc_id
name = local.name
description = local.description
short_description = var.short_description == "" ? var.description : var.short_description
vpc_id = var.vpc_id

# portlist
dynamic "ingress" {
for_each = local.ports_map
iterator = p
content {
description = "${local.description}: ${p.value["description"]}"
description = "${local.short_description}: ${p.value["description"]}"
from_port = p.value["from"]
to_port = p.value["to"]
protocol = p.value["proto"]
Expand All @@ -40,7 +41,7 @@ resource "aws_security_group" "this_security_group" {
}

egress {
description = "${local.description}: All"
description = "${local.short_description}: All"
from_port = 0
to_port = 0
protocol = -1
Expand Down
9 changes: 8 additions & 1 deletion rds-oracle/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ variable "name" {
}

variable "description" {
description = "Security group description"
description = "Security Group Description"
type = string
default = "module: Oracle common ports"
}

variable "short_description" {
description = "Security Group Short Description"
type = string
default = "Oracle"
}

variable "networks" {
description = "List of ingress networks (applies to all ports)"
type = list(string)
Expand All @@ -42,3 +48,4 @@ variable "tags" {
"Environment" = "csvd-infrastructure"
}
}

0 comments on commit ee92799

Please sign in to comment.