elastic-load-balancer

aws: boto3 get all instances of a load balancers

时光毁灭记忆、已成空白 提交于 2019-12-05 22:19:06
I can able to get the load balancers using below import boto3 elb = boto3.client('elbv2') lbs = elb.describe_load_balancers() How to get the instances of the lbs . Also How Can I fetch the load balancers which state is not active as describe_load_balanacers only give state active load balanceres. Classic Load Balancer Use: client = boto3.client('elb') Then describe_load_balancers() results include a list of instances: 'Instances': [ { 'InstanceId': 'string' }, ], Application Load Balancer Use: client = boto3.client('elbv2') Call describe_target_groups() passing in the Load Balancer ARN to

How to configure AWS internet facing LB ScurityGroup for internal and external requests

£可爱£侵袭症+ 提交于 2019-12-05 22:09:02
I'm having a hard time figuring out how to set the correct SecurityGroup rules for my LoadBalancer. I have made a diagram to try and illustrate this problem, please take a look at the image below: I have an internet facing LoadBalancer ("Service A LoadBalancer" in the diagram) that is requested from "inhouse" and from one of our ECS services ("Task B" in the diagram). For the inhouse requests, i can configure a SecurityGroup rule for "Service A LoadBalancer" that allows incoming request to the LoadBalancer on port 80 from the CIDR for our inhouse IP's. No problem there. But for the other ECS

Cannot access airflow web server via AWS load balancer HTTPS because airflow redirects me to HTTP

落花浮王杯 提交于 2019-12-05 07:40:54
I have an airflow web server configured at EC2, it listens at port 8080. I have an AWS ALB(application load balancer) in front of the EC2, listen at https 80 (facing internet) and instance target port is facing http 8080. I cannot surf https://< airflow link > from browser because the airflow web server redirects me to http : //< airflow link >/admin, which the ALB does not listen at. If I surf https://< airflow link > /admin/airflow/login?next=%2Fadmin%2F from browser, then I see the login page because this link does not redirect me. My question is how to change airflow so that when surfing

Scaling with sticky sessions and websockets

爷,独闯天下 提交于 2019-12-04 11:58:17
问题 Initially we have two AWS EC2 instances with node.js running behind a load balancer with sticky sessions. As the load increases more instances are added. But we are facing problems with this approach. As out application is mainly for workshops, the load usually increases within a short period of time (workshop start) and every workshop participant has a sticky session with the first two instances and the new ones have almost none. Because of this the performance stays bad. First thought was:

How to make a HTTP call reaching all instances behind amazon AWS load balancer?

╄→гoц情女王★ 提交于 2019-12-04 00:58:05
I have a web app which runs behind Amazon AWS Elastic Load Balancer with 3 instances attached. The app has a /refresh endpoint to reload reference data. It need to be run whenever new data is available, which happens several times a week. What I have been doing is assigning public address to all instances, and do refresh independently (using ec2-url/refresh ). I agree with Michael's answer on a different topic , EC2 instances behind ELB shouldn't allow direct public access. Now my problem is how can I make elb-url/refresh call reaching all instances behind the load balancer? And it would be

Scaling with sticky sessions and websockets

心已入冬 提交于 2019-12-03 07:32:34
Initially we have two AWS EC2 instances with node.js running behind a load balancer with sticky sessions. As the load increases more instances are added. But we are facing problems with this approach. As out application is mainly for workshops, the load usually increases within a short period of time (workshop start) and every workshop participant has a sticky session with the first two instances and the new ones have almost none. Because of this the performance stays bad. First thought was: let's disable the sticky sessions. But that destroys our websockets because they need sticky sessions

HTTPS-Redirect with Traefik behind Aws Loadbalancer

那年仲夏 提交于 2019-12-02 01:26:11
I'm trying to redirect all incoming Traefik from http to https, for a web application which gets served out of a docker container with a custom port. If I build this docker compose file, and scale the application everything works as expected. I'm able to request http and https of the application, but I try to accomplish that only https get served and http gets redirected to https. Since I use a Docker-Compose file, I don't have a Traefik.toml, and try to accomplish this without one. Docker Compose: traefik: image: traefik:latest command: - "--api" - "--docker" - "--docker.domain=example.com" -

Terraform ELB S3 Permissions Issue

浪子不回头ぞ 提交于 2019-11-30 11:46:46
I am having an issue using Terraform (v0.9.2) adding services to an ELB (I'm using: https://github.com/segmentio/stack/blob/master/s3-logs/main.tf ). When I run terraform apply I get this error: * module.solr.module.elb.aws_elb.main: 1 error(s) occurred: * aws_elb.main: Failure configuring ELB attributes: InvalidConfigurationRequest: Access Denied for bucket: my-service- logs. Please check S3bucket permission status code: 409, request id: xxxxxxxxxx-xxxx-xxxx-xxxxxxxxx My service looks like this: module "solr" { source = "github.com/segmentio/stack/service" name = "${var.prefix}-${terraform

Load balancing across different Elastic Beanstalk applications

北城余情 提交于 2019-11-30 07:14:37
In my AWS environment there are some load balanced / autoscaled Elastic Beanstalk applications. I would like to have a load balancer in front of them, so any request to http://loadbalancer.com/app1 is routed to the first Elastic Beanstalk app, http://loadbalancer.com/app2 to the second and so on. I tried to set up an application load balancer with different listeners routing to different target groups. Unfortunately my solution is not ideal, because the target groups are bound to a fixed set of EC2 instances, while I want them to be associated to an environment where instances are created or

Does an Application Load Balancer support WebSockets?

只谈情不闲聊 提交于 2019-11-28 04:45:32
I have an Elastic Beanstalk application which was initially configured to use a Classic Load Balancer. I found that this caused errors when connecting via WebSocket. Because of this, I configured the application to use an Application Load Balancer instead, because I was told that ALBs support WebSockets. However, it seems that they do not: I get exactly the same error when attempting to connect to my ALB via WebSocket. Do ALBs actually support WebSocket? The AWS documentation is contradictory on this. This page says it only supports HTTP and HTTPS. There are no guides to setting up an ALB to