2
我試圖使用AWS Java SDK v1.7.5訪問我的AWS DataPipelines,但listPipelines正在返回下面代碼中的空列表。AWS DataPipelineClient - listPipelines不返回記錄
我有美國東部地區的DataPipelines計劃,我相信我應該能夠使用DataPipelineClient的listPipelines方法列出。我已經在使用ProfilesConfigFile進行身份驗證並連接到S3,DynamoDB和Kinesis,沒有任何問題。我已將PowerUserAccess訪問策略授予配置文件中指定的IAM用戶。我也嘗試將管理員訪問策略應用於用戶,但沒有改變任何內容。下面是我使用的代碼:
//Establish credentials for connecting to AWS.
File configFile = new File(System.getProperty("user.home"), ".aws/config");
ProfilesConfigFile profilesConfigFile = new ProfilesConfigFile(configFile);
AWSCredentialsProvider awsCredentialsProvider = new ProfileCredentialsProvider(profilesConfigFile, "default");
//Set up the AWS DataPipeline connection.
DataPipelineClient dataPipelineClient = new DataPipelineClient(awsCredentialsProvider);
Region usEast1 = Region.getRegion(Regions.US_EAST_1);
dataPipelineClient.setRegion(usEast1);
//List all pipelines we have access to.
ListPipelinesResult listPipelinesResult = dataPipelineClient.listPipelines(); //empty list returned here.
for (PipelineIdName p: listPipelinesResult.getPipelineIdList()) {
System.out.println(p.getId());
}