Skip to content

Commit

Permalink
Merge pull request #8 from data-platform-hq/Application-Security-Grou…
Browse files Browse the repository at this point in the history
…ps-name
  • Loading branch information
owlleg6 authored Apr 18, 2024
2 parents c51d880 + cd5b346 commit 7c1af0b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ No resources.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_application_security_groups"></a> [application\_security\_groups](#input\_application\_security\_groups) | Set of unique strings to create Application Security Groups full names | `set(string)` | `[]` | no |
| <a name="input_automation_accounts"></a> [automation\_accounts](#input\_automation\_accounts) | Set of unique strings to create Automation Accounts full names | `set(string)` | `[]` | no |
| <a name="input_container_instances"></a> [container\_instances](#input\_container\_instances) | Set of unique strings to create Container Instances full names | `set(string)` | `[]` | no |
| <a name="input_dashboards"></a> [dashboards](#input\_dashboards) | Set of unique strings to create Dashboards full names | `set(string)` | `[]` | no |
Expand Down Expand Up @@ -62,6 +63,8 @@ No resources.

| Name | Description |
|------|-------------|
| <a name="output_application_security_group"></a> [application\_security\_group](#output\_application\_security\_group) | Built name of single Application Security Group |
| <a name="output_application_security_groups"></a> [application\_security\_groups](#output\_application\_security\_groups) | Built name of multiple Application Security Groups with unique particle |
| <a name="output_automation_account"></a> [automation\_account](#output\_automation\_account) | Built name of single Automation Account |
| <a name="output_automation_accounts"></a> [automation\_accounts](#output\_automation\_accounts) | Built name of multiple Automation Accounts with unique particle |
| <a name="output_container_instance"></a> [container\_instance](#output\_container\_instance) | Built name of single Container Instance |
Expand Down
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ locals {
network_security_group = substr(join("-", compact(["nsg", var.project, var.environment, var.location, var.instance_number])), 0, 80)
network_security_groups = { for item in var.network_security_groups : item => substr(join("-", compact(["nsg", var.project, item, var.environment, var.location, var.instance_number])), 0, 80) }

# Application Security Groups
application_security_group = substr(join("-", compact(["asg", var.project, var.environment, var.location, var.instance_number])), 0, 80)
application_security_groups = { for item in var.application_security_groups : item => substr(join("-", compact(["asg", var.project, item, var.environment, var.location, var.instance_number])), 0, 80) }

# Route Tables
route_table = substr(join("-", compact(["rt", var.project, var.environment, var.location, var.instance_number])), 0, 80)
route_tables = { for item in var.route_tables : item => substr(join("-", compact(["rt", var.project, item, var.environment, var.location, var.instance_number])), 0, 80) }
Expand Down
11 changes: 11 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ output "network_security_groups" {
value = local.network_security_groups
}

# Application Security Groups
output "application_security_group" {
description = "Built name of single Application Security Group"
value = local.application_security_group
}

output "application_security_groups" {
description = "Built name of multiple Application Security Groups with unique particle"
value = local.application_security_groups
}

# Route Tables
output "route_table" {
description = "Built name of single Route Table"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,9 @@ variable "user_assigned_identities" {
description = "Set of unique strings to create User Assigned Identities full names"
default = []
}

variable "application_security_groups" {
type = set(string)
description = "Set of unique strings to create Application Security Groups full names"
default = []
}

0 comments on commit 7c1af0b

Please sign in to comment.