startResourceStateUpdate method
Begin asynchronous resource state update for lifecycle changes to the specified image resources.
May throw CallRateLimitExceededException.
May throw ClientException.
May throw ForbiddenException.
May throw IdempotentParameterMismatchException.
May throw InvalidRequestException.
May throw ResourceInUseException.
May throw ResourceNotFoundException.
May throw ServiceException.
May throw ServiceUnavailableException.
Parameter resourceArn :
The Amazon Resource Name (ARN) of the Image Builder resource that is
updated. The state update might also impact associated resources.
Parameter state :
Indicates the lifecycle action to take for this request.
Parameter clientToken :
Unique, case-sensitive identifier you provide to ensure idempotency of the
request. For more information, see Ensuring
idempotency in the Amazon EC2 API Reference.
Parameter exclusionRules :
Skip action on the image resource and associated resources if specified
exclusion rules are met.
Parameter executionRole :
The name or Amazon Resource Name (ARN) of the IAM role that’s used to
update image state.
Parameter includeResources :
A list of image resources to update state for.
Parameter updateAt :
The timestamp that indicates when resources are updated by a lifecycle
action.
Implementation
Future<StartResourceStateUpdateResponse> startResourceStateUpdate({
required String resourceArn,
required ResourceState state,
String? clientToken,
ResourceStateUpdateExclusionRules? exclusionRules,
String? executionRole,
ResourceStateUpdateIncludeResources? includeResources,
DateTime? updateAt,
}) async {
final $payload = <String, dynamic>{
'resourceArn': resourceArn,
'state': state,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (exclusionRules != null) 'exclusionRules': exclusionRules,
if (executionRole != null) 'executionRole': executionRole,
if (includeResources != null) 'includeResources': includeResources,
if (updateAt != null) 'updateAt': unixTimestampToJson(updateAt),
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/StartResourceStateUpdate',
exceptionFnMap: _exceptionFns,
);
return StartResourceStateUpdateResponse.fromJson(response);
}