add support for vpc internal lb #264
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add support for creating internal load balancer resources with the possibility to assign instances to the load balancer rule.
Reason
This feature allows users to create an internal load balancer for a certain vpc tier and assign instances to it in one step using the terraform provider following IaC principles.
References
Changes
Added
cloudstack_loadbalancerresource to the terraform provider and the corresponding documentation page.cloudstack/provider.gocloudstack/resource_cloudstack_loadbalancer.gowebsite/docs/r/loadbalancer.html.markdownDeployment test
Code:
Terraform apply:
Verify using API:
{ "listloadbalancersresponse": { "count": 1, "loadbalancer": [ { "id": "eefce154-e759-45a4-989a-9a432792801b", "name": "test3", "algorithm": "Source", "networkid": "0ae8fa84-c78e-441a-8628-917d276c7d5c", "sourceipaddress": "10.0.0.13", "sourceipaddressnetworkid": "0ae8fa84-c78e-441a-8628-917d276c7d5c", "projectid": "850c3f62-94f5-497f-91f6-2a736af09b58", "project": "Test", "domainid": "96b987c6-a9a8-11f0-b71e-6c92cf3489d0", "domain": "ROOT", "domainpath": "ROOT", "loadbalancerrule": [ { "sourceport": 8081, "instanceport": 8081, "state": "Active" } ], "loadbalancerinstance": [ { "id": "48600f99-d890-472c-bc1a-7379af22727c", "name": "i-14-1286-VM", "ipaddress": "10.0.0.12" }, { "id": "749485a1-4081-49cd-9668-1d160ac94488", "name": "i-14-1282-VM", "ipaddress": "10.0.0.11" }, { "id": "9bbf3c6d-c8b8-42e8-ab37-e4f60a71f61d", "name": "i-14-1283-VM", "ipaddress": "10.0.0.10" } ], "tags": [], "fordisplay": true } ] } }