You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resource"aws_alb""rancher-ctl-host-alb" {
name="rancher-ctl-host-alb"internal=falseload_balancer_type="application"ip_address_type="ipv4"subnets=["${data.aws_subnet_ids.vpc_subnets.ids}"]
security_groups=[
"${data.terraform_remote_state.core.rancher-ctl-host-alb-sg-id}"
]
}
# create an application load balancer listener resource"aws_alb_listener""rancher-ctl-host-alb-listener" {
load_balancer_arn="${aws_alb.rancher-ctl-host-alb.arn}"port=80protocol="HTTP"default_action {
type="forward"target_group_arn="${aws_alb_target_group.rancher-ctl-host-target-group.arn}"
}
}
# create the application load balancer target groupresource"aws_alb_target_group""rancher-ctl-host-target-group" {
name="rancher-ctl-host-target-group"port=8080protocol="HTTP"vpc_id="${data.terraform_remote_state.core.default-vpc-id}"
}
# attach the three hosts to the target groupresource"aws_alb_target_group_attachment""rancher-ctl-host-target-group-instances" {
target_group_arn="${aws_alb_target_group.rancher-ctl-host-target-group.arn}"target_id="${aws_spot_instance_request.rancher-ctl-host.*.spot_instance_id[count.index]}"port=8080count=3
}```
### Expected Behavior<!--
It should not have given errors applying the plan
-->### Actual Behavior<!--
Error: Error applying plan:3error(s) occurred:* aws_alb_target_group_attachment.rancher-ctl-host-target-group-instances[2]:1error(s) occurred:* aws_alb_target_group_attachment.rancher-ctl-host-target-group-instances.2: Error registering targets with target group: InvalidTarget: The following targets are not in a running state and cannot be registered: 'i-0791f6bee8a082a10'
status code:400, request id: 990ee63b-3053-11e9-92bd-4d5e8013e613
* aws_alb_target_group_attachment.rancher-ctl-host-target-group-instances[0]:1error(s) occurred:* aws_alb_target_group_attachment.rancher-ctl-host-target-group-instances.0: Error registering targets with target group: InvalidTarget: The following targets are not in a running state and cannot be registered: 'i-0b8c1f6d35f57c5cb'
status code:400, request id: 990f0dbc-3053-11e9-bbd2-3b6b83537945
* aws_alb_target_group_attachment.rancher-ctl-host-target-group-instances[1]:1error(s) occurred:* aws_alb_target_group_attachment.rancher-ctl-host-target-group-instances.1: Error registering targets with target group: InvalidTarget: The following targets are not in a running state and cannot be registered: 'i-033d01746af85be03'
status code:400, request id: 990f3424-3053-11e9-aa19-bf12dffa0d2b
-->### Additional Context<!--
The problem seem to be that the alb_target_group_attachment is created before the spot instances are running (although they have been created), and it does not support interpolation which is needed in my case to use the depends_on.-->### References<!---#12634-->
The text was updated successfully, but these errors were encountered:
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Apr 1, 2020
This issue was closed.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Terraform Configuration Files
The text was updated successfully, but these errors were encountered: