我们正在使用电子病历。在提交星火作业之前,我们正在尝试从AWS Param Store (我们已经编写了一个java程序)中提取配置参数,并创建一个文件并使用它提交火花。
我们使用aws-java-sdk-ssm API从param存储中提取参数。
当我们试图在主节点上运行这个程序时,它希望是一个令牌(. aws /配置/凭据)连接到aws ssm以获取参数。
我们可以在没有凭据的情况下访问S3存储桶,但不能访问param存储。
我们正在从汇流管道中提升电子病历集群。
下面是我们编写的从参数存储中提取参数的方法:
private static List<Parameter> getParametersFromAWSParamStore(String path, String awsRegion){
List<Parameter> paramList = new ArrayList<>();
AWSSimpleSystemsManagement client = AWSSimpleSystemsManagementClientBuilder.standard().withRegion(awsRegion).build();
GetParametersByPathRequest request = new GetParametersByPathRequest();
request.withRecursive(true);
request.withPath(path);
request.setWithDecryption(true);
GetParametersByPathResult result = null;
do {
result = client.getParametersByPath(request);
paramList.addAll(result.getParameters());
}while( result.getNextToken() !=null && !result.getNextToken().isEmpty());
return paramList;
}发布于 2020-09-07 20:28:51
我们需要确保执行此程序的IAM角色具有ssm: getParametersByPath策略。
早些时候,策略丢失了,因此无法提取属性。
https://stackoverflow.com/questions/63748231
复制相似问题