Icinga / terraform-provider-icinga2

Terraform Icinga2 provider
https://www.terraform.io/docs/providers/icinga2/
Mozilla Public License 2.0
21 stars 20 forks source link

Support zone definition for resource_icinga2_host #70

Open wilfriedroset opened 2 years ago

wilfriedroset commented 2 years ago

Hi there,

Would it be possible to add support for zone when defining a host and release a new version of the provider?

Terraform Version

terraform: 1.1.9 provider: 0.5.0

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

resource "icinga2_host" "host" {
  hostname      = "terraform-host-1"
  address       = "10.10.10.1"
  check_command = "hostalive"
  templates     = ["bp-host-web"]
  zone = "zone1"

  vars = {
    os        = "linux"
    osver     = "1"
    allowance = "none"
  }
}

Expected Behavior

It is possible to create a host within a given zone

Actual Behavior

It is not possible to define the zone associated with a host

References

The implementation is already done in one alternative providier: https://github.com/openHPI/terraform-provider-icinga2/blob/master/icinga2/resource_icinga2_host.go#L59

See: https://github.com/openHPI/terraform-provider-icinga2/issues/1