Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
© 2022 Yandex.Cloud LLC
Yandex Application Load Balancer
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Target groups
      • Create a target group
      • Edit a target group
      • Delete a target group
    • Backend groups
      • Create a backend group
      • Edit a backend group
      • Delete a backend group
    • HTTP routers
      • Create HTTP router
      • Edit an HTTP router
      • Delete an HTTP router
    • L7 load balancers
      • Create an L7 load balancer
      • Edit an L7 load balancer
      • View L7 load balancer statistics
      • View the L7 load balancer logs
      • Get the ID of the log group of the L7 load balancer
      • Stopping and restarting an L7 load balancer
      • Delete an L7 load balancer
    • Ingress Controller for Managed Service for Kubernetes
      • Install an Ingress controller
      • Create or update resources based on configuration
  • Practical guidelines
    • Setting up a virtual hosting
    • Creating a load balancer with DDoS protection
    • Integrating an L7 load balancer with the CDN and Object Storage
    • Blue-green and canary deployment of service versions
    • Terminating TLS connections
    • Writing load balancer logs to PostgreSQL
  • Concepts
    • Overview
    • Load balancers
    • HTTP routers
    • Backend groups
    • Target groups
    • Quotas and limits
  • Tools
    • Ingress Controller for Managed Service for Kubernetes
      • Overview
      • How it works
      • Security groups
      • Service accounts
  • Access management
  • Pricing policy
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • BackendGroupService
      • HttpRouterService
      • LoadBalancerService
      • TargetGroupService
      • VirtualHostService
      • OperationService
    • REST
      • Overview
      • BackendGroup
        • Overview
        • addBackend
        • create
        • delete
        • get
        • list
        • listOperations
        • removeBackend
        • update
        • updateBackend
      • HttpRouter
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • update
      • LoadBalancer
        • Overview
        • addListener
        • addSniMatch
        • create
        • delete
        • get
        • getTargetStates
        • list
        • listOperations
        • removeListener
        • removeSniMatch
        • start
        • stop
        • update
        • updateListener
        • updateSniMatch
      • TargetGroup
        • Overview
        • addTargets
        • create
        • delete
        • get
        • list
        • listOperations
        • removeTargets
        • update
      • VirtualHost
        • Overview
        • create
        • delete
        • get
        • list
        • removeRoute
        • update
        • updateRoute
  • Ingress controller reference
    • Overview
    • Ingress
    • HttpBackendGroup
    • Service
  • Log reference
  1. Step-by-step instructions
  2. L7 load balancers
  3. Edit an L7 load balancer

Edit an L7 load balancer

Written by
Yandex Cloud
  • Deleting a listener

To update the parameters of an L7 load balancer:

Management console
CLI
Terraform
  1. In the management console, select the folder where the load balancer was created.
  2. Select Application Load Balancer.
  3. Click on the name of the load balancer you need.
  4. Click and select Edit.
  5. Edit the load balancer settings.
  6. Under Listeners, click next to the desired listener and select Edit.
  7. Edit the listener settings and click Save.
  8. At the bottom of the page, click Save.

If you don't 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.

  1. View a description of the CLI command for updating the load balancer parameters:

    yc alb load-balancer update --help
    
  2. Run the command, indicating the new load balancer parameters:

    yc alb load-balancer update <load balancer name> --new-name <new load balancer name>
    

    Result:

    id: a5d88ep483cmbfm63g9t
    name: test-balancer2-updated
    folder_id: aoe197919j8elpeg1lkp
    status: ACTIVE
    region_id: ru-central1
    network_id: c64l1c06d15178sa87k0
    listeners:
    - name: test-listener
      endpoints:
      - addresses:
        - external_ipv4_address:
            address: 130.193.32.206
        ports:
        - "80"
      http:
        handler:
          http_router_id: a5dv7tjdo9gt2pq5l906
    allocation_policy:
      locations:
      - zone_id: ru-central1-a
        subnet_id: buc4gsmpj8hvramg61g8
      - zone_id: ru-central1-b
        subnet_id: blt6pcatjje62sqvjq5b
      - zone_id: ru-central1-c
        subnet_id: fo2ap2nrhjk9vpfdnno8
    log_group_id: eolul9ap0bv02i8bsp87
    created_at: "2021-04-26T12:12:13.624832586Z"
    
  3. Set new parameters for the listener:

    • HTTP listener:

      1. View a description of the CLI command for updating the parameters of an HTTP listener for an L7 load balancer:

        yc alb load-balancer update-listener --help
        
      2. Run the command, indicating the new listener parameters:

        yc alb load-balancer update-listener <load balancer name> \
          --listener-name <listener name> \
          --http-router-id <HTTP router ID> \
          --external-ipv4-endpoint port=<listener port>
        
    • Stream listener:

      1. View a description of the CLI command for updating the parameters of a Stream listener for an L7 load balancer:

        yc alb load-balancer update-stream-listener --help
        
      2. Run the command, indicating the new listener parameters:

        yc alb load-balancer update-stream-listener <load balancer name> \
          --listener-name=<listener name> \
          --backend-group-id=<backend group ID> \
          --external-ipv4-endpoint port=<listener port>
        

    Result of updating two listeners:

    done (42s)
    id: ds76g8b2op3fej12nab6
    name: test-load-balancer
    folder_id: b1gu6g9ielh690at5bm7
    status: ACTIVE
    network_id: enp0uulja5s3j1ftvfei
    listeners:
    - name: tslistener
      endpoints:
      - addresses:
        - external_ipv4_address:
            address: 51.250.64.197
        ports:
        - "80"
      http:
        handler:
          http_router_id: ds7d7b14b3fsv7qjkvel
    - name: teststreamlistener
      endpoints:
      - addresses:
        - external_ipv4_address:
            address: 51.250.64.197
        ports:
        - "443"
      stream:
        handler:
          backend_group_id: ds77tero4f5h46l4e2gl
    allocation_policy:
      locations:
      - zone_id: ru-central1-a
        subnet_id: e9bs1hp7lgdl1g3n6ci1
      - zone_id: ru-central1-b
        subnet_id: e2le8i7hqa216f6i6php
      - zone_id: ru-central1-c
        subnet_id: b0cgk1au6fn203f3tqnf
    log_group_id: ckgs4u5km3u8j9f360md
    security_group_ids:
    - enp49ot04g63ih1scuap
    created_at: "2022-04-04T02:12:40.160629110Z"
    

For more information about Terraform, see the documentation.

  1. Open the Terraform configuration file and edit the fragment with the L7 load balancer description:

    ...
    resource "yandex_alb_load_balancer" "test-balancer" {
      name        = "my-load-balancer"
      network_id  = yandex_vpc_network.test-network.id
    
      allocation_policy {
        location {
          zone_id   = "ru-central1-a"
          subnet_id = yandex_vpc_subnet.test-subnet.id
        }
      }
    
      listener {
        name = "my-listener"
        endpoint {
          address {
            external_ipv4_address {
            }
          }
          ports = [ 9000 ]
        }
        http {
          handler {
            http_router_id = yandex_alb_http_router.test-router.id
          }
        }
      }
    }
    ...
    

    For more information about the yandex_alb_load_balancer resource in Terraform, see the provider documentation.

  2. Check the configuration using the command:

    terraform validate
    

    If the configuration is correct, the following message is returned:

    Success! The configuration is valid.
    
  3. Run the command:

    terraform plan
    

    The terminal will display a list of resources with parameters. No changes are made at this step. If there are errors in the configuration, Terraform points them out.

  4. Apply the configuration changes:

    terraform apply
    
  5. Confirm the changes: type yes into the terminal and press Enter.

    You can verify the change to the L7 load balancer using the management console or the following CLI command:

    yc alb load-balancer get <L7 load balancer name>
    

Deleting a listener

To delete a listener for your L7 load balancer:

Management console
CLI
Terraform
  1. In the management console, select the folder where the load balancer was created.
  2. Select Application Load Balancer.
  3. Click next to the load balancer name and select Edit.
  4. Under Listeners, click next to the listener name and select Delete.
  5. Click Save.

If you don't 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.

  1. View a description of the CLI listener delete command:

    yc alb load-balancer remove-listener --help
    
  2. Run the command:

    yc alb load-balancer remove-listener <load balancer ID or name> \
      --listener-name=<listener name>
    

    Result:

    done (50s)
    

For more information about Terraform, see the documentation.

  1. Open the Terraform configuration file and delete the listener section from the L7 load balancer description.

    ...
    resource "yandex_alb_load_balancer" "test-balancer" {
      name        = "my-load-balancer"
      network_id  = yandex_vpc_network.test-network.id
    
      allocation_policy {
        location {
          zone_id   = "ru-central1-a"
          subnet_id = yandex_vpc_subnet.test-subnet.id 
        }
      }
    
      listener {
        name = "my-listener"
        endpoint {
          address {
            external_ipv4_address {
            }
          }
          ports = [ 9000 ]
        }    
        http {
          handler {
            http_router_id = yandex_alb_http_router.test-router.id
          }
        }
      }    
    }
    ...
    

    For more information about the yandex_alb_load_balancer resource in Terraform, see the provider documentation.

  2. Check the configuration using the command:

    terraform validate
    

    If the configuration is correct, the following message is returned:

    Success! The configuration is valid.
    
  3. Run the command:

    terraform plan
    

    The terminal will display a list of resources with parameters. No changes are made at this step. If there are errors in the configuration, Terraform points them out.

  4. Apply the configuration changes:

    terraform apply
    
  5. Confirm the changes: type yes into the terminal and press Enter.

    You can verify the change to the L7 load balancer using the management console or the following CLI command:

    yc alb load-balancer get <L7 load balancer name>
    

Was the article helpful?

Language / Region
© 2022 Yandex.Cloud LLC