Task 4: Verify the connection configuration - Amazon Elastic Compute Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Task 4: Verify the connection configuration

Task objective

The objective of this task is to verify that the two security groups were created and assigned to the instance and database.

When you use the automatic connection feature in the EC2 console to configure the connectivity, the security groups are automatically created and assigned to the instance and database, as follows:

  • Security group rds-ec2-x is created and added to the RDS database. It has one inbound rule that references the ec2-rds-x security group as its source. This allows traffic from the EC2 instance with the ec2-rds-x security group to reach the RDS database.

  • Security group ec2-rds-x is created and added to the EC2 instance. It has one outbound rule that references the rds-ec2-x security group as its destination. This allows traffic from the EC2 instance to reach the RDS database with the rds-ec2-x security group.

Steps to verify the connection configuration

Use the following steps to verify the connection configuration.

To view an animation of these steps, see View an animation: Verify the connection configuration.

To verify the connection configuration using the console

  1. Open the Amazon RDS console at https://console.amazonaws.cn/rds/.

  2. In the navigation page, choose Databases.

  3. Choose the RDS database that you created for this tutorial.

  4. On the Connectivity & security tab, under Security, VPC security groups, verify that a security group called rds-ec2-x is displayed.

  5. Choose the rds-ec2-x security group. The Security Groups screen in the EC2 console opens.

  6. Choose the rds-ec2-x security group to open it.

  7. Choose the Inbound rules tab.

  8. Verify that the following security group rule exists, as follows:

    • Type: MYSQL/Aurora

    • Port range: 3306

    • Source: sg-0987654321example / ec2-rds-x – This is the security group that is assigned to the EC2 instance that you verified in the preceding steps.

    • Description: Rule to allow connections from EC2 instances with sg-1234567890example attached

  9. Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/.

  10. In the navigation pane, choose Instances.

  11. Choose the EC2 instance that you selected to connect to the RDS database in the previous task, and choose the Security tab.

  12. Under Security details, Security groups, verify that a security group called ec2-rds-x is in the list. x is a number.

  13. Choose the ec2-rds-x security group to open it.

  14. Choose the Outbound rules tab.

  15. Verify that the following security group rule exists, as follows:

    • Type: MYSQL/Aurora

    • Port range: 3306

    • Destination: sg-1234567890example / rds-ec2-x

    • Description: Rule to allow connections to database-tutorial from any instances this security group is attached to

By verifying that these security groups and security group rules exist and that they are assigned to the RDS database and EC2 instance as described in this procedure, you can verify that the connection was automatically configured by using the automatic connection feature.


								This animation shows how to verify the connection
									configuration. For the text version of this animation, see the
									steps in the preceding procedure.

You have completed Option 1 of this tutorial. You can now either complete Option 2, which teaches you how to use the RDS console to automatically connect an EC2 instance to an RDS database, or you can complete Option 3, which teaches you how to manually configure the security groups that were automatically created in Option 1.