Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

144
Vistas
ec2 can't access another s3 file in the same bucket

I have an S3 bucket and an EC2 with a role that access to that bucket. The ec2 can access s3://mybucket/folderA/file1, but can't access s3://mybucket/folderB/file2. I can't seem to figure out why I can access file1 but not file2 from the ec2 instance. When I try to download file2 like this:

aws s3 cp s3://mybucket/folderB/file2 /home/ec2-user/file2

I get this error:

fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden

But I don't get that error when i download file1:

aws s3 cp s3://mybucket/folderA/file1 /home/ec2-user/file1

----EDIT------

I missed the 403 error...so I guess the question is why isn't it seeing the file

----EDIT-----

here is my bucket policy

{
    "Version": "1-1-1",
    "Id": "Policy111111111",
    "Statement": [
        {
            "Sid": "Sxxxxxxx1234",
            "Effect": "Deny",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": [
                "arn:aws:s3:::mybucket",
                "arn:aws:s3:::mybucket/*"
            ],
            "Condition": {
                "StringNotEquals": {
                    "aws:sourceVpc": "vpc-a8xxxxx"
                }
            }
        },
        {
            "Sid": "RequiredEncryptedPutObject",
            "Effect": "Deny",
            "Principal": "*",
            "Action": "s3:PutObject",
            "Resource": "arn:aws:s3:::mybucket/*",
            "Condition": {
                "StringNotEquals": {
                    "s3:x-amz-server-side-encryption": [
                        "AES256",
                        "aws:kms"
                    ]
                }
            }
        }
    ]
}
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda