private AmazonS3 s3;
private BasicAWSCredentials awsCreds;
private Bucket bucket;
private String nomeBucket = null;
// @SuppressWarnings("deprecation")
public OperacoesS3() {
try {
// chave geral
awsCreds = new BasicAWSCredentials("AKIA5FTZDHH2SGNA6OFU", "1UXd7Okp8BAkrc+0i/wEqMGgh4DjeuzXKDyeozWo");
AWSStaticCredentialsProvider awsscp = new AWSStaticCredentialsProvider(awsCreds);
s3 = AmazonS3ClientBuilder.standard().withCredentials(awsscp).withRegion(Regions.US_EAST_1).build();
} catch (Exception e) {
e.printStackTrace();
}
private void execEnviarModelo() {
try {
OperacoesS3 s3 = new OperacoesS3();
String destinoArquivo = "20230813_095738.jpg";
String origemArquivo = "C:\Users\rutra\OneDrive\Área de Trabalho\20230813_095738.jpg";
s3.enviarArquivo(destinoArquivo, origemArquivo, 0L);
} catch (Exception e) {
e.printStackTrace();
}
}
I receive this error:
com.amazonaws.services.s3.model.AmazonS3Exception: Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 7YV83CDKHM5EPWKP;
S3 Extended Request ID: Xv3Hz68osBS9wD0E86Vyrfl+a7fLtUeMidSjQ599m3f724zJqaFHyTAyfiKET07ITurFh+hHXTo=; Proxy: null), S3 Extended Request ID: Xv3Hz68osBS9wD0E86Vyrfl+a7fLtUeMidSjQ599m3f724zJqaFHyTAyfiKET07ITurFh+hHXTo=
I dó know where is my mistake./
Can you tell us how you were able to resolve this issue so that others could benefit from the solution