File tree Expand file tree Collapse file tree 8 files changed +9
-9
lines changed
src/main/kotlin/com/kotlin/ecs Expand file tree Collapse file tree 8 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 11import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22
33plugins {
4- kotlin(" jvm" ) version " 1.9 .0"
4+ kotlin(" jvm" ) version " 2.1 .0"
55 application
66}
77
@@ -27,7 +27,7 @@ repositories {
2727}
2828apply (plugin = " org.jlleitschuh.gradle.ktlint" )
2929dependencies {
30- implementation(platform(" aws.sdk.kotlin:bom:1.3.112 " ))
30+ implementation(platform(" aws.sdk.kotlin:bom:1.4.119 " ))
3131 implementation(" aws.sdk.kotlin:ecs" )
3232 implementation(" aws.sdk.kotlin:secretsmanager" )
3333 implementation(" aws.smithy.kotlin:http-client-engine-okhttp" )
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ suspend fun createGivenCluster(clusterNameVal: String?): String? {
5858 configuration = clusterConfiguration
5959 }
6060
61- EcsClient { region = " us-east-1" }.use { ecsClient ->
61+ EcsClient .fromEnvironment { region = " us-east-1" }.use { ecsClient ->
6262 val response = ecsClient.createCluster(request)
6363 return response.cluster?.clusterArn
6464 }
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ suspend fun createNewService(
7676 taskDefinition = taskDefinitionVal
7777 }
7878
79- EcsClient { region = " us-east-1" }.use { ecsClient ->
79+ EcsClient .fromEnvironment { region = " us-east-1" }.use { ecsClient ->
8080 val response = ecsClient.createService(request)
8181 return response.service?.serviceArn
8282 }
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ suspend fun deleteSpecificService(
4848 service = serviceArn
4949 }
5050
51- EcsClient { region = " us-east-1" }.use { ecsClient ->
51+ EcsClient .fromEnvironment { region = " us-east-1" }.use { ecsClient ->
5252 ecsClient.deleteService(request)
5353 println (" The Service was successfully deleted." )
5454 }
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ suspend fun descCluster(clusterArn: String) {
4343 clusters = listOf (clusterArn)
4444 }
4545
46- EcsClient { region = " us-east-1" }.use { ecsClient ->
46+ EcsClient .fromEnvironment { region = " us-east-1" }.use { ecsClient ->
4747 val response = ecsClient.describeClusters(request)
4848 response.clusters?.forEach { cluster ->
4949 println (" The cluster name is ${cluster.clusterName} ." )
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ suspend fun main() {
2222
2323// snippet-start:[ecs.kotlin.list_clusters.main]
2424suspend fun listAllClusters () {
25- EcsClient { region = " us-east-1" }.use { ecsClient ->
25+ EcsClient .fromEnvironment { region = " us-east-1" }.use { ecsClient ->
2626 val response = ecsClient.listClusters(ListClustersRequest {})
2727 response.clusterArns?.forEach { cluster ->
2828 println (" The cluster arn is $cluster ." )
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ suspend fun getAllTasks(
4949 tasks = listOf (taskId)
5050 }
5151
52- EcsClient { region = " us-east-1" }.use { ecsClient ->
52+ EcsClient .fromEnvironment { region = " us-east-1" }.use { ecsClient ->
5353 val response = ecsClient.describeTasks(request)
5454 response.tasks?.forEach { task ->
5555 println (" The task ARN is " + task.taskDefinitionArn)
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ suspend fun updateSpecificService(
4949 desiredCount = 0
5050 }
5151
52- EcsClient { region = " us-east-1" }.use { ecsClient ->
52+ EcsClient .fromEnvironment { region = " us-east-1" }.use { ecsClient ->
5353 ecsClient.updateService(request)
5454 println (" The service was modified" )
5555 }
You can’t perform that action at this time.
0 commit comments