Closed
Description
There are scenarios in which users need a running Service in order to retrieve data. This data shall then be used to spawn another Service.
An example for this could be querying AWS SSM for a secret that is then used inside a Lambda.
I imagine the code to look something like this:
import Soto
import SotoSSM
enum MyLambda {
static func main() async throws {
let awsClient = AWSClient()
let ssmClient = SSMClient(awsClient)
try await withTaskGroup { taskGroup in
let serviceGroup = ServiceGroup([awsClient])
taskGroup.addTask {
try await serviceGroup.run()
}
let mySecret = try await ssmClient.getSecret()
let runtime = LambdaRuntime { (event: Request, context) in
// use mySecret
}
// add runtime to already running serviceGroup.
serviceGroup.add(runtime)
}
}
}
Metadata
Metadata
Assignees
Labels
No labels