Created
September 7, 2016 02:09
-
-
Save steveperkins/71156551b0c040a14e3223d4fd916b48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.lightside.demo; | |
import com.amazonaws.auth.AWSStaticCredentialsProvider; | |
import com.amazonaws.auth.BasicAWSCredentials; | |
import com.amazonaws.regions.Regions; | |
import com.amazonaws.services.iotdata.AWSIotData; | |
import com.amazonaws.services.iotdata.AWSIotDataClientBuilder; | |
import com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClient; | |
import com.amazonaws.services.sns.AmazonSNSClient; | |
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) | |
.withRegion(Regions.US_WEST_2); | |
} | |
return snsClient; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment