createIntegration method

Future<Integration> createIntegration({
  1. required String integrationName,
  2. required String sourceArn,
  3. required String targetArn,
  4. Map<String, String>? additionalEncryptionContext,
  5. String? dataFilter,
  6. String? description,
  7. String? kMSKeyId,
  8. List<Tag>? tags,
})

Creates a zero-ETL integration with Amazon Redshift.

May throw DBClusterNotFoundFault. May throw DBInstanceNotFoundFault. May throw IntegrationAlreadyExistsFault. May throw IntegrationConflictOperationFault. May throw IntegrationQuotaExceededFault. May throw KMSKeyNotAccessibleFault.

Parameter integrationName : The name of the integration.

Parameter sourceArn : The Amazon Resource Name (ARN) of the database to use as the source for replication.

Parameter targetArn : The ARN of the Redshift data warehouse to use as the target for replication.

Parameter additionalEncryptionContext : An optional set of non-secret key–value pairs that contains additional contextual information about the data. For more information, see Encryption context in the Amazon Web Services Key Management Service Developer Guide.

You can only include this parameter if you specify the KMSKeyId parameter.

Parameter dataFilter : Data filtering options for the integration. For more information, see Data filtering for Aurora zero-ETL integrations with Amazon Redshift or Data filtering for Amazon RDS zero-ETL integrations with Amazon Redshift.

Parameter description : A description of the integration.

Parameter kMSKeyId : The Amazon Web Services Key Management System (Amazon Web Services KMS) key identifier for the key to use to encrypt the integration. If you don't specify an encryption key, RDS uses a default Amazon Web Services owned key.

Implementation

Future<Integration> createIntegration({
  required String integrationName,
  required String sourceArn,
  required String targetArn,
  Map<String, String>? additionalEncryptionContext,
  String? dataFilter,
  String? description,
  String? kMSKeyId,
  List<Tag>? tags,
}) async {
  final $request = <String, String>{
    'IntegrationName': integrationName,
    'SourceArn': sourceArn,
    'TargetArn': targetArn,
    if (additionalEncryptionContext != null)
      for (var e1 in additionalEncryptionContext.entries
          .toList()
          .asMap()
          .entries) ...{
        'AdditionalEncryptionContext.entry.${e1.key + 1}.key': e1.value.key,
        'AdditionalEncryptionContext.entry.${e1.key + 1}.value':
            e1.value.value,
      },
    if (dataFilter != null) 'DataFilter': dataFilter,
    if (description != null) 'Description': description,
    if (kMSKeyId != null) 'KMSKeyId': kMSKeyId,
    if (tags != null)
      if (tags.isEmpty)
        'Tags': ''
      else
        for (var i1 = 0; i1 < tags.length; i1++)
          for (var e3 in tags[i1].toQueryMap().entries)
            'Tags.Tag.${i1 + 1}.${e3.key}': e3.value,
  };
  final $result = await _protocol.send(
    $request,
    action: 'CreateIntegration',
    version: '2014-10-31',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'CreateIntegrationResult',
  );
  return Integration.fromXml($result);
}