Skip to content

feat: Add GCP restore job support (VM, Disk, Cloud SQL, Cloud Storage, BigQuery)#63

Merged
oryanomer1 merged 7 commits intomainfrom
feat/gcp-bigquery-restore-support
Feb 23, 2026
Merged

feat: Add GCP restore job support (VM, Disk, Cloud SQL, Cloud Storage, BigQuery)#63
oryanomer1 merged 7 commits intomainfrom
feat/gcp-bigquery-restore-support

Conversation

@oryanomer1
Copy link
Copy Markdown
Contributor

@oryanomer1 oryanomer1 commented Feb 19, 2026

Summary

Adds GCP restore job support to the eon_restore_job resource, covering all GCP resource types.

New GCP Restore Types

Resource Type restore_type Config Block Description
GCP_COMPUTE_ENGINE_INSTANCE full gcp_vm_config Full VM instance restore with disks
GCP_COMPUTE_ENGINE_INSTANCE partial gcp_disk_config Single disk restore from a VM
GCP_DISK any gcp_disk_config Standalone disk restore
GCP_CLOUD_SQL_INSTANCE full gcp_cloud_sql_config Cloud SQL instance restore
GCP_CLOUD_STORAGE_BUCKET full gcs_bucket_config Full bucket restore
GCP_CLOUD_STORAGE_BUCKET partial gcs_file_config Individual file/directory restore
GCP_BIG_QUERY full gcp_bigquery_restore_dataset_config BigQuery dataset restore with optional table filter

Changes

internal/provider/restore_job_resource.go

  • Added GCP config structs: GcpVmRestoreConfig, GcpDiskRestoreConfig, GcpCloudSqlRestoreConfig, GcsBucketRestoreConfig, GcsFileRestoreConfig, GcpBigQueryDatasetRestoreConfig
  • Added schema blocks for all GCP restore types
  • Added switch cases for GCP_COMPUTE_ENGINE_INSTANCE, GCP_DISK, GCP_CLOUD_SQL_INSTANCE, GCP_CLOUD_STORAGE_BUCKET, GCP_BIG_QUERY
  • Added create methods for each GCP restore type

internal/client/client.go

  • Added StartGcpVmInstanceRestore, StartGcpDiskRestore, StartGcpCloudSqlRestore using SDK methods
  • Added StartBigQueryDatasetRestore with custom HTTP call to restore-bigquery-dataset endpoint (SDK doesn't have this method yet)
  • Added BigQueryRestoreRequest/BigQueryRestoreDestination/BigQueryRestoreResponse types

internal/provider/resource_vault.go

  • Added validation to reject aws_kms_key_arn when cloud_provider is not AWS

Other

  • Upgraded eon-sdk-go v1.88.0 → v1.89.0
  • Updated examples with all GCP restore types
  • Auto-generated docs

Testing

  • BigQuery dataset restore tested end-to-end against reznik-testing environment
  • Restore job successfully created and completed via restore-bigquery-dataset API endpoint

Open with Devin

…, BigQuery)

- Add GCP Compute Engine instance restore (full) via gcp_vm_config
- Add GCP Disk restore (partial) via gcp_disk_config
- Add GCP Cloud SQL restore via gcp_cloud_sql_config
- Add GCS bucket/file restore via gcs_bucket_config / gcs_file_config
- Add BigQuery dataset restore via gcp_bigquery_restore_dataset_config
  with optional table filtering
- Add BigQuery restore client method with custom HTTP call to
  restore-bigquery-dataset endpoint
- Add GCP client methods: StartGcpVmInstanceRestore,
  StartGcpDiskRestore, StartGcpCloudSqlRestore
- Add vault validation: reject aws_kms_key_arn for non-AWS providers
- Upgrade eon-sdk-go v1.88.0 -> v1.89.0
- Update examples and auto-generated docs
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 6 additional findings in Devin Review.

Open in Devin Review

- Extract parseMapAttribute helper to deduplicate tag/label parsing
- Rename S3FileParam → FileRestoreParam (shared by S3, GCS, BigQuery)
- Mark required GCP fields as Required in schema (zone, name, etc.)
  so Terraform fails on plan, not apply
- Remove redundant runtime validations for schema-enforced fields
Terraform enforces Required attributes across ALL resources of a type,
even when the containing SingleNestedBlock is absent. This caused
'Missing Configuration for Required Attribute' errors when e.g. a
BigQuery restore resource didn't specify gcp_vm_config.dataset_id.

Reverted to Optional with runtime validation in create methods.
@oryanomer1 oryanomer1 merged commit d19c757 into main Feb 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants