Thank you Jaehyeon Kim. A workaround consists   on exporting was credentials as 
environment variables using https://github.com/linaro-its/aws2-wrap The command 
below will set the environment variables AWS_ACCESS_KEY_ID, 
AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, which makes the Flink code work. 

On 2023/12/06 22:57:28 Fourais wrote:
> Hi,
> 
> Using Flink 1.18 and Java 17, I am trying to read a text file from S3 using
> env.readTextFile("s3://mybucket/folder1/file.txt"). When I run the app in
> the IDE, I get the following error:
> 
> Caused by: org.apache.hadoop.fs.s3a.auth.NoAuthWithAWSException: No AWS
> Credentials provided by DynamicTemporaryAWSCredentialsProvider
> TemporaryAWSCredentialsProvider SimpleAWSCredentialsProvider
> EnvironmentVariableCredentialsProvider IAMInstanceCredentialsProvider :
> com.amazonaws.SdkClientException: Unable to load AWS credentials from
> environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and
> AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY))
> 
> I authenticated into AWS using SSO e.g. aws sso login --profile
> my-aws-profile, so I do not have any keys set as environment variables. I
> have tried the different CredentialsProvider options suggested in the error
> message without success.
> 
> Could you help me identify what I am missing?
> 
> Thank you very much for your help,
> /Fourais
> 

Reply via email to