我们正在将数据从S3加载到Redshift,但在命令行上验证Redshift用户名和密码。
我们是否也可以这样做,因为这会导致在代码中硬编码用户名密码,这是一个安全漏洞。
psql -h $redshift_jdbc_url -U $redshift_db_username -d $redshift_dbname -p $port_number -c "copy $destinationTable$columnList from '$s3fileName' credentials 'aws_iam_role=arn:aws:iam::$account_number:role/$s3role;master_symmetric_key=$master_key' region '$s3region' format as json '$jsonPathFile' timeformat 'auto' GZIP TRUNCATECOLUMNS maxerror $maxError";