use of com.amazonaws.services.servicediscovery.model.CreateServiceRequest in project aws-doc-sdk-examples by awsdocs.
the class CreateService method main.
public static void main(String[] args) throws Exception {
AWSCredentials credentials = null;
try {
credentials = new ProfileCredentialsProvider().getCredentials();
} catch (Exception e) {
throw new AmazonClientException("Cannot Load credentials");
}
AWSServiceDiscovery client = AWSServiceDiscoveryClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(credentials)).withRegion("us-east-1").build();
CreateServiceRequest crequest = new CreateServiceRequest();
crequest.setName("example-service-01");
crequest.setDescription("This is an example service request");
// Replace with the namespaceID
crequest.setNamespaceId("ns-ldmexc5fqajjnhco");
System.out.println(client.createService(crequest));
}
Aggregations