Ec2 SQL Database server:
Connection-specific DNS Suffix . : ec2.internal
Link-local IPv6 Address . . . . . : fe80::9ca:e9d1:a7b5:3e42%16
IPv4 Address. . . . . . . . . . . : 172.31.21.189
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . : 172.31.16.1
*(Please note that this Ec2 DB currently also has a publicly accessible elastic ip associated with it. I'm noting this because in the VPC peering docs I saw that VPC peering will not function correctly if there is a public IP associated with it)
I setup a AWS Workspace Directory on the same VPC, Workspace Client networking:
Connection-specific DNS Suffix . : ec2.internal
Link-local IPv6 Address . . . . . : fe80::dc3c:d1c1:c7fe:812b%15
IPv4 Address. . . . . . . . . . . : 172.31.16.45
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . : 172.31.16.1
While these are on the same CIDR 172.31 they're unable to communicate, I read the documentation on VPC peering but I don't think it's applicable in this situation. What is the appropriate and secure way to setup network connectivity between the workspace desktop's (client app) and the sql database on my ec2 instance.
Edit
1) I have added the following rule in the EC2 security group to allow traffic to the DB server:
2) Have disabled windows firewall on both boxes.