0
請參考下面的代碼,我使用的列出RDS(MySQL的)可用日誌文件RDS:無法執行HTTP請求:無法識別的SSL消息,明文連接?
AWSCredentials credentials = new BasicAWSCredentials("XXX", "XXX");
AWSCredentialsProvider provider = new StaticCredentialsProvider(credentials);
AmazonRDS rdsClient = AmazonRDSClientBuilder.standard()
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration("XXXX.us-west-2.rds.amazonaws.com:3306", "us-west-2"))
.withCredentials(provider)
.build();
DescribeDBLogFilesRequest request = new DescribeDBLogFilesRequest();
DescribeDBLogFilesResult response = rdsClient.describeDBLogFiles(request);
List<DescribeDBLogFilesDetails> listOfFiles = response.getDescribeDBLogFiles();
System.out.println(listOfFiles.toString());
System.out.println("Program done");
這裏是我的pom.xml依賴:
<!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-rds -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-rds</artifactId>
<version>1.11.101</version>
</dependency>
我現在用的是當面對異常以上代碼。