I am using Storage and API from aws-amplify
My intention is to get the name of the image from the API and then display it in a tag. Don't know what is wrong.
I can upload images with the following command: Storage.vault.put. I have set the permissions in the IAM-roles. The code goes as follows:
I use the following to get the URL and used vaults as the documentation says it is used for private folders:
useEffect(() => {
Storage.vault.get("Image.jpg").then(data => {
setImageUrl(data);
});
});
In the markup I set the with the following:
<image src={imageUrl} width="200px" height="200px" alt=""/>
My AWS structure
I use Cognito to manage the login and the IAM reflects this. In S3 the images are located in private/${cognito-identity.amazonaws.com:sub}/here
Developer tool Console:
GET https://app-uploads.s3.us-west-2.amazonaws.com/private/us-west-2....... - 404 (Not Found)