Skip to content

incorrect map element type: attribute "ingress": attributes "target_port" and "traffic_weight" are required #26

Open

Description

Is there an existing issue for this?

  • I have searched the existing issues

Greenfield/Brownfield provisioning

greenfield

Terraform Version

v1.3.4

Module Version

v0.2.0

AzureRM Provider Version

v3.75.0

Affected Resource(s)/Data Source(s)

azurerm_container_app.container_app

Terraform Configuration Files

module "container-apps" {
  source  = "Azure/container-apps/azure"
  version = "0.2.0"
  # insert the 5 required variables here
  container_apps                                           = var.container_apps
  container_app_environment_name                           = var.container_app_environment_name
  location                                                 = var.location
  log_analytics_workspace_name                             = var.log_analytics_workspace_name
  resource_group_name                                      = "testrsg"
  container_app_secrets                                    = var.container_app_secrets
}

tfvars variables values

container_app_environment_name = "dev1"
log_analytics_workspace_name   = "dev1"
resource_group_name            = "dev1"
location                       = "eastus2"
container_apps = {
  test = {
    name          = "nginx"
    revision_mode = "Multiple"
    template = {
      containers = [{
        name         = "nginx"
        image        = "nginx:latest"
        cpu          = ".25"
        memory       = "0.5Gi"
        max_replicas = 2
        min_replicas = 1
        liveness_probe = {
          port      = 80
          transport = "HTTP"
        }
        readiness_probe = {
          port      = 80
          transport = "HTTP"
        }
        startup_probe = {
          port      = 80
          transport = "HTTP"
        }
      }]
      ingress = {
        target_port    = 80  
        traffic_weight = {
          percentage = 50  
        }
      }
    }
  }
}

Debug Output/Panic Output

│ Error: Invalid value for input variable
│
│   on main.tf line 5, in module "container-apps":
│    5:   container_apps                                           = var.container_apps
│
│ The given value is not suitable for module.container-apps.var.container_apps declared at .terraform\modules\container-apps\variables.tf:7,1-26: incorrect map element type: attribute "ingress": attributes "target_port" and  
│ "traffic_weight" are required.
╵
╷
│ Error: Missing required argument
│
│   with module.container-apps.azurerm_container_app_environment.container_env,
│   on .terraform\modules\container-apps\main.tf line 25, in resource "azurerm_container_app_environment" "container_env":
│   25:   internal_load_balancer_enabled = var.container_app_environment_internal_load_balancer_enabled
│
│ "internal_load_balancer_enabled": all of `infrastructure_subnet_id,internal_load_balancer_enabled` must be specified

Expected Behaviour

I expected that it would be easy to run a container app with this module.
In docs only 5 required variables. Documentation is not clear.

Actual Behaviour

I had more than 5 required and errors

Steps to Reproduce

No response

Important Factoids

No response

References

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions