_scm_hipobject resource when leveraging the attribute within or not_within fails to create the resource as both days and hours are being enforced at the same time. This should be an or scenario when using days or hours.
Configuration being used:
terraform-disk-bkp:
folder: Shared
description: "Check if disk backup is enabled and configured correctly"
disk_backup:
criteria:
is_installed: true # Boolean only values
is_enabled: "yes" # Boolean only values
last_backup_time:
within:
hours: 7
vendor:
- name: "Apple Inc."
product:
- "Time Machine"
╷
│ Error: Error creating config
│
│ with module.hip_with_yaml.scm_hip_object.this["terraform-disk-bkp"],
│ on ../../modules/hip/main.tf line 1, in resource "scm_hip_object" "this":
│ 1: resource "scm_hip_object" "this" {
│
│ [HTTP 400] API_I00013 Your configuration is not valid. Please review the error message for more details. - map[errorType:Invalid Object errors:[] message:[
│ terraform-disk-bkp -> disk-backup -> criteria -> last-backup-time -> within cannot have more than one subconfiguration> terraform-disk-bkp -> disk-backup ->
│ criteria -> last-backup-time -> within is invalid>]]
╵
You can see the plan inserts hours, even when I don't specify it in the configuration. This also happens if I specify hours and not days in the configuration.
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# module.hip_with_yaml.scm_hip_object.this["terraform-disk-bkp"] will be created
+ resource "scm_hip_object" "this" {
+ description = "Check if disk backup is enabled and configured correctly"
+ disk_backup = {
+ criteria = {
+ is_installed = true
+ last_backup_time = {
+ not_available = false
+ within = {
+ days = 1
+ hours = 7
}
}
}
+ exclude_vendor = false
}
+ folder = "Shared"
+ id = (known after apply)
+ name = "terraform-disk-bkp"
+ tfid = (known after apply)
}
Possible solution
Steps to reproduce
Use the same configuration as my yaml example
Context
Your Environment
Version used: Terraform 1.4.6
Operating System and version (desktop or mobile): Mac OS 14.2.1
Describe the bug
_scm_hipobject resource when leveraging the attribute within or not_within fails to create the resource as both days and hours are being enforced at the same time. This should be an or scenario when using days or hours.
Configuration being used:
Resource is built this way:
Expected behavior
You should be able to specify not_available
Current behavior
You can see the plan inserts hours, even when I don't specify it in the configuration. This also happens if I specify hours and not days in the configuration.
Possible solution
Steps to reproduce
Context
Your Environment