I am writing a powershell script to download a file from an s3 url. I keep getting a (403) Forbidden error. The command i use is
Invoke-WebRequest -Uri "http://bucketname.s3.amazonaws.com/file.txt"
The EC2 instance has an IAM role associated with it that has access to download from the s3 bucket. I am able to run commands (cp, ls, etc.) with the aws cli successfully. Is this an issue with the credentials I am passing with the request? Do I need to pass AWS credentials with this request?