addApplicationCloudWatchLoggingOption method
Adds a CloudWatch log stream to monitor application configuration errors.
For more information about using CloudWatch log streams with Amazon
Kinesis Analytics applications, see Working
with Amazon CloudWatch Logs.
May throw ConcurrentModificationException.
May throw InvalidArgumentException.
May throw ResourceInUseException.
May throw ResourceNotFoundException.
May throw UnsupportedOperationException.
Parameter applicationName :
The Kinesis Analytics application name.
Parameter cloudWatchLoggingOption :
Provides the CloudWatch log stream Amazon Resource Name (ARN) and the IAM
role ARN. Note: To write application messages to CloudWatch, the IAM role
that is used must have the PutLogEvents policy action
enabled.
Parameter currentApplicationVersionId :
The version ID of the Kinesis Analytics application.
Implementation
Future<void> addApplicationCloudWatchLoggingOption({
required String applicationName,
required CloudWatchLoggingOption cloudWatchLoggingOption,
required int currentApplicationVersionId,
}) async {
_s.validateNumRange(
'currentApplicationVersionId',
currentApplicationVersionId,
1,
999999999,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'KinesisAnalytics_20150814.AddApplicationCloudWatchLoggingOption'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ApplicationName': applicationName,
'CloudWatchLoggingOption': cloudWatchLoggingOption,
'CurrentApplicationVersionId': currentApplicationVersionId,
},
);
}