Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
package org.lightside.demo;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.regions.Regions;
public class AwsClientFactoryDemo {
private static final String CLIENT_TOKEN = "your IAM user's token here";
private static final String CLIENT_SECRET = "your IAM user's secret token here";
private static final BasicAWSCredentials CREDENTIALS = new BasicAWSCredentials(CLIENT_TOKEN, CLIENT_SECRET);
private static AmazonSNSClient snsClient = null;
public static AmazonSNSClient getSnsClient() {
if(null == snsClient) {
snsClient = new AmazonSNSClient(CREDENTIALS)
return snsClient;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment