createPipe method

Future<CreatePipeResponse> createPipe({
  1. required String name,
  2. required String roleArn,
  3. required String source,
  4. required String target,
  5. String? description,
  6. RequestedPipeState? desiredState,
  7. String? enrichment,
  8. PipeEnrichmentParameters? enrichmentParameters,
  9. String? kmsKeyIdentifier,
  10. PipeLogConfigurationParameters? logConfiguration,
  11. PipeSourceParameters? sourceParameters,
  12. Map<String, String>? tags,
  13. PipeTargetParameters? targetParameters,
})

Create a pipe. Amazon EventBridge Pipes connect event sources to targets and reduces the need for specialized knowledge and integration code.

May throw ConflictException. May throw InternalException. May throw NotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter name : The name of the pipe.

Parameter roleArn : The ARN of the role that allows the pipe to send data to the target.

Parameter source : The ARN of the source resource.

Parameter target : The ARN of the target resource.

Parameter description : A description of the pipe.

Parameter desiredState : The state the pipe should be in.

Parameter enrichment : The ARN of the enrichment resource.

Parameter enrichmentParameters : The parameters required to set up enrichment on your pipe.

Parameter kmsKeyIdentifier : The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt pipe data. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.

If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt pipe data.

For more information, see Managing keys in the Key Management Service Developer Guide.

Parameter logConfiguration : The logging configuration settings for the pipe.

Parameter sourceParameters : The parameters required to set up a source for your pipe.

Parameter tags : The list of key-value pairs to associate with the pipe.

Parameter targetParameters : The parameters required to set up a target for your pipe.

For more information about pipe target parameters, including how to use dynamic path parameters, see Target parameters in the Amazon EventBridge User Guide.

Implementation

Future<CreatePipeResponse> createPipe({
  required String name,
  required String roleArn,
  required String source,
  required String target,
  String? description,
  RequestedPipeState? desiredState,
  String? enrichment,
  PipeEnrichmentParameters? enrichmentParameters,
  String? kmsKeyIdentifier,
  PipeLogConfigurationParameters? logConfiguration,
  PipeSourceParameters? sourceParameters,
  Map<String, String>? tags,
  PipeTargetParameters? targetParameters,
}) async {
  final $payload = <String, dynamic>{
    'RoleArn': roleArn,
    'Source': source,
    'Target': target,
    if (description != null) 'Description': description,
    if (desiredState != null) 'DesiredState': desiredState.value,
    if (enrichment != null) 'Enrichment': enrichment,
    if (enrichmentParameters != null)
      'EnrichmentParameters': enrichmentParameters,
    if (kmsKeyIdentifier != null) 'KmsKeyIdentifier': kmsKeyIdentifier,
    if (logConfiguration != null) 'LogConfiguration': logConfiguration,
    if (sourceParameters != null) 'SourceParameters': sourceParameters,
    if (tags != null) 'Tags': tags,
    if (targetParameters != null) 'TargetParameters': targetParameters,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/pipes/${Uri.encodeComponent(name)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreatePipeResponse.fromJson(response);
}