How To Test Connectivity from a CPM Worker to AWS endpoints

How To Test Connectivity from a CPM Worker to AWS endpoints

The Following Steps will help you Test the outgoing connection from the CPM Worker to AWS endpoints OR the CPM Server if you need to test to ensure that the Worker can reach the CPM server once it launches. 

Launch Worker
First, ensure the CPM Worker instance is running in your AWS EC2 console. If it is, you can proceed with this test. If it is not,  please run the S3 copy or FLR (explore) again and wait for the CPM worker to launch in your AWS EC2 console. It will Be named "CPMWorkerMachine"



For the duration of the test, you should enable Termination Protection for this instance.
Now Obtain the IP address of the worker instance and connect to it using SSH/Putty. The IP address is found in the details of the CPMWorkerMachine in your EC2 console.

Configure Putty to connect to the Worker
Configure Putty to connect to the IP/hostname of the CPM WorkerMachine you just looked up. This is done in the same way you would use Putty to connect to the CPM Instance, using the CPM key. However to login to any CPM Worker instance please use the username "Ubuntu".

If you have not connected to your CPM instance with putty yet, you will need to install putty and convert the private key using the steps in the AWS documentation found here in this link

Connect to the Worker
Once you have the key converted to a .ppk file and you have putty configured to connect to the CPMWorkerMachine, make the connection using Putty, you will see a window similar to the image below.



Run Tests
Once logged in, you can run the wget command to test connectivity to any endpoint in AWS. See the example below.  A link to AWS Endpoints can be found here - https://docs.aws.amazon.com/general/latest/gr/rande.html

(you may need to replace "us-east-1" with the name of your region)

If it is successful, you will see the "200 OK" message. 

 (you may need to replace "us-east-1" with the name of your region)

If it is successful, you will see the "connected" message followed by "403 Forbidden". 

OR if you need to test connectivity from the Worker to the CPM instance run the following. 
wget --no-check-certificate https://cpmip/

If the connection fails, you will need to determine why the worker cannot establish a connection to the AWS endpoints. This is usually caused by the Worker being launched in a VPC or subnet that does not allow the connection.

S3 networking and bucket requirements can be found here - https://docs.n2ws.com/user-guide/appendix-a-recommended-configuration-for-copy-to-s3