Skip to content

Instantly share code, notes, and snippets.

@LeoHeo
Last active May 13, 2018 09:18
Show Gist options
  • Save LeoHeo/16d37c2143fd3062a05f82f0ac2a2b5c to your computer and use it in GitHub Desktop.
Save LeoHeo/16d37c2143fd3062a05f82f0ac2a2b5c to your computer and use it in GitHub Desktop.
compile group: 'com.amazonaws', name: 'aws-java-sdk-ses', version: "${awsSesVersion}"
AWS_ACCESS_KEY_ID: {AWS_ACCESS_KEY_ID}
AWS_SECRET_KEY: {AWS_SECRET_KEY}
package com.collect.config;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceAsync;
import com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceAsyncClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author Heo, Jin Han
* @since 2018-05-02
*/
@Configuration
public class AwsSesConfig {
@Value("${AWS_ACCESS_KEY_ID}")
private String AWS_ACCESS_KEY_ID;
@Value("${AWS_SECRET_KEY}")
private String AWS_SECRET_KEY;
@Bean
public AmazonSimpleEmailServiceAsync amazonSimpleEmailService() {
BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(AWS_ACCESS_KEY_ID, AWS_SECRET_KEY);
return AmazonSimpleEmailServiceAsyncClient.asyncBuilder()
.withCredentials(new AWSStaticCredentialsProvider(basicAWSCredentials))
.withRegion(Regions.US_WEST_2)
.build();
}
}
@ChangJoo-Park
Copy link

잘쓰겠습니다 (_ _)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment