Skip to content

Commit

Permalink
adopt required changes for smithy4s 0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
bpholt committed Nov 16, 2023
1 parent bc5548e commit f82bad3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import feral.lambda.{INothing, IOLambda, LambdaEnv}
import org.http4s.ember.client.EmberClientBuilder
import org.typelevel.log4cats.LoggerFactory
import org.typelevel.log4cats.slf4j.Slf4jFactory
import smithy4s.aws.http4s.*
import smithy4s.aws.*
import smithy4s.aws.kernel.AwsRegion
import software.amazon.awssdk.services.autoscaling.AutoScalingAsyncClient
import software.amazon.awssdk.services.sns.SnsAsyncClient
Expand All @@ -21,7 +21,8 @@ class TerminationEventHandler extends IOLambda[SnsEvent, INothing] {
for {
client <- EmberClientBuilder.default[IO].build
given LoggerFactory[IO] = Slf4jFactory.create[IO]
ecs <- ECS.simpleAwsClient(client, AwsRegion.US_WEST_2).map(EcsAlg(_))
awsEnv <- AwsEnvironment.default(client, AwsRegion.US_WEST_2)
ecs <- AwsClient(ECS, awsEnv).map(EcsAlg(_))
autoscalingClient <- Resource.fromAutoCloseable(IO(AutoScalingAsyncClient.builder().build()))
sns <- Resource.fromAutoCloseable(IO(SnsAsyncClient.builder().build())).map(SnsAlg[IO](_))
autoscaling = AutoScalingAlg[IO](autoscalingClient, sns)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.dwolla.aws.ecs.EcsAlg
import fs2.Stream
import org.http4s.ember.client.EmberClientBuilder
import org.typelevel.log4cats.*
import smithy4s.aws.http4s.*
import smithy4s.aws.*
import smithy4s.aws.kernel.AwsRegion

object TestApp extends IOApp.Simple {
Expand All @@ -18,7 +18,8 @@ object TestApp extends IOApp.Simple {
for {
client <- EmberClientBuilder.default[IO].build
given LoggerFactory[IO] = new ConsoleLogger[IO]
ecs <- ECS.simpleAwsClient(client, AwsRegion.US_WEST_2).map(EcsAlg(_))
awsEnv <- AwsEnvironment.default(client, AwsRegion.US_WEST_2)
ecs <- AwsClient(ECS, awsEnv).map(EcsAlg(_))
} yield ecs
}
.flatMap { ecs =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import feral.lambda.{INothing, IOLambda, LambdaEnv}
import org.http4s.ember.client.EmberClientBuilder
import org.typelevel.log4cats.LoggerFactory
import org.typelevel.log4cats.slf4j.Slf4jFactory
import smithy4s.aws.http4s.*
import smithy4s.aws.*
import smithy4s.aws.kernel.AwsRegion
import software.amazon.awssdk.services.autoscaling.AutoScalingAsyncClient
import software.amazon.awssdk.services.cloudformation.CloudFormationAsyncClient
Expand All @@ -25,7 +25,8 @@ class ScaleOutPendingEventHandler extends IOLambda[SnsEvent, INothing] {
for {
client <- EmberClientBuilder.default[IO].build
given LoggerFactory[IO] = Slf4jFactory.create[IO]
ecs <- ECS.simpleAwsClient(client, AwsRegion.US_WEST_2).map(EcsAlg(_))
awsEnv <- AwsEnvironment.default(client, AwsRegion.US_WEST_2)
ecs <- AwsClient(ECS, awsEnv).map(EcsAlg(_))
autoscalingClient <- Resource.fromAutoCloseable(IO(AutoScalingAsyncClient.builder().build()))
sns <- Resource.fromAutoCloseable(IO(SnsAsyncClient.builder().build())).map(SnsAlg[IO](_))
ec2Client <- Resource.fromAutoCloseable(IO(Ec2AsyncClient.builder().build())).map(Ec2Alg[IO](_))
Expand Down

0 comments on commit f82bad3

Please sign in to comment.