Skip to content

Commit

Permalink
Merge pull request #35 from telekom-mms/fix_comment_syntax
Browse files Browse the repository at this point in the history
fix style of comments
  • Loading branch information
michaelamattes authored May 3, 2023
2 parents 381ded7 + e4b9ed9 commit 5e5ea37
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
24 changes: 12 additions & 12 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* # container
*
* This module manages the azurerm container resources.
* For more information see https://registry.terraform.io/providers/azurerm/latest/docs > container
* This module manages the hashicorp/azurerm container resources.
* For more information see https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs > container
*
*/

Expand All @@ -23,14 +23,14 @@ resource "azurerm_container_registry" "container_registry" {
anonymous_pull_enabled = local.container_registry[each.key].anonymous_pull_enabled
data_endpoint_enabled = local.container_registry[each.key].data_endpoint_enabled

/** policy can only be applied when using the Premium sku */
// policy can only be applied when using the Premium sku
dynamic "network_rule_set" {
for_each = local.container_registry[each.key].sku == "Premium" ? [1] : []
for_each = local.container_registry[each.key].sku == "Premium" ? [0] : []

content {
default_action = local.container_registry[each.key].network_rule_set.default_action

/** ip_rule and / or virtual_network are optional */
// ip_rule and / or virtual_network are optional
dynamic "ip_rule" {
for_each = contains(keys(local.container_registry[each.key].network_rule_set.ip_rule), "action") ? {} : local.container_registry[each.key].network_rule_set.ip_rule

Expand All @@ -51,27 +51,27 @@ resource "azurerm_container_registry" "container_registry" {
}
}

/** policy can only be applied when using the Premium sku */
// policy can only be applied when using the Premium sku
dynamic "retention_policy" {
for_each = local.container_registry[each.key].sku == "Premium" ? [1] : []
for_each = local.container_registry[each.key].sku == "Premium" ? [0] : []

content {
days = local.container_registry[each.key].retention_policy.days
enabled = local.container_registry[each.key].retention_policy.enabled
}
}

/** policy can only be applied when using the Premium sku */
// policy can only be applied when using the Premium sku
dynamic "trust_policy" {
for_each = local.container_registry[each.key].sku == "Premium" ? [1] : []
for_each = local.container_registry[each.key].sku == "Premium" ? [0] : []

content {
enabled = local.container_registry[each.key].trust_policy.enabled
}
}

dynamic "identity" {
for_each = local.container_registry[each.key].identity.type != null ? [1] : []
for_each = local.container_registry[each.key].identity.type != null ? [0] : []

content {
type = local.container_registry[each.key].identity.type
Expand All @@ -92,9 +92,9 @@ resource "azurerm_container_registry" "container_registry" {
}
}

/** policy can only be applied when using the Premium sku */
// policy can only be applied when using the Premium sku
dynamic "georeplications" {
for_each = local.container_registry[each.key].sku == "Premium" && local.container_registry[each.key].georeplications.location != "" ? [1] : []
for_each = local.container_registry[each.key].sku == "Premium" && local.container_registry[each.key].georeplications.location != "" ? [0] : []

content {
location = local.container_registry[each.key].georeplications.location
Expand Down
10 changes: 5 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ variable "container_registry" {

locals {
default = {
/** resource definition */
// resource definition
container_registry = {
name = ""
sku = "Basic"
Expand All @@ -15,11 +15,11 @@ locals {
quarantine_policy_enabled = null
zone_redundancy_enabled = null
export_policy_enabled = null
network_rule_bypass_option = "None" /** disallows default AzureServices as enabled for access */
network_rule_bypass_option = "None" // disallows default AzureServices as enabled for access
anonymous_pull_enabled = null
data_endpoint_enabled = null
network_rule_set = {
default_action = "Deny" /** behaviour for requests matching no rules */
default_action = "Deny" // behaviour for requests matching no rules
ip_rule = {
action = "Allow"
}
Expand Down Expand Up @@ -53,13 +53,13 @@ locals {
}
}

/** compare and merge custom and default values */
// compare and merge custom and default values
container_registry_values = {
for container_registry in keys(var.container_registry) :
container_registry => merge(local.default.container_registry, var.container_registry[container_registry])
}

/** deep merge of all custom and default values */
// deep merge of all custom and default values
container_registry = {
for container_registry in keys(var.container_registry) :
container_registry => merge(
Expand Down

0 comments on commit 5e5ea37

Please sign in to comment.