signalResource method
- required String logicalResourceId,
- required String stackName,
- required ResourceSignalStatus status,
- required String uniqueId,
Sends a signal to the specified resource with a success or failure status. You can use the SignalResource API in conjunction with a creation policy or update policy. AWS CloudFormation doesn't proceed with a stack creation or update until resources receive the required number of signals or the timeout period is exceeded. The SignalResource API is useful in cases where you want to send signals from anywhere other than an Amazon EC2 instance.
Parameter logicalResourceId
:
The logical ID of the resource that you want to signal. The logical ID is
the name of the resource that given in the template.
Parameter stackName
:
The stack name or unique stack ID that includes the resource that you want
to signal.
Parameter status
:
The status of the signal, which is either success or failure. A failure
signal causes AWS CloudFormation to immediately fail the stack creation or
update.
Parameter uniqueId
:
A unique ID of the signal. When you signal Amazon EC2 instances or Auto
Scaling groups, specify the instance ID that you are signaling as the
unique ID. If you send multiple signals to a single resource (such as
signaling a wait condition), each signal requires a different unique ID.
Implementation
Future<void> signalResource({
required String logicalResourceId,
required String stackName,
required ResourceSignalStatus status,
required String uniqueId,
}) async {
ArgumentError.checkNotNull(logicalResourceId, 'logicalResourceId');
ArgumentError.checkNotNull(stackName, 'stackName');
_s.validateStringLength(
'stackName',
stackName,
1,
1152921504606846976,
isRequired: true,
);
ArgumentError.checkNotNull(status, 'status');
ArgumentError.checkNotNull(uniqueId, 'uniqueId');
_s.validateStringLength(
'uniqueId',
uniqueId,
1,
64,
isRequired: true,
);
final $request = <String, dynamic>{};
$request['LogicalResourceId'] = logicalResourceId;
$request['StackName'] = stackName;
$request['Status'] = status.toValue();
$request['UniqueId'] = uniqueId;
await _protocol.send(
$request,
action: 'SignalResource',
version: '2010-05-15',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['SignalResourceInput'],
shapes: shapes,
);
}