- AWS Code Sample demonstrates how to get information about SSM parameters by using an AWSSimpleSystemsManagement object

/** * Copyright 2010-2020, Inc. or its affiliates. All Rights Reserved. * * This file is licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. A copy of * the License is located at * * * * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * */ package aws.example.ssm; import com.amazonaws.regions.Regions; import; import; import; import; import; import java.util.Iterator; import java.util.List; import com.amazonaws.AmazonServiceException; public class GetSimpleSystemsManagementParas { public static void main(String[] args) { AWSSimpleSystemsManagement ssm = AWSSimpleSystemsManagementClientBuilder.standard().withRegion(Regions.DEFAULT_REGION).build(); try { DescribeParametersRequest desRequest = new DescribeParametersRequest(); desRequest.setMaxResults(10); DescribeParametersResult results = ssm.describeParameters(desRequest); List<ParameterMetadata> params = results.getParameters(); //Iterate through the list Iterator<ParameterMetadata> tagIterator = params.iterator(); while(tagIterator.hasNext()) { ParameterMetadata paraMeta = (ParameterMetadata); System.out.println(paraMeta.getName()); System.out.println(paraMeta.getDescription()); } } catch (AmazonServiceException e) { e.getStackTrace(); } } }

Sample Details

Service: ssm

Last tested: 2020-01-24

Author: AWS - scmacdon

Type: full-example