Terraform Module: Event-Driven batch Dataflow that imports data from Cloud Storage (GCS) to Cloud Spanner
This Terraform module sets up a workflow where files stored in Cloud Storage trigger events in Eventarc, which then processes the files and stores the data in Spanner.
- File is stored in Cloud Storage
- Receive event from Eventarc
- If the received file is
spanner-export.json
- Get Cloud API access token and
- POST to Dataflow creation API
- Read the
.avro
file in the same hierarchy as thespanner-export.json
file and store it in Spanner
{
"tables": [
{
"name": "TableName",
"dataFiles": [
"TableName-000000000000.avro",
"TableName-000000000001.avro",
"TableName-[0-9]{12}.avro"
]
}
],
"dialect":"GOOGLE_STANDARD_SQL"
}