use of com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagement in project aws-doc-sdk-examples by awsdocs.
the class GetSimpleSystemsManagementParas method main.
public static void main(String[] args) {
// snippet-start:[ssm.Java1.get_params.main]
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) tagIterator.next();
System.out.println(paraMeta.getName());
System.out.println(paraMeta.getDescription());
}
} catch (AmazonServiceException e) {
e.getStackTrace();
}
// snippet-end:[ssm.Java1.get_params.main]
}
use of com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagement in project Gatekeeper by FINRAOS.
the class AwsSessionServiceTest method testGetSsmSession.
@Test
public void testGetSsmSession() {
AWSSimpleSystemsManagement client = awsSessionService.getSsmSession(awsEnvironment);
Assert.assertNotNull("Verify Ssm Session is fetched", client);
Mockito.verify(awsSessionFactory, times(1)).createSsmSession(anyObject(), eq(awsEnvironment.getRegion()));
}
use of com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagement in project spring-cloud-aws by awspring.
the class AwsParamStorePropertySourceLocator method locate.
@Override
public PropertySource<?> locate(Environment environment) {
if (!(environment instanceof ConfigurableEnvironment)) {
return null;
}
ConfigurableEnvironment env = (ConfigurableEnvironment) environment;
AwsParamStorePropertySources sources = new AwsParamStorePropertySources(this.properties);
List<String> profiles = Arrays.asList(env.getActiveProfiles());
List<String> contexts = sources.getAutomaticContexts(profiles);
// contexts are initially loaded in ascending priority order (for the
// compatibility with spring-config-import=)
// here it must be reversed to load from the most specific property source first
Collections.reverse(contexts);
this.contexts.addAll(contexts);
CompositePropertySource composite = new CompositePropertySource("aws-param-store");
for (String propertySourceContext : this.contexts) {
PropertySource<AWSSimpleSystemsManagement> propertySource = sources.createPropertySource(propertySourceContext, !this.properties.isFailFast(), this.ssmClient);
if (propertySource != null) {
composite.addPropertySource(propertySource);
}
}
return composite;
}
use of com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagement in project spring-cloud-aws by awspring.
the class AwsParamStoreConfigDataLoader method load.
@Override
public ConfigData load(ConfigDataLoaderContext context, AwsParamStoreConfigDataResource resource) {
try {
AWSSimpleSystemsManagement ssm = context.getBootstrapContext().get(AWSSimpleSystemsManagement.class);
AwsParamStorePropertySource propertySource = resource.getPropertySources().createPropertySource(resource.getContext(), resource.isOptional(), ssm);
if (propertySource != null) {
return new ConfigData(Collections.singletonList(propertySource));
} else {
return null;
}
} catch (Exception e) {
throw new ConfigDataResourceNotFoundException(resource, e);
}
}
Aggregations