How to Pass S3 path and CREDENTIALS dynamically

How I can pass the aws information dynamically

CREATE OR REPLACE PROCEDURE upload_to_s3(s3_path varchar(20)) AS

SELECT * from table1
INTO S3 s3_path
CONFIG ‘{“region”:“us-east-2”}’
CREDENTIALS ‘{“aws_access_key_id”: “”, “aws_secret_access_key”: “”}’;

CALL upload_to_s3(download-ui/tech5.csv);

I passed proper aws credentials.
I am getting error at “INTO S3 s3_path” line

I’d suggest you try dynamic SQL. Build a string with your SELECT statement and run it with EXECUTE IMMEDIATE.