pub struct Postgres {
pub id: String,
pub version: String,
pub cpu: Option<String>,
pub memory: Option<String>,
pub storage: String,
pub high_availability: bool,
pub encryption_key: Option<ResourceRef>,
pub backend: Option<PostgresBackend>,
}Expand description
A managed PostgreSQL database. The target platform decides the backend (AWS Aurora Serverless v2, GCP Cloud SQL, Azure Flexible Server, or an embedded native process on Local); the database is never publicly reachable.
Fields§
§id: String§version: StringMajor engine version: “15” | “16” | “17”. Default “17”.
cpu: Option<String>Requested vCPUs (e.g. “0.5”, “2”). None = smallest available tier.
memory: Option<String>Requested memory (e.g. “1Gi”, “8Gi”). None = smallest available tier.
storage: StringAllocated storage (e.g. “20Gi”). Default “20Gi”. Grow-only.
high_availability: boolMulti-AZ / regional / zone-redundant high availability. Default false.
encryption_key: Option<ResourceRef>Key used to encrypt database storage, snapshots, and performance data. Cannot be changed after creation.
backend: Option<PostgresBackend>Cloud backend selector; None resolves to the platform default. The field exists so a single per-cloud controller can dispatch on it without a later schema change — the registry allows only one controller per (resource, cloud).
Implementations§
Source§impl Postgres
impl Postgres
Sourcepub fn new(id: String) -> PostgresBuilder
pub fn new(id: String) -> PostgresBuilder
Create an instance of Postgres using the builder syntax
Source§impl Postgres
impl Postgres
Sourcepub const RESOURCE_TYPE: ResourceType
pub const RESOURCE_TYPE: ResourceType
The resource type identifier for Postgres.
Sourcepub fn validate_aurora_availability(&self) -> Result<()>
pub fn validate_aurora_availability(&self) -> Result<()>
Warn about the current single-instance compute topology without rejecting legacy declarations.
Sourcepub fn aurora_parameter_group_family(&self) -> Result<String>
pub fn aurora_parameter_group_family(&self) -> Result<String>
Aurora parameter groups are tied to the engine’s major version, even when a specific minor release is requested.
Sourcepub fn requested_cpu(&self) -> Result<Option<f64>>
pub fn requested_cpu(&self) -> Result<Option<f64>>
Requested positive finite vCPU count, including millicore quantities.
Sourcepub fn requested_memory_gib(&self) -> Result<Option<f64>>
pub fn requested_memory_gib(&self) -> Result<Option<f64>>
Requested memory in GiB. Binary and decimal units retain their meanings; unitless memory retains its historical GiB meaning.
Sourcepub fn requested_storage_gib(&self) -> Result<u64>
pub fn requested_storage_gib(&self) -> Result<u64>
Requested disk size in GiB, rounded up to a whole provider allocation unit.
Sourcepub fn aurora_max_capacity_acu(&self) -> Result<f64>
pub fn aurora_max_capacity_acu(&self) -> Result<f64>
Aurora Serverless v2 ceiling in half-ACU increments (2 GiB per ACU). The supported engine configuration allows up to 256 ACU; never clamp a larger request downward. The minimum ceiling is 1 ACU. An unspecified ceiling remains 2 ACU.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Postgres
impl<'de> Deserialize<'de> for Postgres
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Postgres
Source§impl ResourceDefinition for Postgres
impl ResourceDefinition for Postgres
Source§fn get_resource_type(&self) -> ResourceType
fn get_resource_type(&self) -> ResourceType
Source§fn replace_after_failed_create_is_safe(&self) -> bool
fn replace_after_failed_create_is_safe(&self) -> bool
Source§fn get_dependencies(&self) -> Vec<ResourceRef>
fn get_dependencies(&self) -> Vec<ResourceRef>
Source§fn validate_update(&self, new_config: &dyn ResourceDefinition) -> Result<()>
fn validate_update(&self, new_config: &dyn ResourceDefinition) -> Result<()>
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Source§fn box_clone(&self) -> Box<dyn ResourceDefinition>
fn box_clone(&self) -> Box<dyn ResourceDefinition>
Source§fn resource_eq(&self, other: &dyn ResourceDefinition) -> bool
fn resource_eq(&self, other: &dyn ResourceDefinition) -> bool
Source§fn to_json_value(&self) -> Result<Value>
fn to_json_value(&self) -> Result<Value>
impl StructuralPartialEq for Postgres
Auto Trait Implementations§
impl Freeze for Postgres
impl RefUnwindSafe for Postgres
impl Send for Postgres
impl Sync for Postgres
impl Unpin for Postgres
impl UnsafeUnpin for Postgres
impl UnwindSafe for Postgres
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.