# Terraform backends cannot contain interpolations
terraform {
  backend "s3" {
    bucket  = "orcd-terraform-state"
    key     = "prod/kafka-infra/kafka-cluster/topics/terraform.tfstate"
    region  = "us-east-1"
    encrypt = "true"
  }

  required_providers {
    kafka = {
      source  = "mongey/kafka"
      version = ">= 0.2.10"
    }
  }
}

provider "kafka" {
  bootstrap_servers = var.bootstrap_servers
  tls_enabled       = true
}

resource "kafka_topic" "prod_ows_assets_history" {
  name               = "_prod_ows_assets_history"
  replication_factor = 3
  partitions         = 1
  config = {
    "cleanup.policy"    = "delete"
    "retention.bytes"   = "-1"
    "retention.ms"      = "9223372036854775807"
  }
}

resource "kafka_topic" "cdc_analytics_sound_recordings_streams_v02" {
  name               = "cdc.analytics.soundRecordingsStreams.v02"
  replication_factor = 3
  partitions         = 1
  config = {
    "max.message.bytes" = "15728640"
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "cdc_art_relations_track_audio_attributes" {
  name               = "cdc.artRelations.trackAudioAttributes"
  replication_factor = 3
  partitions         = 1
  config = {
    "cleanup.policy"    = "delete"
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "cdc_art_relations_track_rights_attributes" {
  name               = "cdc.artRelations.trackRightsAttributes"
  replication_factor = 3
  partitions         = 1
  config = {
    "cleanup.policy"    = "delete"
    "retention.ms"      = "604800000"
  }
}

resource "kafka_topic" "cdc_art_relations_track_master_rights" {
  name               = "cdc.artRelations.trackMasterRights"
  replication_factor = 3
  partitions         = 1
  config = {
    "cleanup.policy"    = "delete"
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "cdc_analytics_participants_streams_v02" {
  name               = "cdc.analytics.participantsStreams.v02"
  replication_factor = 3
  partitions         = 1
  config = {
    "max.message.bytes" = "15728640"
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "event_music_event_social_media" {
  name               = "event.musicEvent.socialMedia"
  replication_factor = 3
  partitions         = 1
  config = {
    "max.message.bytes" = "15728640"
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "event_snowflake_globalsoundrecording_releasedate" {
  name               = "event.snowflake.globalsoundrecording.releasedate"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "event_snowflake_newmusicfriday_newtrack" {
  name               = "event.snowflake.newmusicfriday.newtrack"
  replication_factor = var.kafka_default_replication_factor
  partitions         = 1
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "dlq_event_snowflake_newmusicfriday_newtrack" {
  name               = "dlq.event.snowflake.newmusicfriday.newtrack"
  replication_factor = var.kafka_default_replication_factor
  partitions         = 1
  config = {
    "retention.ms" = "-1"
  }
}

resource "kafka_topic" "dlq_event_snowflake_globalsoundrecording_releasedate" {
  name               = "dlq.event.snowflake.globalsoundrecording.releasedate"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms" = "-1"
  }
}

resource "kafka_topic" "event_snowflake_released_content" {
  name               = "event.snowflake.releasedContent"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms" = "604800000"
  }
}

resource "kafka_topic" "dlq_event_snowflake_released_content" {
  name               = "dlq.event.snowflake.releasedContent"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms" = "-1"
  }
}

resource "kafka_topic" "event_snowflake_spotify_artist_label_participant_ai_matching" {
  name               = "event.snowflake.spotifyArtistLabelParticipantAIMatching"
  replication_factor = var.kafka_minimum_replication_factor
  partitions         = 1
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "dlq_event_snowflake_spotify_artist_label_participant_ai_matching" {
  name               = "dlq.event.snowflake.spotifyArtistLabelParticipantAIMatching"
  replication_factor = var.kafka_minimum_replication_factor
  partitions         = 1
  config = {
    "retention.ms" = "-1"
  }
}

resource "kafka_topic" "stream_aAndR_artistTracking_avro" {
  name               = "stream.aAndR.artistTracking.avro"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "event_publishing_fileingestion" {
  name               = "event.publishing.fileIngestion"
  replication_factor = 3
  partitions         = 1
  config = {
    "max.message.bytes" = "15728640"
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "event_orchardSoundRecording_delivery" {
  name               = "event.orchardSoundRecording.delivery"
  replication_factor = 3
  partitions         = 1
  config = {
    "max.message.bytes" = "15728640"
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "event_orchard_sound_recording_fingerprint_rules" {
  name               = "event.orchardSoundRecording.fingerprintRules"
  replication_factor = 3
  partitions         = 1
  config = {
    "max.message.bytes" = "15728640"
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "event_marketing_registration" {
  name               = "event.marketing.registration"
  replication_factor = 3
  partitions         = 1
  config = {
    "max.message.bytes" = "15728640"
    "retention.ms"      = "604800000"
  }
}

resource "kafka_topic" "event_ows_product_digital_product" {
  name               = "event.owsProductDigital.product"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "stream_owsAssets_assetFinal" {
  name               = "stream.owsAssets.assetFinal"
  replication_factor = 3
  partitions         = 1
  config = {
    "cleanup.policy" = "compact"
  }
}

resource "kafka_topic" "stream_ows_assets_asset_upload" {
  name               = "stream.owsAssets.assetUpload"
  replication_factor = 3
  partitions         = 1
  config = {
    "cleanup.policy" = "compact"
  }
}

resource "kafka_topic" "stream_globalParticipant_elasticSearch_cdc_partitioned_v03" {
  name               = "stream.globalParticipant.elasticSearch.cdc.partitioned.v03"
  replication_factor = 3
  partitions         = 9
  config = {
    "cleanup.policy"        = "compact"
    "delete.retention.ms"   = "2419200000" # 4 weeks
    "min.compaction.lag.ms" = "604800000"  # 1 week
  }
}

resource "kafka_topic" "stream_globalParticipant_elasticSearch_cdcDelete_partitioned_v03" {
  name               = "stream.globalParticipant.elasticSearch.cdcDelete.partitioned.v03"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms" = "7200000"
  }
}

resource "kafka_topic" "stream_globalParticipant_elasticSearch_dbtAnalytics_split_v04" {
  name               = "stream.globalParticipant.elasticSearch.dbtAnalytics.split.v04"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms"      = "7200000"
    "max.message.bytes" = "15728640"
  }
}

resource "kafka_topic" "stream_globalParticipant_elasticSearch_dbtAnalytics_partitioned_v04" {
  name               = "stream.globalParticipant.elasticSearch.dbtAnalytics.partitioned.v04"
  replication_factor = 3
  partitions         = 3
  config = {
    "max.message.bytes" = "15728640"
    "cleanup.policy"        = "compact"
    "delete.retention.ms"   = "2419200000" # 4 weeks
    "min.compaction.lag.ms" = "604800000"  # 1 week

  }
}

resource "kafka_topic" "stream_globalSoundRecording_elasticSearch_cdc_partitioned_v03" {
  name               = "stream.globalSoundRecording.elasticSearch.cdc.partitioned.v03"
  replication_factor = 3
  partitions         = 9
  config = {
    "cleanup.policy"        = "compact"
    "delete.retention.ms"   = "2419200000" # 4 weeks
    "min.compaction.lag.ms" = "604800000"  # 1 week
  }
}

resource "kafka_topic" "stream_globalSoundRecording_elasticSearch_cdcDelete_partitioned_v03" {
  name               = "stream.globalSoundRecording.elasticSearch.cdcDelete.partitioned.v03"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms" = "7200000"
  }
}

resource "kafka_topic" "stream_globalSoundRecording_elasticSearch_dbtAnalytics_split_v04" {
  name               = "stream.globalSoundRecording.elasticSearch.dbtAnalytics.split.v04"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "7200000"
  }
}

resource "kafka_topic" "stream_globalSoundRecording_elasticSearch_dbtAnalytics_partitioned_v04" {
  name               = "stream.globalSoundRecording.elasticSearch.dbtAnalytics.partitioned.v04"
  replication_factor = 3
  partitions         = 3
  config = {
    "cleanup.policy"        = "compact"
    "delete.retention.ms"   = "2419200000" # 4 weeks
    "min.compaction.lag.ms" = "604800000"  # 1 week
  }
}

resource "kafka_topic" "topic_musicgraph_label_participant_elasticsearch_v02" {
  name               = "topic.musicGraph.labelParticipant.elasticSearch.v02"
  replication_factor = 3
  partitions         = 9
  config = {
    "max.message.bytes" = "15728640"
    "cleanup.policy"        = "compact"
    "delete.retention.ms"   = "2419200000" # 4 weeks
    "min.compaction.lag.ms" = "604800000"  # 1 week
  }
}

resource "kafka_topic" "topic_musicgraph_delete_label_participant_elasticsearch_v02" {
  name               = "topic.musicGraph.delete.labelParticipant.elasticSearch.v02"
  replication_factor = 3
  partitions         = 1
  config = {
    "max.message.bytes" = "15728640"
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "cdc_ows_assets_asset_final" {
  name               = "cdc.owsAssets.assetFinal"
  replication_factor = 3
  partitions         = 1
  config = {
    "cleanup.policy" = "compact"
  }
}

resource "kafka_topic" "cdc_ows_assets_asset_upload" {
  name               = "cdc.owsAssets.assetUpload"
  replication_factor = 3
  partitions         = 1
  config = {
    "cleanup.policy" = "compact"
  }
}

resource "kafka_topic" "dlq_owsassets_neo4jsink_orchardasset" {
  name               = "dlq.owsAssets.neo4jSink.orchardAsset"
  replication_factor = 3
  partitions         = 1
  config = {
    "cleanup.policy" = "delete"
    "retention.ms"   = "-1"
  }
}

# GraphQL Subscription Producer Topics
resource "kafka_topic" "graphql_subscription_abacus_account_payee_payoneer_status_updated" {
  name               = "graphql.subscription.abacusAccountPayeePayoneerStatusUpdated"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "graphql_subscription_abacus_account_payee_payoneer_released" {
  name               = "graphql.subscription.abacusAccountPayeePayoneerReleased"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "graphql_subscription_abacus_account_payee_payoneer_oauth_completed" {
  name               = "graphql.subscription.abacusAccountPayeePayoneerOAuthCompleted"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "graphql_subscription_abacus_account_payee_payoneer_details_changed" {
  name               = "graphql.subscription.abacusAccountPayeePayoneerDetailsChanged"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "graphql_subscription_abacus_account_payee_payoneer_bank_details_changed" {
  name               = "graphql.subscription.abacusAccountPayeePayoneerBankDetailsChanged"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "graphql_subscription_abacus_account_payee_vat_info_saved" {
  name               = "graphql.subscription.abacusAccountPayeeVATInfoSaved"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "graphql_subscription_abacus_account_payee_payoneer_wform_collected" {
  name               = "graphql.subscription.abacusAccountPayeePayoneerWFormCollected"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "graphql_subscription_abacus_account_payee_created" {
  name               = "graphql.subscription.abacusAccountPayeeCreated"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "graphql_subscription_abacus_account_tax_info_updated" {
  name               = "graphql.subscription.abacusAccountTaxInfoUpdated"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "graphql_subscription_abacus_account_payee_resync_payment_readiness" {
  name               = "graphql.subscription.abacusAccountPayeeResyncPaymentReadiness"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}


# GraphQL Kafka Subscription topic
resource "kafka_topic" "graphql_subscriptions" {
  name               = "graphql.subscriptions"
  replication_factor = 3
  partitions         = 1
  config = {
    "cleanup.policy" = "compact"
  }
}

# GraphQL Kafka Client Subscription Topics
resource "kafka_topic" "graphql_output_lambda_documents_evaluate_payment_eligibility" {
  name               = "graphql.output.lambda-documents-evaluate-payment-eligibility"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "graphql_output_lambda_documents_evaluate_tax_eligibility" {
  name               = "graphql.output.lambda-documents-evaluate-tax-eligibility"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "graphql_output_lambda_documents_update_payee_info" {
  name               = "graphql.output.lambda-documents-update-payee-info"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "cdc_store_api_request_spotify" {
  name               = "cdc.storeAPIRequest.spotify"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "stream_store_api_request_spotify_split" {
  name               = "stream.storeAPIRequest.spotify.split"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}


resource "kafka_topic" "event_spotify_api_album_search_by_upc" {
  name               = "event.spotifyapi.album"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "event_spotify_api_album_artist" {
  name               = "event.spotifyapi.album.artist"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "event_spotify_api_track_artist" {
  name               = "event.spotifyapi.track.artist"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "event_spotify_api_track" {
  name               = "event.spotifyapi.track"
  replication_factor = var.kafka_minimum_replication_factor
  partitions         = 1
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "event_spotify_api_audio_features" {
  name               = "event.spotifyapi.audioFeatures"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "event_spotifyapi_audiofeatures_missing" {
  name               = "event.spotifyapi.audioFeatures.missing"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "cdc_store_api_request_apple_music" {
  name               = "cdc.storeAPIRequest.appleMusic"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
    "max.message.bytes" = "5242940" # 5MB
  }
}

resource "kafka_topic" "stream_store_api_request_apple_music_split" {
  name               = "stream.storeAPIRequest.appleMusic.split"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "event_apple_music_api_album_artist" {
  name               = "event.applemusicapi.album.artist"
  replication_factor = 3
  partitions         = 1
  config = {
    "retention.ms"      = "86400000"
  }
}

resource "kafka_topic" "stream_asset_mezzanine_audio_flac" {
  name               = "stream.asset.mezzanine.audio.flac"
  replication_factor = 3
  partitions         = 30
  config = {
    "retention.ms" = "604800000"
  }
}

resource "kafka_topic" "stream_asset_mezzanine_audio_wav" {
  name               = "stream.asset.mezzanine.audio.wav"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "604800000"
  }
}

resource "kafka_topic" "stream_asset_mezzanine_coverart" {
  name               = "stream.asset.mezzanine.coverart"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "604800000"
  }
}

resource "kafka_topic" "stream_asset_final_acoustic_brainz_backfill" {
  name               = "stream.assetFinal.acousticBrainz.backfill"
  replication_factor = 3
  partitions         = 150
  config = {
    "retention.ms"      = "604800000"
  }
}

resource "kafka_topic" "stream_acoustic_brainz_audio_features" {
  name               = "stream.acousticBrainz.audioFeatures"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms"      = "604800000"
  }
}

resource "kafka_topic" "dlq_snowflake_sink_no_gsr" {
  name               = "dlq.snowflakeSink.noGSR"
  replication_factor = 3
  partitions         = 1
  config = {
    "cleanup.policy" = "delete"
    "retention.ms"   = "-1"
  }
}

resource "kafka_topic" "cdc_artRelations_track" {
  name               = "cdc.artRelations.track"
  partitions         = 1
  replication_factor = 3
  config = {
    "compression.type"               = "producer"
    "min.insync.replicas"            = "2"
    "cleanup.policy"                 = "delete"
    "segment.bytes"                  = "1073741824"
    "retention.ms"                   = "604800000"
    "max.compaction.lag.ms"          = "9223372036854775807"
    "file.delete.delay.ms"           = "60000"
    "max.message.bytes"              = "1048588"
    "message.timestamp.type"         = "CreateTime"
    "unclean.leader.election.enable" = "false"
    "retention.bytes"                = "-1"
    "delete.retention.ms"            = "86400000"
    "segment.ms"                     = "604800000"
  }
}

resource "kafka_topic" "cdc_artRelations_releases" {
  name               = "cdc.artRelations.releases"
  partitions         = 1
  replication_factor = 3
  config = {
    "compression.type"               = "producer"
    "min.insync.replicas"            = "2"
    "cleanup.policy"                 = "delete"
    "segment.bytes"                  = "1073741824"
    "retention.ms"                   = "604800000"
    "max.compaction.lag.ms"          = "9223372036854775807"
    "file.delete.delay.ms"           = "60000"
    "max.message.bytes"              = "1048588"
    "message.timestamp.type"         = "CreateTime"
    "unclean.leader.election.enable" = "false"
    "retention.bytes"                = "-1"
    "delete.retention.ms"            = "86400000"
    "segment.ms"                     = "604800000"
  }
}

resource "kafka_topic" "cdc_artRelations_vendor" {
  name               = "cdc.artRelations.vendor"
  partitions         = 1
  replication_factor = 3
  config = {
    "compression.type"               = "producer"
    "min.insync.replicas"            = "2"
    "cleanup.policy"                 = "delete"
    "segment.bytes"                  = "1073741824"
    "retention.ms"                   = "604800000"
    "max.compaction.lag.ms"          = "9223372036854775807"
    "file.delete.delay.ms"           = "60000"
    "max.message.bytes"              = "1048588"
    "message.timestamp.type"         = "CreateTime"
    "unclean.leader.election.enable" = "false"
    "retention.bytes"                = "-1"
    "delete.retention.ms"            = "86400000"
    "segment.ms"                     = "604800000"
  }
}

resource "kafka_topic" "cdc_art_relations_vendor_restricted_features" {
  name               = "cdc.artRelations.vendorRestrictedFeatures"
  partitions         = 1
  replication_factor = 3
  config = {
    "compression.type"               = "producer"
    "min.insync.replicas"            = "2"
    "cleanup.policy"                 = "delete"
    "segment.bytes"                  = "1073741824"
    "retention.ms"                   = "604800000"
    "max.compaction.lag.ms"          = "9223372036854775807"
    "file.delete.delay.ms"           = "60000"
    "max.message.bytes"              = "1048588"
    "message.timestamp.type"         = "CreateTime"
    "unclean.leader.election.enable" = "false"
    "retention.bytes"                = "-1"
    "delete.retention.ms"            = "86400000"
    "segment.ms"                     = "604800000"
  }
}

resource "kafka_topic" "cdc_art_relations_company_brand" {
  name               = "cdc.artRelations.companyBrand"
  partitions         = 1
  replication_factor = 3
  config = {
    "compression.type"               = "producer"
    "min.insync.replicas"            = "2"
    "cleanup.policy"                 = "compact"
    "segment.bytes"                  = "1073741824"
    "min.compaction.lag.ms"          = "604800000"
    "max.compaction.lag.ms"          = "9223372036854775807"
    "file.delete.delay.ms"           = "60000"
    "max.message.bytes"              = "1048588"
    "message.timestamp.type"         = "CreateTime"
    "unclean.leader.election.enable" = "false"
    "retention.bytes"                = "-1"
    "delete.retention.ms"            = "2419200000"
    "segment.ms"                     = "604800000"
  }
}

resource "kafka_topic" "cdc_art_relations_subaccount_territory_restriction" {
  name               = "cdc.artRelations.subaccountTerritoryRestriction"
  partitions         = 1
  replication_factor = 3
  config = {
    "compression.type"               = "producer"
    "min.insync.replicas"            = "2"
    "cleanup.policy"                 = "delete"
    "segment.bytes"                  = "1073741824"
    "retention.ms"                   = "604800000"
    "max.compaction.lag.ms"          = "9223372036854775807"
    "file.delete.delay.ms"           = "60000"
    "max.message.bytes"              = "1048588"
    "message.timestamp.type"         = "CreateTime"
    "unclean.leader.election.enable" = "false"
    "retention.bytes"                = "-1"
    "delete.retention.ms"            = "86400000"
    "segment.ms"                     = "604800000"
  }
}

resource "kafka_topic" "event_payee_program_move" {
  name               = "event.payee.programMove"
  replication_factor = 3
  partitions         = 3
  config = {
    "retention.ms" = "86400000"
  }
}

resource "kafka_topic" "cdc_art_relations_release_artist" {
  name               = "cdc.artRelations.releaseArtist"
  partitions         = 1
  replication_factor = 3
  config = {
    "compression.type"               = "producer"
    "min.insync.replicas"            = "2"
    "cleanup.policy"                 = "delete"
    "segment.bytes"                  = "1073741824"
    "retention.ms"                   = "604800000"
    "max.compaction.lag.ms"          = "9223372036854775807"
    "file.delete.delay.ms"           = "60000"
    "max.message.bytes"              = "1048588"
    "message.timestamp.type"         = "CreateTime"
    "unclean.leader.election.enable" = "false"
    "retention.bytes"                = "-1"
    "delete.retention.ms"            = "86400000"
    "segment.ms"                     = "604800000"
  }
}

resource "kafka_topic" "cdc_art_relations_track_artist" {
  name               = "cdc.artRelations.trackArtist"
  partitions         = 1
  replication_factor = 3
  config = {
    "compression.type"               = "producer"
    "min.insync.replicas"            = "2"
    "cleanup.policy"                 = "delete"
    "segment.bytes"                  = "1073741824"
    "retention.ms"                   = "604800000"
    "max.compaction.lag.ms"          = "9223372036854775807"
    "file.delete.delay.ms"           = "60000"
    "max.message.bytes"              = "1048588"
    "message.timestamp.type"         = "CreateTime"
    "unclean.leader.election.enable" = "false"
    "retention.bytes"                = "-1"
    "delete.retention.ms"            = "86400000"
    "segment.ms"                     = "604800000"
  }
}

