This seems like an easy step in the process, but I've been left scratching my head.
I am setting up an elastic load balancer on AWS, however when I get to the step to add EC2 instances, it does not list all of the instances I am running. I attempted to add the instance to the load balancer using the AWS command line, but received this message:
aws elb register-instances-with-load-balancer --load-balancer-name Simply --instances instance-id
Invalid endpoint: https://elasticloadbalancing.N. Virginia.amazonaws.com
Any ideas?
You have incorrectly set the region to be N. Virginia in the CLI configuration.
It should be: us-east-1
For a list of region names see: Regions and Endpoints
Related
I created a WordPress app using Lightsail. It says it was created in Frankfurt Zone. However, I cannot see this instance in EC2 console. I want to create a Load Balancer for that app and add certificates, but I can't cause I don't see this instance on the list. Any ideas where can I find this Lightsail instance in EC2 console?
AWS Lightsail not shown in EC2 console, it's the main difference between the Lightsail and EC2, If you want to have more control on your EC2, so you should run EC2 instance instead of cheaper version Lightsail.
For more info about the Lighsail read the FAQ on the AWS website:
https://aws.amazon.com/lightsail/faq/
Also, you can use Lightsail load balancer instead of standard ELB on AWS, for more info read the following doc:
https://aws.amazon.com/lightsail/features/load-balancing/
I am trying to create an Application Load Balancer using AWS CLI.
create-load-balancer
The error message is as follows:
An error occurred (ValidationError) when calling the CreateLoadBalancer operation: At least two subnets in two different Availability Zones must be specified
So I need to get available subnets from a specific zone (ex: us-east-2).
How can I get the all available subnets using AWS CLI?
In order to create a new Application Load Balancer you should use the following CLI Command:
aws elbv2 create-load-balancer --name my-load-balancer --subnets SUBNET_1 SUBNET_2
You can get the list of available subnets by analyzing your VPC. To do this please follow these steps:
Open your AWS Console
Navigate to VPC
Open Subnets section on the left
Get the subnets that are linked to your VPC and make sure that you have two subnets in two different availability zones. If you don't have then please create them
Use these subnets with the above CLI command
If you don't have console access for any reason then use this command to get the list of available subnets from the CLI:
aws ec2 describe-subnets
I want to get the ELB name from inside the EC2 instance.
I can do a aws elb describe-load-balancers but this needs the ELB name as input.
I want do it reverse - I know the EC2 instance details from EC2 metadata and want to find the ELB name so that I can append to a file.
The command aws elb describe-load-balancers doesn't need the elb name. It will list all the elbs you have. Then you can parse the output JSON and get which instances are attached to every ELB. I don't know if this is your case, but you can find which elb your instance is attached, and then grab the elb name.
Regards
The error message is:
Stack named 'awseb-e-r3uhxvhyz7-stack' aborted operation. Current state: 'CREATE_FAILED' Reason: The following resource(s) failed to create: [AWSEBInstanceLaunchWaitCondition].
I am trying to use Multi-Container Docker in AWS Elastic Beanstalk.
Can someone help me to get rid of this error.Is it necessary to use more than one EC2 instance for using Multi-Container Docker in AWS Elastic Beanstalk?
This sound kinda what your issue is:
If you use Amazon VPC with Elastic Beanstalk, Amazon EC2 instances deployed in a private subnet cannot communicate directly with the Internet. Amazon EC2 instances must have Internet connectivity to communicate to Elastic Beanstalk that they were successfully launched. To provide EC2 instances in a private subnet with Internet connectivity, you must add a load balancer and NAT to the public subnet. You must create the appropriate routing rules for inbound and outbound traffic through the load balancer and NAT. You must also configure the default Amazon VPC security group to allow traffic from the Amazon EC2 instances to the NAT instance.
Source: Amazon EC2 Instances Fail to Launch within the Wait Period
I've fixed this. It looks the like IAM role created by default for the single docker EB deployment didn't contain the necessary ECS Policy (unconfirmed).
I followed the instructions to create a policy to add the role and everyhing worked.
I have a couple of servers behind an amazon load balancer and I need to find out their elastic IP addresses so I can SSH into them. (I'm on a different computer than normal and have left my amazon hardware authenticator back home in a different country so I can't just log into the AWS console).
Is there any way of obtaining these two addresses?
This may be a long shot, since you're not on your usual computer, but do you have the command line tools installed?
aws elb describe-instance-health --load-balancer-name <ELB name>
Returns a list of instances connected to the ELB.
aws ec2 describe-instances <instance id>
Returns among other things the IP address of the instance. If you have your Access Key and Secret Key you can set up the command line tools and skip the AWS console.
EC2 tools: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SettingUp_CommandLine.html
ELB tools: http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/UsingTheCommandLineTools.html
UPDATE: As of this edit the ELB Command Line tools have been replaced in favour of AWS CLI: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html
Documentation for AWS CLI with ELB commands