I’m currently facing an issue with accessing objects within my AWS S3 bucket using an IAM user that has been granted specific permissions. Here’s a brief overview of my setup:
- S3 Bucket Policy:
- I have an S3 bucket named eskolo-dev-bucket with the following policy attached:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowUserAccess",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::XXXXXXXXXX:user/eskoloAppUsers"
},
"Action": "s3:*",
"Resource": "arn:aws:s3:::eskolo-dev-bucket/*"
}
]
}
- IAM User Policy:
The IAM user eskoloAppUsers has the following policies attached:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListPolicy",
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::eskolo-dev-bucket"
]
},
{
"Sid": "ManipulatePolicy",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:DeleteObject",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::eskolo-dev-bucket/*"
]
}
]
}
- Issue Description:
- When attempting to access objects within the eskolo-dev-bucket via my.NET application using the GetObjectMetadataAsync method, I consistently receive a 404 error. The URIs I’m using are:
s3://eskolo-dev-bucket/development/assets/eSkolo Logo.svg
s3://eskolo-dev-bucket/development/email-templates/e-Skolo-OTP-template.hbs
- Expected Behavior:
- I expect to be able to successfully retrieve metadata for these objects without receiving a 404 error.
- Actual Behavior:
- Upon making the request, I receive a 404 error indicating that the requested resource does not exist.
- Steps Taken to Resolve:
- Double-checked the bucket name and object paths for typos.
- Verified that the IAM user has the correct permissions.
- Ensured that the objects exist within the specified paths in the S3 bucket.
- Additional Information:
- The IAM user was recently created and the permissions were updated accordingly.
- There are no network issues or firewalls blocking access to AWS services.