aws 2024-01-06

hi, I connected aws (for s3) to my heroku app using amazonica. It works but when the app calls aws first time after starting up, it shows the following error message. And afterwards, this message doesn't show up anymore and the app still works with s3. I am using access/secret key for apps that runs outside of aws (out of a few options). I believe this is more about the underlying java lib under amazonica, and interestingly, I couldn't get proper solution after some amount of googling. So I would like to ask you whether you have seen this also and possibly how you have handled this.

WARNING: Unable to retrieve the requested metadata (/latest/dynamic/instance-identity/document). Failed to connect to service endpoint: 
com.amazonaws.SdkClientException: Failed to connect to service endpoint: 
	at com.amazonaws.internal.EC2ResourceFetcher.doReadResource(EC2ResourceFetcher.java:100) ...

It sounds like authentication is not properly set up

Yes, that's possible.

I will check my auth again.

Authentication for AWS is complicated, and there are ways to assign ec2 instances (vms) implicit credentials, and that looks like an error trying to retrieve those implicit credentials

I don't have experience with amazonica, but there should be some way to stop it from trying to use those, I don't think it should use them if it is explicitly configured with credentials

Sure. I will check.

Btw, https://github.com/cognitect-labs/aws-api is also a popular choice compared to amazonica? Just wondering as you said you don't use amazonica.

We don't actually use AWS apis a ton at work right now, I think mostly just transferring through s3 as part of our deployment process, which does use aws-api

Amazonica’a read me explains what’s happening: https://github.com/mcohen01/amazonica#authentication

Ah, that's right. I missed it.