terraform-provider-spotinst
terraform-provider-spotinst copied to clipboard
Cannot create spotinst_multai_target_set using traffic port
When creating health checks for MLB routing rules, it creates the checks only with the override
port.
There is no option to use traffic port
like can be done through the Spotinst Console.
Example:
Terraform Version
$ terraform version
Terraform v0.11.14
+ provider.spotinst v1.13.3
Affected Resource(s)
Please list the resources as a list, for example:
- spotinst_multai_target_set
Terraform Configuration Files
resource "spotinst_multai_target_set" "my_mlb_ts" {
count = "${length(var.my_target_sets)}"
name = "my${element(var.mlb_otp_target_sets, count.index)}_mlb_ts"
balancer_id = "${var.my_mlb_id}"
deployment_id = "${var.my_deployment_id}"
protocol = "http"
port = 8080
weight = 1
health_check {
protocol = "http"
path = "/my-servlet/ws/serverinfo"
**port = 8080**
interval = 10
timeout = 5
healthy_threshold = 2
unhealthy_threshold = 3
}
}
Expected Behavior
In the health_check
block, have the option to use the MLB traffic port
Actual Behavior
Only able to create an override
port
Steps to Reproduce
-
terraform apply
I tried leaving out the port
from the health_check
block, like so:
health_check {
protocol = "http"
path = "/my-servlet/ws/serverinfo"
interval = 10
timeout = 5
healthy_threshold = 2
unhealthy_threshold = 3
}
But this fails with error:
[ERROR] Failed to update target set [ts-XXXX]: PUT https://api.spotinst.io/loadBalancer/targetSet/ts-XXXX?accountId=act-XXXX: 422 VALIDATION_ERROR: targetSet.healthCheck.port must be greater than or equal to 1 (was 0)
MLB support is deprecated now. This issue is no longer valid.