Getting information about an L7 load balancer
- In the management console
, navigate to the folder containing your L7 load balancer. - Select Application Load Balancer.
- Select your L7 load balancer.
- The Overview page will present details about the load balancer.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View the description of the CLI command to get information about a L7 load balancer:
yc alb load-balancer get --help
-
Get information about your load balancer by specifying its name or ID:
yc alb load-balancer get <load_balancer_name>
Result:
id: a5d88ep483cm******** name: test-balancer2 folder_id: aoe197919j8e******** status: ACTIVE region_id: ru-central1 network_id: c64l1c06d151******** allocation_policy: locations: - zone_id: ru-central1-a subnet_id: buc4gsmpj8hv******** log_group_id: eolul9ap0bv0******** created_at: "2021-04-26T12:12:13.624832586Z" log_options: log_group_id: e23ujjda632o********
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the documentation on the Terraform
If you don't have Terraform, install it and configure the Yandex Cloud provider.
To get information about an L7 load balancer using Terraform:
-
Add the
data
andoutput
sections to the Terraform configuration file:data "yandex_alb_load_balancer" "tf-alb" { load_balancer_id = "<load_balancer_ID>" } output "tf-alb-listener" { value = data.yandex_alb_load_balancer.tf-alb.allocation_policy }
Where:
data "yandex_alb_load_balancer"
: Description of the L7 load balancer as a data source:load_balancer_id
: L7 load balancer ID.
output "allocation_policy"
: Output variable that contains information about the L7 load balancer placement policy:value
: Returned value.
You can replace
allocation_policy
with any other parameter to get the information you need. For more information about theyandex_alb_load_balancer
data source parameters, see the relevant provider documentation . -
Create resources:
-
In the terminal, change to the folder where you edited the configuration file.
-
Make sure the configuration file is correct using the command:
terraform validate
If the configuration is correct, the following message is returned:
Success! The configuration is valid.
-
Run the command:
terraform plan
The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.
Terraform will create the required resources and display the output variable values in the terminal. To check the results, run:
terraform output
Result:
tf-alb-listener = tolist([ { "location" = toset([ { "disable_traffic" = false "subnet_id" = "buc4gsmpj8hv********" "zone_id" = "ru-central1-a" }, ...
-
To get detailed information about an L7 load balancer, use the get REST API method for the LoadBalancer resource or the LoadBalancerService/Get gRPC API call.