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

mist_org_networktemplate snmp_config v3_config not optional #87

Open
Walter-Smet-at-delen opened this issue Feb 20, 2025 · 2 comments
Open
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Walter-Smet-at-delen
Copy link

Describe the bug

Adding snmp_config in mist_org_networktemplate fails:
v3_config is optional, but terraform apply results in error; same error when adding empty v3_config....

To Reproduce

Steps to reproduce the behavior:

  1. Create, update or refresh 'mist_org_networktemplate' resource or datasource
  2. Configure the resource/datasource with the following HCL configuration
  3. Use Terraform Apply
  4. See error

Terraform configuration

template.tf

locals {
  version  = "v002"
  data_path = "${path.module}/data/remotesite-${local.version}"
  wired_template    = jsondecode(file("${local.data_path}/wired_template.json"))
}
resource "mist_org_networktemplate" "RemoteSite_TF_v002" {
  name        = "RemoteSite_TF_${local.version}"
  org_id      = var.dpb_org_id
...
snmp_config     = local.wired_template.snmp_config

}

wired_template.json

{
  "snmp_config": {
    "enabled": true,
    "name": "",
    "location": "",
    "description": "",
    "contact": "[email protected]",
    "network": "cloudmgmt",
    "client_list": [
      {
        "client_list_name": "monitoring",
        "clients": [
          "10.1.2.10",
          "10.1.2.20"
        ]
      }
    ],
    "v2c_config": [
      {
        "community_name": "public-ro",
        "authorization": "read-only",
        "client_list_name": "monitoring"
      }
    ]
  },
...

Error Message

 Error: Invalid Object Attribute Type
│ 
│   with mist_org_networktemplate.RemoteSite_TF_v002,
│   on templates-remotesite-v002.tf line 93, in resource "mist_org_networktemplate" "RemoteSite_TF_v002":
│   93: resource "mist_org_networktemplate" "RemoteSite_TF_v002" {
│ 
│ While creating a Object value, an invalid attribute value was detected. A Object must use a matching attribute type for the value. This is always an issue with the provider and
│ should be reported to the provider developers.
│ 
│ Object Attribute Name (usm) Expected Type: types.ObjectType["engine_type":basetypes.StringType, "engineid":basetypes.StringType, "users":types.ListType[Snmpv3UsersType]]
│ Object Attribute Name (usm) Given Type: types.ObjectType["contents":types.ListType[ContentsType], "match":basetypes.StringType, "user":basetypes.StringType]

Additional context

Add any other context about the problem here.

@Walter-Smet-at-delen Walter-Smet-at-delen added the bug Something isn't working label Feb 20, 2025
@tmunzer
Copy link
Collaborator

tmunzer commented Feb 20, 2025

Thanks @Walter-Smet-at-delen , multiple snmp_config issues have been fixes on #84 , this one oncluded.
It will be part of the v0.2.21 release.

@tmunzer tmunzer added this to the v0.2.21 milestone Feb 20, 2025
@tmunzer tmunzer added duplicate This issue or pull request already exists and removed duplicate This issue or pull request already exists labels Feb 20, 2025
@tmunzer
Copy link
Collaborator

tmunzer commented Feb 20, 2025

ok, correction, I did some tests and it seems there an issue...
I'll fix that for the next release

tmunzer added a commit that referenced this issue Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants