createConnector method
Creates a connector to a third-party cloud provider in Security Hub CSPM. A connector establishes a connection between Security Hub CSPM and a third-party cloud provider, enabling Security Hub CSPM to ingest security findings and resource data from the connected environment.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw InvalidAccessException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter name :
The name of the connector. Must be unique within the account.
Parameter provider :
The configuration for the cloud provider to connect to. Currently supports
Azure.
Parameter clientToken :
A unique identifier used to ensure idempotency of the request.
Parameter description :
The description of the connector.
Parameter tags :
The tags to add to the connector resource.
Implementation
Future<CreateConnectorResponse> createConnector({
required String name,
required CspmProviderConfiguration provider,
String? clientToken,
String? description,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'Name': name,
'Provider': provider,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'Description': description,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/connectors',
exceptionFnMap: _exceptionFns,
);
return CreateConnectorResponse.fromJson(response);
}