-
Notifications
You must be signed in to change notification settings - Fork 48
feat: add cidrlist parameter to loadbalancer rule #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Added docs and squashed previous commits. |
fix: acceptance tests style: remove comment docs: added cidrlist to loadbalancer_rule docs fix: adjust delimiter to cidr array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM tested manually
resource "cloudstack_loadbalancer_rule" "default" {
name = "loadbalancer-rule-1"
description = "Loadbalancer rule 1"
ip_address_id = "20a23048-a6e8-4db9-a3c1-3966043838ff"
algorithm = "roundrobin"
private_port = 80
public_port = 80
member_ids = ["3d8b9cf8-44ed-4066-9e62-2f0b67560d0b"]
cidrlist = ["10.0.0.0/8"]
}
terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# cloudstack_loadbalancer_rule.default will be created
+ resource "cloudstack_loadbalancer_rule" "default" {
+ algorithm = "roundrobin"
+ cidrlist = [
+ "10.0.0.0/8",
]
+ description = "Loadbalancer rule 1"
+ id = (known after apply)
+ ip_address_id = "20a23048-a6e8-4db9-a3c1-3966043838ff"
+ member_ids = [
+ "3d8b9cf8-44ed-4066-9e62-2f0b67560d0b",
]
+ name = "loadbalancer-rule-1"
+ private_port = 80
+ project = (known after apply)
+ protocol = (known after apply)
+ public_port = 80
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
cloudstack_loadbalancer_rule.default: Creating...
cloudstack_loadbalancer_rule.default: Creation complete after 9s [id=639f4d8b-193c-4309-b724-fa3125775041]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
╭─ ~/Desktop/cloudstack-India-demo/cloudstack-terraform copy ✔ ╱ 10s ╱ Azure subscription 1 ╱ 05:40:19 PM
╰─ terraform destroy
cloudstack_loadbalancer_rule.default: Refreshing state... [id=639f4d8b-193c-4309-b724-fa3125775041]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
- destroy
Terraform will perform the following actions:
# cloudstack_loadbalancer_rule.default will be destroyed
- resource "cloudstack_loadbalancer_rule" "default" {
- algorithm = "roundrobin" -> null
- cidrlist = [
- "10.0.0.0/8",
] -> null
- description = "Loadbalancer rule 1" -> null
- id = "639f4d8b-193c-4309-b724-fa3125775041" -> null
- ip_address_id = "20a23048-a6e8-4db9-a3c1-3966043838ff" -> null
- member_ids = [
- "3d8b9cf8-44ed-4066-9e62-2f0b67560d0b",
] -> null
- name = "loadbalancer-rule-1" -> null
- private_port = 80 -> null
- public_port = 80 -> null
# (2 unchanged attributes hidden)
}
Plan: 0 to add, 0 to change, 1 to destroy.
Do you really want to destroy all resources?
Terraform will destroy all your managed infrastructure, as shown above.
There is no undo. Only 'yes' will be accepted to confirm.
Enter a value: yes
cloudstack_loadbalancer_rule.default: Destroying... [id=639f4d8b-193c-4309-b724-fa3125775041]
cloudstack_loadbalancer_rule.default: Destruction complete after 8s
Destroy complete! Resources: 1 destroyed.

FYI - This is related and once it gets merged, then we'll be able to create TF to update the source CIDR in the LB as well 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - haven't tested though
Actual behaviour:
CIDR list parameter is critical feature when it comes to loadbalancer rules and it is missing at the moment.
When you create a loadbalancer rule using resource, it allows all CIDRs, which is not indented every time.
What was updated?
Added cidrlist parameter to loadbalancer_rule resource, so we can create rules with specific CIDRs instead of allowing everyone to access loadbalancer.
Would be great if you guys could release a new version of provider even as a minor which include this feature.