java - 用于在 AWS 参数存储中设置参数的 Java API 是什么?

标签 java amazon-web-services aws-sdk

我们使用以下代码从 AWS Parameter Store 获取参数:

AWSSimpleSystemsManagement client = AWSSimpleSystemsManagementClientBuilder.standard().build();
    GetParametersByPathRequest request = new GetParametersByPathRequest();
    request.setWithDecryption(true);
    request.setPath(path);
    GetParametersByPathResult result = client.getParametersByPath(request);

设置参数的代码是什么?

最佳答案

您可以通过这种方式创建 key :

//Instantiate default ssm client
AWSSimpleSystemsManagement ssmClient = AWSSimpleSystemsManagementClientBuilder.defaultClient();   

//Create request object with the key and value in String
PutParameterRequest putRequest = new PutParameterRequest();
putRequest.setName(<key as String>);
putRequest.setValue(<value as String>);
putRequest.setType("String");

//Overwrite the key if it already exist
putRequest.setOverwrite(true);
ssmClient.putParameter(putRequest);

关于java - 用于在 AWS 参数存储中设置参数的 Java API 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46796534/

相关文章:

java - 如何平滑圆角矩形的角,Swing?

java - Volley DELETE 请求抛出 400 BAD REQUEST

java - 填充已实例化的 map

Java小程序: AccessControlException again

amazon-ec2 - 新的 Amazon EC2 集群 GPU 实例的体验如何?

python - Airflow - 使用 AWS SES 发送电子邮件

node.js - 如何在 AWS Cognito 的用户池中获取用户的额外属性

node.js - 使用 Node js aws-sdk 检查 S3 上是否存在文件夹

amazon-web-services - AWS Sagemaker部署失败

scala - 如何在 Scala 或 Java 中模拟或 stub AWS SDK S3 存储桶调用?