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개 답변
0
수락된 답변

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
답변함 9달 전
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
전문가
Steve_M
답변함 9달 전
profile picture
전문가
검토됨 9달 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠