For example, there are many JSON files in the path
./test1.json
./test2.json
./test3.json
...
I want to create multiple tasks with different ids
resource "aws_dms_replication_task" "test1" {
replication_task_id = "test-dms-replication-task-tf-test1"
table_mappings = file("${path.module}/test1.json")
source_endpoint_arn = aws_dms_endpoint.test-dms-source-endpoint-tf.endpoint_arn
target_endpoint_arn = aws_dms_endpoint.test-dms-target-endpoint-tf.endpoint_arn
}
resource "aws_dms_replication_task" "test2" {
replication_task_id = "test-dms-replication-task-tf-test2"
table_mappings = file("${path.module}/test2.json")
source_endpoint_arn = aws_dms_endpoint.test-dms-source-endpoint-tf.endpoint_arn
target_endpoint_arn = aws_dms_endpoint.test-dms-target-endpoint-tf.endpoint_arn
}
...
Put them into one resource, is there a way to use for_each?