31 lines
1.1 KiB
Kotlin
31 lines
1.1 KiB
Kotlin
package kr.co.vividnext.sodalive.configs
|
|
|
|
import com.amazonaws.auth.AWSStaticCredentialsProvider
|
|
import com.amazonaws.auth.BasicAWSCredentials
|
|
import com.amazonaws.services.sqs.AmazonSQS
|
|
import com.amazonaws.services.sqs.AmazonSQSClientBuilder
|
|
import org.springframework.beans.factory.annotation.Value
|
|
import org.springframework.context.annotation.Bean
|
|
import org.springframework.context.annotation.Configuration
|
|
|
|
@Configuration
|
|
class AmazonSQSConfig(
|
|
@Value("\${cloud.aws.credentials.access-key}")
|
|
private val accessKey: String,
|
|
@Value("\${cloud.aws.credentials.secret-key}")
|
|
private val secretKey: String,
|
|
@Value("\${cloud.aws.region.static}")
|
|
private val region: String
|
|
) {
|
|
@Bean
|
|
fun amazonSQS(): AmazonSQS {
|
|
val basicAWSCredentials = BasicAWSCredentials(accessKey, secretKey)
|
|
val awsStaticCredentialsProvider = AWSStaticCredentialsProvider(basicAWSCredentials)
|
|
|
|
return AmazonSQSClientBuilder.standard()
|
|
.withCredentials(awsStaticCredentialsProvider)
|
|
.withRegion(region)
|
|
.build()
|
|
}
|
|
}
|