AWS SSM Parameter Store JAVA Demo

 

<dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-java-sdk-ssm</artifactId>
    <version>1.11.762</version>
</dependency>

 

public void testParameterStore() {
        BasicAWSCredentials awsCreds= new BasicAWSCredentials(
                "ak","sk");
        AWSSimpleSystemsManagement ssm = AWSSimpleSystemsManagementClientBuilder.standard()
                .withRegion(Regions.US_EAST_1)
                .withCredentials(new AWSStaticCredentialsProvider(awsCreds)).build();

        GetParameterRequest request = new GetParameterRequest();
        request.setName("/***/test");
        request.setWithDecryption(false);
        GetParameterResult result = ssm.getParameter(request);
        System.out.println(result.getParameter().getValue());
    }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章