bpetlur
bpetlur

Reputation: 383

how to configure security group in amazon EC2

I am new to this Aws security to deploy in amazon webservice. When i restrict security groups with some IP address, my application runs dead slow or it may not run also, thats the reason i am getting connection time out when i try to call webservice which is deployed in aws. When i open the IP address restriction in Security groups it works fine.

How to configure my AWS using security groups. so that my application is accessible to only to some restricted networks. Please help me put on this.

Below are the my security group details

INBOUND   
Type     Protocol       Port range      Source       
MYSQL       TCP             3306            X.X.X.X/X   
SSH         TCP             22              X.X.X.X/X    
HTTP        TCP             80              X.X.X.X/X

OUBOUND  
Type    Protocol        Port range      Source  
MYSQL       TCP             3306            0.0.0.0/0  
SSH         TCP             22              0.0.0.0/0  
HTTP        TCP             80              0.0.0.0/0

i am using hibernate for DB connection from my web application. But everytime i am getting connection timeout with the above security group. but if i remove the IP address restrictions it works fine. Note: DB connection works fine from mysql workbench

<property name="hibernate.connection.url">jdbc:mysql://schemaname.amazonDBInsatnce:3306/test</property>

Upvotes: -1

Views: 1747

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269071

Security Groups will not "slow down" access to an Amazon EC2 instance. They are used to determine which ports are open to a given range of IP addresses. Either the traffic is allowed through, or it is not.

Security Groups can be defined for Inbound and Outbound traffic. By default, all Inbound traffic is denied and all Outbound traffic is permitted.

It is possible that your application is trying to access some external service and is timing-out, hence causing delays. Permitted all Outbound traffic is usually acceptable, so try that first and see if your application performs better.

Also, check the log files that your application is producing to see if any errors are being generated, which will give you a hint as to what might be happening.

Upvotes: 0

Related Questions