Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Tournament API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kata
Tournament API
Commits
469ecd49
Commit
469ecd49
authored
5 months ago
by
Clément CORNU
Browse files
Options
Downloads
Patches
Plain Diff
wip: update db config
parent
a7b534b1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/kotlin/configuration/DynamoDbConfiguration.kt
+4
-8
4 additions, 8 deletions
src/main/kotlin/configuration/DynamoDbConfiguration.kt
with
4 additions
and
8 deletions
src/main/kotlin/configuration/DynamoDbConfiguration.kt
+
4
−
8
View file @
469ecd49
package
betclic.test.configuration
import
io.ktor.server.config.*
import
org.slf4j.LoggerFactory
import
software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient
import
software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient
import
java.net.URI
import
software.amazon.awssdk.regions.Region
import
software.amazon.awssdk.auth.credentials.AwsBasicCredentials
import
software.amazon.awssdk.auth.credentials.StaticCredentialsProvider
class
DynamoDbConfiguration
{
private
val
logger
=
LoggerFactory
.
getLogger
(
DynamoDbConfiguration
::
class
.
java
)
fun
createDynamoDbClient
():
DynamoDbAsyncClient
{
val
url
=
ApplicationConfig
(
"application.yaml"
).
property
(
"ktor.database.dynamodbUrl"
).
getString
()
return
DynamoDbAsyncClient
.
builder
()
.
endpointOverride
(
URI
(
"http://localhost:8000"
))
.
region
(
Region
.
US_EAST_1
)
.
credentialsProvider
(
StaticCredentialsProvider
.
create
(
AwsBasicCredentials
.
create
(
"dummy"
,
"dummy"
))
)
.
endpointOverride
(
URI
(
url
))
.
build
()
}
fun
createDataSource
(
dynamoDbAsyncClient
:
DynamoDbAsyncClient
):
DynamoDbEnhancedAsyncClient
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment