Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_container_app: secret.name validation has wrong error output #27934

Open
1 task done
nicoluca opened this issue Nov 7, 2024 · 0 comments · May be fixed by #27935
Open
1 task done

azurerm_container_app: secret.name validation has wrong error output #27934

nicoluca opened this issue Nov 7, 2024 · 0 comments · May be fixed by #27935

Comments

@nicoluca
Copy link

nicoluca commented Nov 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.9.8

AzureRM Provider Version

4.8.0

Affected Resource(s)/Data Source(s)

azurerm_container_app

Terraform Configuration Files

resource "azurerm_container_app" "example" {
  name                         = "example-app"
  container_app_environment_id = azurerm_container_app_environment.example.id
  resource_group_name          = azurerm_resource_group.example.name
  revision_mode                = "Single"

  secret {
    name  = "this.is.an.invalid.secret.name"
    value = "secret"
  }

  template {
    container {
      name   = "examplecontainerapp"
      image  = "mcr.microsoft.com/k8se/quickstart:latest"
      cpu    = 0.25
      memory = "0.5Gi"
    }
  }
}

Debug Output/Panic Output

2024-11-07T10:48:47.648+0100 [ERROR] vertex "module.redacted.main" error: "secret.0.name" must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character
2024-11-07T10:48:47.648+0100 [WARN]  provider.terraform-provider-azurerm_v4.8.0_x5: [WARN] Truncating attribute path of 1 diagnostics for TypeSet
2024-11-07T10:48:47.648+0100 [ERROR] provider.terraform-provider-azurerm_v4.8.0_x5: Response contains error diagnostic: @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 diagnostic_attribute="AttributeName(\"secret\")" tf_proto_version=5.6 tf_req_id=2e265cd9-ec49-8f32-d98d-68960eb4aede diagnostic_detail="" diagnostic_severity=ERROR diagnostic_summary="\"secret.0.name\" must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character" @module=sdk.proto tf_provider_addr=registry.terraform.io/hashicorp/azurerm tf_resource_type=azurerm_container_app tf_rpc=ValidateResourceTypeConfig timestamp="2024-11-07T10:48:47.648+0100"
2024-11-07T10:48:47.648+0100 [ERROR] vertex "module.redacted.main" error: "secret.0.name" must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character
╷
│ Error: "secret.0.name" must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character
│ 
│   with module.redacted.main,
│   on modules/redacted/main.tf line 17, in resource "azurerm_container_app" "main":
│   17: resource "azurerm_container_app" "main" {
│ 

Expected Behaviour

Allowance of '.' in azurerm_container_app.secret.name

Actual Behaviour

'.' is not allowed. The Azure portal UI is incoherent here (see pictures) but you are not allowed to create secrets in container app containing '.' in name/key. Also max length is not validated in provider.

Screenshot 2024-11-07 at 10 31 10
Screenshot 2024-11-07 at 10 31 21

Steps to Reproduce

terraform plan

Important Factoids

No response

References

Created a PR: #27935

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant