startResourceStateUpdate
inline suspend fun ImagebuilderClient.startResourceStateUpdate(crossinline block: StartResourceStateUpdateRequest.Builder.() -> Unit): StartResourceStateUpdateResponse
Begins an ad-hoc state change for the specified image build version. This is a one-time operation - if you schedule the update, it runs only once. If the request includes underlying resources, or schedules the update far enough in the future, Image Builder runs the update as an asynchronous lifecycle execution and returns its identifier. Otherwise, for target states other than DELETED, the state change applies immediately. If a request that starts a lifecycle execution arrives while the image already has one in progress, Image Builder rejects it.
Samples
// The following example schedules the specified image build version and its AMI to move to the
// DEPRECATED state at the requested future time. It returns the ID of the lifecycle execution that applies the
// update.
val resp = imagebuilderClient.startResourceStateUpdate {
resourceArn = "arn:aws:imagebuilder:us-west-2:111122223333:image/my-example-recipe/1.0.0/1"
state = ResourceState {
status = ResourceStatus.fromValue("DEPRECATED")
}
executionRole = "arn:aws:iam::111122223333:role/my-example-state-update-role"
includeResources = ResourceStateUpdateIncludeResources {
amis = true
}
updateAt = "2026-09-11T21:20:00Z"
clientToken = "a1b2c3d4-5678-90ab-cdef-EXAMPLE24680"
}Content copied to clipboard