putAttributes

inline suspend fun EcsClient.putAttributes(crossinline block: PutAttributesRequest.Builder.() -> Unit): PutAttributesResponse

Create or update an attribute on an Amazon ECS resource. If the attribute doesn't exist, it's created. If the attribute exists, its value is replaced with the specified value. To delete an attribute, use DeleteAttributes. For more information, see Attributes in the Amazon Elastic Container Service Developer Guide.

Samples

import aws.sdk.kotlin.services.ecs.model.Attribute

fun main() { 
   //sampleStart 
   // This example adds an attribute "stack" with the value "production" to a container instance.
val resp = ecsClient.putAttributes {
    cluster = "MyCluster"
    attributes = listOf<Attribute>(
        Attribute {
            targetId = "arn:aws:ecs:us-west-2:123456789012:container-instance/1c3be8ed-df30-47b4-8f1e-6e68ebd01f34"
            name = "stack"
            value = "production"
        }            
    )
} 
   //sampleEnd
}