While trying to load some data to Redshift from EC2 using COPY command, I am getting the below error.
ERROR: ErrorMessage: Username/PublicKey combination invalid ErrorCode: -18
I've added the public key of the Redshift cluster in the authorized_keys file of ec2-user. EC2 instance is running on AWS Linux2.
ssh_manifest file in S3 bucket is as below.
{
"entries": [
{"endpoint":"<public ip of ec2>",
"command": "cat test_users_pipe.txt",
"mandatory":true,
"username": "ec2-user"}
]
}
And below is the COPY command.
copy test2_users
from '<s3-bucket-uri>/ssh_manifest'
credentials 'aws_iam_role=<role_arn>'
delimited '|' region '<aws_region>'
ssh;