createChannel method
Creates a channel for CloudTrail to ingest events from a partner or external source. After you create a channel, a CloudTrail Lake event data store can log events from the partner or source that you specify.
May throw ChannelAlreadyExistsException.
May throw ChannelMaxLimitExceededException.
May throw EventDataStoreARNInvalidException.
May throw EventDataStoreNotFoundException.
May throw InactiveEventDataStoreException.
May throw InvalidEventDataStoreCategoryException.
May throw InvalidParameterException.
May throw InvalidSourceException.
May throw InvalidTagParameterException.
May throw OperationNotPermittedException.
May throw TagsLimitExceededException.
May throw UnsupportedOperationException.
Parameter destinations :
One or more event data stores to which events arriving through a channel
will be logged.
Parameter name :
The name of the channel.
Parameter source :
The name of the partner or external event source. You cannot change this
name after you create the channel. A maximum of one channel is allowed per
source.
A source can be either Custom for all valid non-Amazon Web
Services events, or the name of a partner event source. For information
about the source names for available partners, see Additional
information about integration partners in the CloudTrail User Guide.
Implementation
Future<CreateChannelResponse> createChannel({
required List<Destination> destinations,
required String name,
required String source,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CloudTrail_20131101.CreateChannel'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Destinations': destinations,
'Name': name,
'Source': source,
if (tags != null) 'Tags': tags,
},
);
return CreateChannelResponse.fromJson(jsonResponse.body);
}