Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

140
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda