Aws s3 plugin connect with IAM ROLE AWS

Thanks that would work but with extra add,for anyone else out there: you have to assign an IAM role to your EC2 instance and I qoute

However, instead of being uniquely associated with one person, a role is intended to be assumable by anyone who needs it

In your EC2 instance:
Actions > security > modify IAM role, and then here you will get to assign an IAM role, you can create whatever new role but make sure to choose trusted entity type: AWS service, and Use case: EC2 and for permission policies you can choose what you want this role to allow for your app.