Open KiyoIchikawa opened 8 months ago
Hi, Thank you for taking the time to report this issue, Did you create "haproxy_backend" terraform resource first ?
for example like this:
resource "haproxy_backend" "backend" {
name = ...
mode = "tcp"
balance {
algorithm = "..."
}
}
data "haproxy_backend" "backend" {
name = var.haproxy_backend_name
}
the err is:
with module.module2["server02"].data.haproxy_backend.backend,
│ on ../../modules/module2/providers.tf line 47, in data "haproxy_backend" "backend":
│ 47: data "haproxy_backend" "backend" {
It's possible that the 'haproxy_backend' doesn't exist.
@KiyoIchikawa
I'm glad I can help out, thank you for creating this provider! We appreciate your time on this.
The "haproxy_backend" is not managed by Terraform and does exist in the HAProxy instance given to the provider. We are hoping to manage the base HAProxy configuration via a different tool and insert servers into pre-existing backends (not managed by Terraform) as the servers are created by Terraform.
Prerequisites
Description
We are trying to use the plugin in a module and getting a hard crash. Our Terraform code layout is like this:
References go like this: development/appA --calls--> modules/module2 --calls--> modules/module1
module2 uses the haproxy provider plugin and another provider plugin. The module code looks like this:
The calling module looks like this:
Steps to Reproduce
Create setup similar to above to use the haproxy provider plugin.
Expected behavior: Server "server01.domain" to be added to "some_443-backend" in HAProxy.
Actual behavior: Plugin crashes with following error:
Reproduces how often: [What percentage of the time does it reproduce?]
Versions
Terraform v1.7.0 on darwin_arm64
Additional Information
Any additional information, configuration or data that might be necessary to reproduce the issue.