Random_integer result should be loop for dynamic block inside a single resource

resource “aws_s3” “replication” {

dynamic “replication_configuration” {

for_each = ( local.data_replication)

content {

  role = aws_iam_role.s3-replication-role[0].arn

    rules {

      priority = local.random_integer.result #its generating single integer for all the rules in this loop

      id     = "Replication for bucket"

      status = "Enabled"

      destination {

        account_id    = local.data_replication

        bucket        = "arn:aws:s3:::****"

        storage_class = "STANDARD"

        access_control_translation {

          owner = "Destination"

        }

      }

      filter {

         prefix = """"

                  }

    }}