1 Answer
- Newest
- Most votes
- Most comments
0
Yes you can ping a public EC2 so long as you’ve a route to the internet from your private instance via an NAT gateway and your inbound security group allows ICMP type 8 (ping) on the public database server.
If it’s an RDS instance then ping is not supported.
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
The issue I want to highlight is I am trying to run this command from my private server is
Invoke-Sqlcmd -InputFile "$(scriptfilepath)" -ServerInstance $(sqlserver) -Database $(dbname) -Username "$(username)" -Password "$(pwd)" -QueryTimeout 36000 -Verbose
but I am getting this error while my pipeline is running Invoke-Sqlcmd : A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) Then I added Encrypt=False in the command as well but I am getting a different error afterwards i.e. The Query and InputFile are mutually exclusive.
I need to know is it because of the problem I mentioned above? Please guide @Gary Mclean and @Riku_Kobayashi
Ok, it looks to me that the CA certificate on your Database isnt installed on the box you are connecting from. You will need to obtain the CA cert that the SSL connections are being encrypted with imported into your Windows Cert Store in order to validate the SSL traffic. Can you confirm if your database server is RDS or Installed on an EC2. You will need to obtain the CA Cert from the SQL Server. This post may help explain how to install certs onto the client https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.Concepts.General.SSL.Using.html
You can add this to your command line but it bypasses the SSL Validation
-TrustServerCertificate
and I am not recommending it but it should highlight the issue if this works successfully.