createTaskSet

inline suspend fun EcsClient.createTaskSet(crossinline block: CreateTaskSetRequest.Builder.() -> Unit): CreateTaskSetResponse

Create a task set in the specified cluster and service. This is used when a service uses the EXTERNAL deployment controller type. For more information, see Amazon ECS deployment types in the Amazon Elastic Container Service Developer Guide.

On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition.

For information about the maximum number of task sets and other quotas, see Amazon ECS service quotas in the Amazon Elastic Container Service Developer Guide.

Samples

import aws.sdk.kotlin.services.ecs.model.AwsVpcConfiguration
import aws.sdk.kotlin.services.ecs.model.NetworkConfiguration
fun main() { 
   //sampleStart 
   // This example creates a task set in a service that uses the EXTERNAL deployment controller.
val resp = ecsClient.createTaskSet {
    service = "MyService"
    cluster = "MyCluster"
    taskDefinition = "MyTaskDefinition:2"
    networkConfiguration = NetworkConfiguration {
        awsvpcConfiguration = AwsVpcConfiguration {
            subnets = listOf<String>(
                "subnet-12344321"
            )
            securityGroups = listOf<String>(
                "sg-12344321"
            )
        }
    }
} 
   //sampleEnd
}