How can I connect another manually created EC2 instance to my Elastic Beanstalk?

0

I currently have Elastic Beanstalk up and running. I want to create an additional EC2 instance that is outside the control of Elastic Beanstalk. This is because with each deployment to Elastic Beanstalk, the IP addresses of my EB EC2 instances change. Consequently, I find myself needing to access my manually created EC2 instance and update its security group to allow incoming traffic from these new IP addresses. Given my limited networking knowledge, I believe there must be a more efficient way to handle this situation. Any guidance would be greatly appreciated.

2 Answers
0
Accepted Answer

I utilized the private IP of an external EC2, and it successfully functioned! To clarify the process for anyone encountering a similar issue:

  1. Ensure that both the Elastic Beanstalk (EB) environment and your manually created EC2 instance share the same security group.
  2. Confirm that the specified security group allows incoming traffic on the required port range.
  3. Subsequently, you can establish a connection from your EB environment to the manually created EC2 instance using the private IP of the latter.
Navid
answered 9 months ago
0

If I understand correctly, you're provisioning a new EC2 instance and you want that instance to have access to, and be able to be accessed by, pre-existing EC2 instances.

Assuming all the pre-existing instances already have the same security group associated with them then you can add that security group (rather than an IP address, or IP address range) as the source/target of a security group rule that is associated with your new EC2 instance.

This is described here https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html#security-group-referencing

You could launch your new EC2 with the same security group as the other instances are already in https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html#sg-rules-other-instances

profile picture
EXPERT
Steve_M
answered 9 months ago
profile picture
EXPERT
reviewed 9 months ago
  • I did change the new Ec2 instance security group to EB security group still can not connect redis service from EB.

    with elastic catch i can connect without any issue, but not the EC2 which I have created and installed Redis on it manually.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions