I want to create a bucket that can be accessed by users in certain IP range without having to login. So these users should be able to freely upload files to that bucket without logging in. And I want to access these files from a lambda using the S3 file link provided by my users.
I am trying to first allow anyone to access the bucket without logging in before adding IP restrictions.
I made the bucket public with this policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicRead",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-public-bucket/*"
}
]
}
I also gave public access via ACL to write to the bucket:

Right now if I try to access the link (https://s3.console.aws.amazon.com/s3/buckets/my-public-bucket/?region=us-west-2&tab=overview) to the bucket in incognito I get this:

I thought I could use the static web hosting url (http://my-public-bucket.s3-website-us-west-2.amazonaws.com) but that's only to host websites.
Is my only option creating a new IAM role and giving its credentials to the users? This is a very bad user experience and I want to avoid it.