Skip to main content

alien_core/import/data/gcp/
postgres.rs

1use serde::{Deserialize, Serialize};
2
3/// GCP Postgres (Cloud SQL + Private Service Connect) registration data: the handles by
4/// which a setup-created Cloud SQL instance and its PSC consumer endpoint are registered
5/// as a Frozen Postgres resource. Setup owns the instance, Alien refreshes and heartbeats it.
6#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
7#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
8#[cfg_attr(feature = "jsonschema", derive(schemars::JsonSchema))]
9#[serde(rename_all = "camelCase")]
10pub struct GcpPostgresImportData {
11    /// Cloud SQL instance name.
12    pub instance_name: String,
13    /// Default database name.
14    pub database: String,
15    /// Secret Manager secret name of the master password (never the password).
16    pub password_secret_name: String,
17    /// PSC service-attachment URI exposed by the instance.
18    pub psc_service_attachment: String,
19    /// Regional internal address backing the PSC consumer endpoint.
20    pub psc_address_name: String,
21    /// Regional forwarding rule for the PSC consumer endpoint.
22    pub psc_forwarding_rule_name: String,
23    /// PSC consumer endpoint IP (the binding host).
24    pub endpoint_ip: String,
25    /// GCP region.
26    pub region: String,
27    /// Engine version the instance reports.
28    pub database_version: String,
29}