Requirement already satisfied: bcrypt>=3.1.3 in c:\users\user\appdata\local\programs\python\python37\lib\site-packages (įrom paramiko>=1.15.2->sshtunnel) (3.1.7) Requirement already satisfied: pynacl>=1.0.1 in c:\users\user\appdata\local\programs\python\python37\lib\site-packages (įrom paramiko>=1.15.2->sshtunnel) (1.3.0) Requirement already satisfied: paramiko>=1.15.2 in c:\users\user\appdata\local\programs\python\python37\lib\site-package You should consider upgrading via the 'python -m pip install -upgrade pip' command. WARNING: You are using pip version 19.2.3, however version 20.1 is available. Check if the packages psycopg2 and sshtunnel were installed in python, if they were not, install them using pip (Python Package Installer)Ĭ:\Users\user>pip freeze|findstr sshtunnelĬ:\Users\user>pip freeze|findstr psycopg2Ī/psycopg2-2.8.5-cp37-cp37m-win_amd64.whl Validate the Security Group (Group ID sg-0d30f4aeed419af97) used by Amazon RDS DB only grant access trough the port 5432 to the EC2 Instance (located in the same VPC)Īws ec2 describe-security-groups -group-ids sg-0d30f4aeed419af97 -query "SecurityGroups.]]"Ģ. Validate what is the active Security Group used by the Amazon RDS DB (i-032f4a47077b4a2ad)Īws rds describe-db-instances -db-instance-identifier postmig -query "DBInstances.VpcSecurityGroups" Validate the Security Group “SECURITY_TO_EC2_POSTGRESQL” grant access only to the PC (Public IP: x1.x2.x3.x4) using the port 22 (SSH)Īws ec2 describe-security-groups -group-names SECURITY_TO_EC2_POSTGRESQL -query "SecurityGroups.]]"Ĭ. Validate what is the active Security Group used by the EC2 Instance (i-032f4a47077b4a2ad)Īws ec2 describe-instances -instance-ids i-032f4a47077b4a2ad -query " |]"ī. I going to validate the rules used in Security Groups for the EC2 instance and Amazon RDS using AWS CLI 2.0.10.Ī. Import a CSV file into Amazon RDS PostgreSQL.ġ.Create a connection to Amazon RDS PostgreSQL using the SSH tunnel.Create a SSH Tunnel from the laptop with final destination the Amazon RDS PostgreSQL.The local PC run a python program (version 3.75) that executes three things: I going to use an Amazon RDS PostgreSQL without a Public IP, for this reason I will use an Amazon EC2 instance as bastion host (Jump server).īoth Amazon RDS PostgreSQL and EC2 Instance use the same VPC (172.31.0.0/16) and the EC2 Instance can connect to Amazon RDS PostgreSQL using the Port 5432 and the python program will connect remotely to EC2 instance using a SSH tunnel. In this post I will show you a simple python program that import a CVS file from a remote PC into a table of Amazon RDS PostgreSQL using a a SSH tunnel created by the same Python program.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |