You can use the ssh command to connect to your EC2 instance. In order to do so, you need the following:
ssh -i “[/path/to/your/publicKey]” ec2user@[Public_IP_address_of_your_instance]
•ssh -i “/tmp/myKey.pem” email@example.com
Before you begin, please make sure that you have the following: putty, puttygen, pem file, and the public IP address to your instance.
From the Command Line on a Linux system outside of the AMI environment
ssh -i keyfile.pem ec2-user@<public_dns_name>
Ok, how does one logon to that actual database and start running SQL?
I provided a password in the CloudFormation templates, what are the command line tools, the userid etc...
The question I have and I thought this topic was about: "How can I connect my tools from my laptop over the Internet to my teradata instance on AWS?"
The issue I found is that Teradata database instance is listening on IPv6, and not IPv4. The Teradata cloud formation template does not automatically provide an IP6 address. Thus a JDBC connection from my laptop over the internet to the EC2 instance, even with the port open, doesn't work because the connection is IPv4 and the database is on IPv6.
There is a mis-match in configuration that should be addressed; A bug report should be opened up.
The quick work around is to enable ssh port forwarding on the ssh connection, thus:
ssh -i ~/.ssh/my-private-key.pem firstname.lastname@example.org -L 1025:localhost:1025
And the DB Visualizer setup (for JDBC connections):
Database Server: localhost
Database port: 1025
Database Userid: dbc
Database Password: <the password you put into the cloud formation template>
Thus the working result:
I just launched a two node Teradata instance and I am able to connect to it using it's public IPV 4 IP address from bteq on my PC without doing any port forwarding:
From the Windows command prompt using the BTEQ client installed on my Windows 7 PC:
Note that my firewall Rules have port 1025 and port 22 open to my IP address. I can also ssh to it using the IP V4 address and the AWS private key I created.
C:\Program Files (x86)\VMware\VMware vSphere CLI>bteq
Teradata BTEQ 16.00.00.00 for WIN32. PID: 4072
Copyright 1984-2016, Teradata Corporation. ALL RIGHTS RESERVED.
Enter your logon or BTEQ command:
*** Logon successfully completed.
*** Teradata Database Release is 15.10.05.06
*** Teradata Database Version is 15.10.05.06
*** Transaction Semantics are BTET.
*** Session Character Set Name is 'ASCII'.
*** Total elapsed time was 1 second.
BTEQ -- Enter your SQL request or BTEQ command:
Can you check one thing? Please ssh into the instance and run this command:
netstat -an |grep 1025
I received an ip6, what do you get?
I see an IP V4 address:
SMP001-02:~ # netstat -an |grep 1025
tcp 0 0 :::1025 :::* LISTEN
tcp 0 0 172.31.100.14:1025 220.127.116.11:29244 ESTABLISHED