Skip to content

Commit

Permalink
Add descriptions to terraform-aci-aaep (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
therealdoug committed Mar 21, 2024
1 parent c20baf4 commit 7fbff7e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions aci_access_policies.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module "aci_aaep" {

for_each = { for aaep in try(local.access_policies.aaeps, []) : aaep.name => aaep if local.modules.aci_aaep && var.manage_access_policies }
name = "${each.value.name}${local.defaults.apic.access_policies.aaeps.name_suffix}"
description = try(each.value.description, "")
infra_vlan = try(each.value.infra_vlan, local.defaults.apic.access_policies.aaeps.infra_vlan) == true ? try(local.access_policies.infra_vlan, 0) : 0
physical_domains = [for dom in try(each.value.physical_domains, []) : "${dom}${local.defaults.apic.access_policies.physical_domains.name_suffix}"]
routed_domains = [for dom in try(each.value.routed_domains, []) : "${dom}${local.defaults.apic.access_policies.routed_domains.name_suffix}"]
Expand Down
1 change: 1 addition & 0 deletions modules/terraform-aci-aaep/examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module "aci_aaep" {
version = ">= 0.8.0"

name = "AAEP1"
description = "AAEP1 Description"
infra_vlan = 10
physical_domains = ["PD1"]
routed_domains = ["RD1"]
Expand Down
1 change: 1 addition & 0 deletions modules/terraform-aci-aaep/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ resource "aci_rest_managed" "infraAttEntityP" {
class_name = "infraAttEntityP"
content = {
name = var.name
descr = var.description
}
}

Expand Down
11 changes: 11 additions & 0 deletions modules/terraform-aci-aaep/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ variable "name" {
}
}

variable "description" {
description = "Attachable access entity profile description"
type = string
default = ""

validation {
condition = can(regex("^[a-zA-Z0-9\\!#$%()*,-./:;@ _{|}~?&+]{0,128}$", var.description))
error_message = "Allowed characters: `a`-`z`, `A`-`Z`, `0`-`9`, `\\`, `!`, `#`, `$`, `%`, `(`, `)`, `*`, `,`, `-`, `.`, `/`, `:`, `;`, `@`, ` `, `_`, `{`, `|`, }`, `~`, `?`, `&`, `+`. Maximum characters: 128."
}
}

variable "infra_vlan" {
description = "Infrastructure vlan ID. A vlan ID of `0` disables the infrastructure vlan. Minimum value: 0. Maximum value: 4096."
type = number
Expand Down

0 comments on commit 7fbff7e

Please sign in to comment.