Skip to content

Add dead-letter queues, cost simulation, and serverless triggers - #5

Merged
NitinKumar004 merged 1 commit into
developmentfrom
feature/dlq-cost-triggers
Mar 15, 2026
Merged

Add dead-letter queues, cost simulation, and serverless triggers#5
NitinKumar004 merged 1 commit into
developmentfrom
feature/dlq-cost-triggers

Conversation

@NitinKumar004

Copy link
Copy Markdown
Collaborator

Summary

  • Dead-Letter Queues: SQS, Service Bus, and Pub/Sub now support DLQ with configurable MaxReceiveCount. Messages that exceed the receive limit are automatically moved to the target DLQ.
  • Cost Simulation: New cost/ package with Tracker that simulates cloud billing — default rates for all services, custom rate overrides, cost breakdown by service/operation.
  • Serverless Triggers: SetTrigger() on all 3 queue mocks (SQS→Lambda, ServiceBus→Azure Functions, PubSub→Cloud Functions). Messages sent to a queue automatically invoke the registered function.

Files Changed

  • messagequeue/driver/driver.go — added DeadLetterConfig to QueueConfig
  • providers/aws/sqs/sqs.go — DLQ, receive count tracking, Lambda triggers
  • providers/azure/servicebus/servicebus.go — DLQ, receive count tracking, Function triggers
  • providers/gcp/pubsub/pubsub.go — DLQ, receive count tracking, Cloud Function triggers
  • cost/cost.go — new cost simulation package
  • cloudemu_test.go — 11 new tests (32 total)

Test plan

  • TestDeadLetterQueue — AWS SQS DLQ with maxReceiveCount=2
  • TestDeadLetterQueueAzure — Azure Service Bus DLQ
  • TestDeadLetterQueueGCP — GCP Pub/Sub DLQ
  • TestCostTracker — cost tracking across multiple services
  • TestCostTrackerCustomRates — custom rate overrides
  • TestCostTrackerReset — reset clears all costs
  • TestLambdaSQSTrigger — SQS→Lambda auto-invocation
  • TestLambdaSQSTriggerRemove — trigger removal works
  • TestAzureFunctionServiceBusTrigger — ServiceBus→Azure Function
  • TestGCPCloudFunctionPubSubTrigger — PubSub→Cloud Function
  • All 32 tests passing, go vet clean

- DLQ support for SQS, Service Bus, and Pub/Sub with configurable max receive count
- New cost/ package for simulated cloud billing with default rates and custom overrides
- Lambda/Function triggers on message queues across all 3 providers
- 11 new tests (32 total), all passing
@NitinKumar004 NitinKumar004 self-assigned this Mar 15, 2026
@NitinKumar004
NitinKumar004 merged commit 5c2a86d into development Mar 15, 2026
@NitinKumar004
NitinKumar004 deleted the feature/dlq-cost-triggers branch April 30, 2026 18:17
thzgajendra added a commit to thzgajendra/cloudemu that referenced this pull request Jul 29, 2026
Address review MEDIUM stackshy#5. Databases now carry an ElasticPoolID (added to the
shared InstanceConfig/Instance/ModifyInstanceInput and surfaced as the
elasticPoolId ARM database property), so an SDK client placing a database into a
pool round-trips instead of silently dropping it. DeleteElasticPool now returns
a precondition error while the pool still contains databases, matching real
Azure's 409. Covered by a membership/delete-guard test.
thzgajendra added a commit that referenced this pull request Jul 30, 2026
…xible Server, Cloud SQL) (#303)

* feat(azure): full parity for Azure MySQL Flexible Server sub-resources

Add databases, firewall rules and server configurations plus the server
failover action to Azure Database for MySQL Flexible Server, bringing it to
native parity with the ARM surface real armmysqlflexibleservers clients use.

Introduce Databases, FirewallRules, Configurations and Failover as optional
relationaldb driver capabilities (mirroring SubnetGroups), so the same
interfaces are reusable by the other managed-SQL services. The mock stores each
family per server and cascade-deletes children on server delete; the ARM handler
routes databases/firewallRules/configurations, updateConfigurations (batch) and
the failover action. Covered by real-SDK round-trip tests and mock-level
error-path/cascade tests.

* feat(azure): full parity for Azure PostgreSQL Flexible Server sub-resources

Add databases, firewall rules and server configurations to Azure Database for
PostgreSQL Flexible Server, reusing the Databases/FirewallRules/Configurations
optional relationaldb capabilities introduced for MySQL Flex. Postgres Flex has
no failover action and no batch-configuration endpoint, and its configuration
resource accepts both PUT and PATCH; the handler and mock reflect that. The mock
cascade-deletes children on server delete. Covered by real-SDK round-trip tests
(the SDK has no ClientFactory, so each client is built from shared options) plus
mock-level default/error/cascade tests.

* feat(azure): full parity for Azure SQL server sub-resources

Add firewall rules, virtual-network rules, elastic pools, failover groups and
the Azure AD administrator to Azure SQL (Microsoft.Sql). Firewall rules reuse
the shared FirewallRules capability; the other four are added as optional
relationaldb capabilities (VNetRules, ElasticPools, FailoverGroups, AADAdmins)
alongside the existing SubnetGroups pattern. Failover-group failover flips the
local replication role between Primary and Secondary. The mock cascade-deletes
all child resources on server delete and returns isolated copies of the
slice-bearing failover-group state. Covered by real-SDK (armsql) round-trip
tests across all five families plus mock-level error/cascade/aliasing tests.

* feat(gcp): full parity for Cloud SQL databases, users, certs and instance ops

Add databases (via the shared Databases capability), users and client SSL certs
as instance child resources, plus the clone, failover, promote-replica and
start/stop-replica instance actions to GCP Cloud SQL. Users and SSL certs are
new optional relationaldb capabilities (Users, SslCerts); clone and replica
promotion are Clonable and ReplicaPromotion; failover reuses the shared Failover
capability. The REST path parser now recognizes the databases/users/sslCerts
sub-collections, and the users route honors Cloud SQL's ?name= query quirk for
delete and update. The mock cascade-deletes children on instance delete. Tiers
and flags catalogs are intentionally out of scope (separate path shapes, static
data). Covered by real sqladmin SDK round-trip tests plus mock-level
clone/cascade/error tests.

* feat(discovery): surface managed SQL servers in Resource Graph and Cloud Asset

Add a RelationalDatabases discovery capability to the resource-discovery engine
and a walkRelationalDB walker, mirroring the Kubernetes adapter pattern. Azure
wires an adapter that projects Azure SQL logical servers plus MySQL/PostgreSQL
Flexible Servers, and GCP projects Cloud SQL instances, so managed relational
databases appear in cross-service inventory. Resource Graph maps the portable
types to microsoft.sql/servers, microsoft.dbformysql/flexibleservers and
microsoft.dbforpostgresql/flexibleservers; Cloud Asset maps Cloud SQL to
sqladmin.googleapis.com/Instance. Both type-map switches become lookup tables to
stay under the cyclomatic-complexity gate. Covered by walker and type-map tests.

* feat(cost): add managed relational-database rates

Add relationaldb:* entries to the cost rate catalog so provisioning a managed
database server/instance (RDS, Azure SQL, Azure MySQL/PostgreSQL Flexible
Server, Cloud SQL) is billed per instance-hour, clusters per cluster-hour, and
restores reuse the instance-hour, while snapshots and lifecycle actions are
free. The portable "relationaldb" service name means one catalog covers every
cloud. Covered by a cost-tracker test.

* docs: document full managed-SQL parity (sub-resources, discovery, cost)

Document the native sub-resource capabilities added to Azure SQL, the Azure
MySQL/PostgreSQL Flexible Servers and Cloud SQL — databases, users, firewall/
vnet rules, configurations, elastic pools, failover groups, AAD admins, SSL
certs, clone/failover/replica actions — along with their discovery surfacing and
cost rates. Refresh the relational-database operation totals and the discovery
driver list.

* feat(sql): Cloud SQL tiers/flags catalogs + elastic-pool metrics

Close the remaining managed-SQL parity gaps: serve the Cloud SQL machine-tier
catalog (GET /v1/projects/{p}/tiers) and the database-flag catalog
(GET /v1/flags, which is project-less) as static reference data, and emit
Microsoft.Sql/servers/elasticpools metrics (cpu/storage/workers percent) when an
Azure SQL elastic pool is created. Also annotate the ModifyInstance/ModifyCluster
methods across the four SQL mocks with the driver-interface hugeParam nolint now
that the shared ModifyInstanceInput grew. Covered by SDK tiers/flags round-trip
and an elastic-pool metric-emission test.

* feat(azure): add SQL Managed Instance family to Azure SQL

Add the Microsoft.Sql/managedInstances resource type and its managed databases
as a ManagedInstances optional relationaldb capability: managed-instance CRUD +
list + start/stop/failover actions, and managed-database CRUD + list. The
handler now matches the managedInstances resource type alongside servers and
routes both, and the mock cascade-deletes managed databases when their instance
is removed. Covered by an armsql managed-instance/database SDK round-trip test
(create → get → list → failover → cascade delete) and a mock-level lifecycle
test.

* docs: document managed instances, tiers/flags and elastic-pool metrics

Update the relational-database section for the now-complete managed-SQL parity:
add the ManagedInstances capability row, note Cloud SQL's tiers/flags reference
catalogs and Azure SQL's Managed Instance family, and record the elastic-pool
metric namespace. Refresh the optional-operation totals (25 capability
interfaces, +109 relational / +118 grand-total optional).

* fix(sql): clone ManagedInstance tags on read; deterministic list ordering

Address review MEDIUM #1 and the list-ordering LOW: GetManagedInstance /
ListManagedInstances now clone the stored Tags map so a caller mutating the
returned map can't corrupt the store (the copy-on-read hole flagged as the
concurrent-map panic class), and every List* mock method iterates
memstore.SortedValues() instead of All() for deterministic SDK list ordering,
matching the documented convention. Large-value list loops use index iteration
to avoid per-element copies.

* fix(azure): real update semantics + discoverable managed instances

Address review MEDIUM #2/#3/#4 (Azure update paths) and #7 (MI discovery):

- PUT on an existing Azure SQL server / database / managed instance now applies
  the request body (upsert) instead of returning the stale record.
- PATCH is a genuine merge — elastic pools, failover groups and managed
  instances gain Update* capability methods that overlay only the fields the
  request supplied, so a partial PATCH no longer wipes unspecified fields; MI
  PATCH now decodes and applies its body instead of being a no-op.
- Managed instances are projected into cross-service discovery
  (microsoft.sql/managedinstances) via sqlDiscovery + the Resource Graph type
  map, so a created MI appears in inventory.

Covered by SDK PATCH-merge round-trip tests (elastic pool keeps its SKU when
only maxSizeBytes is patched; MI keeps administratorLogin when only vCores is
patched) and a managed-instance type-map test.

* fix(azure): model Azure SQL database elastic-pool membership

Address review MEDIUM #5. Databases now carry an ElasticPoolID (added to the
shared InstanceConfig/Instance/ModifyInstanceInput and surfaced as the
elasticPoolId ARM database property), so an SDK client placing a database into a
pool round-trips instead of silently dropping it. DeleteElasticPool now returns
a precondition error while the pool still contains databases, matching real
Azure's 409. Covered by a membership/delete-guard test.

* fix(gcp): real Cloud SQL read-replica and failover semantics

Address review MEDIUM #6. A Cloud SQL insert with masterInstanceName now creates
an actual read replica: the replica records its master (ReadReplicaSource) and
the primary lists it (replicaNames), both surfaced in the instance body. Replica
lifecycle is faithful — start/stopReplica require the target to be a replica and
leave it RUNNABLE (no SUSPENDED state change); promoteReplica detaches it from
the primary (and rejects a non-replica); failover is a primary-only operation
and rejects a replica. Covered by SDK and mock replica-lifecycle tests.

* fix(sql): review LOW items — determinism, validation, replica fidelity tests

- Cloud SQL backup-run IDs are generated by the mock from the clock + a
  monotonic counter (was time.Now().UnixNano(), violating the Clock determinism
  rule and collision-prone); CloneInstance now clones the source's databases and
  resets replica linkage; UpdateUser doc corrected.
- Firewall rules validate IPv4 start/end (Azure SQL + both Flexible Servers);
  Azure SQL Managed Instance requires subnetId, as real Azure does.
- Added a real-SDK Resource Graph indexing test that drives sqlDiscovery
  end-to-end (logical server + managed instance appear and filter), and a
  -race concurrency test that mutates a returned managed-instance Tags map to
  pin the copy-on-read fix.

* fix(sql): address second review — MI lifecycle, in-place restore, validation

- Cloud SQL DeleteInstance now unlinks replica<->master before cascading
  children, so no dangling ReadReplicaSource/ReadReplicaTargets remain.
- Managed Instance lifecycle gains a state guard (transitionManagedInstance):
  Start/Stop respect current state, Failover requires Ready; MI create emits
  representative metrics and clones returned Tags; adds CreateManagedInstance
  cost rate.
- Cloud SQL RestoreBackup restores in place onto the existing instance via a
  new optional BackupRestorer capability (was create-new -> 409).
- Failover-group failover requires a partner server; firewall rules validate
  Start <= End; Azure Flex SetConfiguration rejects unknown params and empty
  values; ARM parser captures the action verb so forced vs planned failover
  and unknown POST verbs are distinguished; Cloud SQL selfLink/targetLink use
  the served /v1 prefix.
- Broaden new-package test coverage (sub-resource CRUD, MI lifecycle, Users
  update, backup get, error paths, server PATCH, raw MI start/stop).

* fix(sql): address third review — output aliasing, config catalog, validation

- Deep-copy Tags/slice fields on every Instance/Cluster/Snapshot return path in
  azuresql and cloudsql (Describe/Create/Modify/Restore/Clone), so a returned
  value never aliases the memstore — fixes a potential concurrent-map crash and
  matches the managedinstance/FailoverGroup discipline.
- Azure Flex GetConfiguration/ListConfigurations return catalog defaults for a
  known-but-unset parameter (real Azure behavior) instead of NotFound/empty; the
  catalog now maps names to defaults.
- MySQL Flex batch config update is atomic: all entries are validated before any
  is applied, via a new optional BatchConfigurations capability.
- Azure SQL database create/modify validates the referenced elastic pool exists
  (symmetry with the pool-delete member guard).
- Cloud SQL rejects child (database/user) names containing '/' that would orphan
  a row; get-paths add length guards on single-ID Describe lookups.
- Flex firewall create validates start <= end (parity with Azure SQL).
- Tests: aliasing, config defaults, batch atomicity, elastic-pool validation,
  child-name rejection, FG update/list, managed-database delete, and Azure
  wire-level error-mapping (404/400) across all three Azure SQL services.
thzgajendra added a commit that referenced this pull request Jul 31, 2026
* feat(azure): full parity for Azure MySQL Flexible Server sub-resources

Add databases, firewall rules and server configurations plus the server
failover action to Azure Database for MySQL Flexible Server, bringing it to
native parity with the ARM surface real armmysqlflexibleservers clients use.

Introduce Databases, FirewallRules, Configurations and Failover as optional
relationaldb driver capabilities (mirroring SubnetGroups), so the same
interfaces are reusable by the other managed-SQL services. The mock stores each
family per server and cascade-deletes children on server delete; the ARM handler
routes databases/firewallRules/configurations, updateConfigurations (batch) and
the failover action. Covered by real-SDK round-trip tests and mock-level
error-path/cascade tests.

* feat(azure): full parity for Azure PostgreSQL Flexible Server sub-resources

Add databases, firewall rules and server configurations to Azure Database for
PostgreSQL Flexible Server, reusing the Databases/FirewallRules/Configurations
optional relationaldb capabilities introduced for MySQL Flex. Postgres Flex has
no failover action and no batch-configuration endpoint, and its configuration
resource accepts both PUT and PATCH; the handler and mock reflect that. The mock
cascade-deletes children on server delete. Covered by real-SDK round-trip tests
(the SDK has no ClientFactory, so each client is built from shared options) plus
mock-level default/error/cascade tests.

* feat(azure): full parity for Azure SQL server sub-resources

Add firewall rules, virtual-network rules, elastic pools, failover groups and
the Azure AD administrator to Azure SQL (Microsoft.Sql). Firewall rules reuse
the shared FirewallRules capability; the other four are added as optional
relationaldb capabilities (VNetRules, ElasticPools, FailoverGroups, AADAdmins)
alongside the existing SubnetGroups pattern. Failover-group failover flips the
local replication role between Primary and Secondary. The mock cascade-deletes
all child resources on server delete and returns isolated copies of the
slice-bearing failover-group state. Covered by real-SDK (armsql) round-trip
tests across all five families plus mock-level error/cascade/aliasing tests.

* feat(gcp): full parity for Cloud SQL databases, users, certs and instance ops

Add databases (via the shared Databases capability), users and client SSL certs
as instance child resources, plus the clone, failover, promote-replica and
start/stop-replica instance actions to GCP Cloud SQL. Users and SSL certs are
new optional relationaldb capabilities (Users, SslCerts); clone and replica
promotion are Clonable and ReplicaPromotion; failover reuses the shared Failover
capability. The REST path parser now recognizes the databases/users/sslCerts
sub-collections, and the users route honors Cloud SQL's ?name= query quirk for
delete and update. The mock cascade-deletes children on instance delete. Tiers
and flags catalogs are intentionally out of scope (separate path shapes, static
data). Covered by real sqladmin SDK round-trip tests plus mock-level
clone/cascade/error tests.

* feat(discovery): surface managed SQL servers in Resource Graph and Cloud Asset

Add a RelationalDatabases discovery capability to the resource-discovery engine
and a walkRelationalDB walker, mirroring the Kubernetes adapter pattern. Azure
wires an adapter that projects Azure SQL logical servers plus MySQL/PostgreSQL
Flexible Servers, and GCP projects Cloud SQL instances, so managed relational
databases appear in cross-service inventory. Resource Graph maps the portable
types to microsoft.sql/servers, microsoft.dbformysql/flexibleservers and
microsoft.dbforpostgresql/flexibleservers; Cloud Asset maps Cloud SQL to
sqladmin.googleapis.com/Instance. Both type-map switches become lookup tables to
stay under the cyclomatic-complexity gate. Covered by walker and type-map tests.

* feat(cost): add managed relational-database rates

Add relationaldb:* entries to the cost rate catalog so provisioning a managed
database server/instance (RDS, Azure SQL, Azure MySQL/PostgreSQL Flexible
Server, Cloud SQL) is billed per instance-hour, clusters per cluster-hour, and
restores reuse the instance-hour, while snapshots and lifecycle actions are
free. The portable "relationaldb" service name means one catalog covers every
cloud. Covered by a cost-tracker test.

* docs: document full managed-SQL parity (sub-resources, discovery, cost)

Document the native sub-resource capabilities added to Azure SQL, the Azure
MySQL/PostgreSQL Flexible Servers and Cloud SQL — databases, users, firewall/
vnet rules, configurations, elastic pools, failover groups, AAD admins, SSL
certs, clone/failover/replica actions — along with their discovery surfacing and
cost rates. Refresh the relational-database operation totals and the discovery
driver list.

* feat(sql): Cloud SQL tiers/flags catalogs + elastic-pool metrics

Close the remaining managed-SQL parity gaps: serve the Cloud SQL machine-tier
catalog (GET /v1/projects/{p}/tiers) and the database-flag catalog
(GET /v1/flags, which is project-less) as static reference data, and emit
Microsoft.Sql/servers/elasticpools metrics (cpu/storage/workers percent) when an
Azure SQL elastic pool is created. Also annotate the ModifyInstance/ModifyCluster
methods across the four SQL mocks with the driver-interface hugeParam nolint now
that the shared ModifyInstanceInput grew. Covered by SDK tiers/flags round-trip
and an elastic-pool metric-emission test.

* feat(azure): add SQL Managed Instance family to Azure SQL

Add the Microsoft.Sql/managedInstances resource type and its managed databases
as a ManagedInstances optional relationaldb capability: managed-instance CRUD +
list + start/stop/failover actions, and managed-database CRUD + list. The
handler now matches the managedInstances resource type alongside servers and
routes both, and the mock cascade-deletes managed databases when their instance
is removed. Covered by an armsql managed-instance/database SDK round-trip test
(create → get → list → failover → cascade delete) and a mock-level lifecycle
test.

* docs: document managed instances, tiers/flags and elastic-pool metrics

Update the relational-database section for the now-complete managed-SQL parity:
add the ManagedInstances capability row, note Cloud SQL's tiers/flags reference
catalogs and Azure SQL's Managed Instance family, and record the elastic-pool
metric namespace. Refresh the optional-operation totals (25 capability
interfaces, +109 relational / +118 grand-total optional).

* fix(sql): clone ManagedInstance tags on read; deterministic list ordering

Address review MEDIUM #1 and the list-ordering LOW: GetManagedInstance /
ListManagedInstances now clone the stored Tags map so a caller mutating the
returned map can't corrupt the store (the copy-on-read hole flagged as the
concurrent-map panic class), and every List* mock method iterates
memstore.SortedValues() instead of All() for deterministic SDK list ordering,
matching the documented convention. Large-value list loops use index iteration
to avoid per-element copies.

* fix(azure): real update semantics + discoverable managed instances

Address review MEDIUM #2/#3/#4 (Azure update paths) and #7 (MI discovery):

- PUT on an existing Azure SQL server / database / managed instance now applies
  the request body (upsert) instead of returning the stale record.
- PATCH is a genuine merge — elastic pools, failover groups and managed
  instances gain Update* capability methods that overlay only the fields the
  request supplied, so a partial PATCH no longer wipes unspecified fields; MI
  PATCH now decodes and applies its body instead of being a no-op.
- Managed instances are projected into cross-service discovery
  (microsoft.sql/managedinstances) via sqlDiscovery + the Resource Graph type
  map, so a created MI appears in inventory.

Covered by SDK PATCH-merge round-trip tests (elastic pool keeps its SKU when
only maxSizeBytes is patched; MI keeps administratorLogin when only vCores is
patched) and a managed-instance type-map test.

* fix(azure): model Azure SQL database elastic-pool membership

Address review MEDIUM #5. Databases now carry an ElasticPoolID (added to the
shared InstanceConfig/Instance/ModifyInstanceInput and surfaced as the
elasticPoolId ARM database property), so an SDK client placing a database into a
pool round-trips instead of silently dropping it. DeleteElasticPool now returns
a precondition error while the pool still contains databases, matching real
Azure's 409. Covered by a membership/delete-guard test.

* fix(gcp): real Cloud SQL read-replica and failover semantics

Address review MEDIUM #6. A Cloud SQL insert with masterInstanceName now creates
an actual read replica: the replica records its master (ReadReplicaSource) and
the primary lists it (replicaNames), both surfaced in the instance body. Replica
lifecycle is faithful — start/stopReplica require the target to be a replica and
leave it RUNNABLE (no SUSPENDED state change); promoteReplica detaches it from
the primary (and rejects a non-replica); failover is a primary-only operation
and rejects a replica. Covered by SDK and mock replica-lifecycle tests.

* fix(sql): review LOW items — determinism, validation, replica fidelity tests

- Cloud SQL backup-run IDs are generated by the mock from the clock + a
  monotonic counter (was time.Now().UnixNano(), violating the Clock determinism
  rule and collision-prone); CloneInstance now clones the source's databases and
  resets replica linkage; UpdateUser doc corrected.
- Firewall rules validate IPv4 start/end (Azure SQL + both Flexible Servers);
  Azure SQL Managed Instance requires subnetId, as real Azure does.
- Added a real-SDK Resource Graph indexing test that drives sqlDiscovery
  end-to-end (logical server + managed instance appear and filter), and a
  -race concurrency test that mutates a returned managed-instance Tags map to
  pin the copy-on-read fix.

* fix(sql): address second review — MI lifecycle, in-place restore, validation

- Cloud SQL DeleteInstance now unlinks replica<->master before cascading
  children, so no dangling ReadReplicaSource/ReadReplicaTargets remain.
- Managed Instance lifecycle gains a state guard (transitionManagedInstance):
  Start/Stop respect current state, Failover requires Ready; MI create emits
  representative metrics and clones returned Tags; adds CreateManagedInstance
  cost rate.
- Cloud SQL RestoreBackup restores in place onto the existing instance via a
  new optional BackupRestorer capability (was create-new -> 409).
- Failover-group failover requires a partner server; firewall rules validate
  Start <= End; Azure Flex SetConfiguration rejects unknown params and empty
  values; ARM parser captures the action verb so forced vs planned failover
  and unknown POST verbs are distinguished; Cloud SQL selfLink/targetLink use
  the served /v1 prefix.
- Broaden new-package test coverage (sub-resource CRUD, MI lifecycle, Users
  update, backup get, error paths, server PATCH, raw MI start/stop).

* fix(sql): address third review — output aliasing, config catalog, validation

- Deep-copy Tags/slice fields on every Instance/Cluster/Snapshot return path in
  azuresql and cloudsql (Describe/Create/Modify/Restore/Clone), so a returned
  value never aliases the memstore — fixes a potential concurrent-map crash and
  matches the managedinstance/FailoverGroup discipline.
- Azure Flex GetConfiguration/ListConfigurations return catalog defaults for a
  known-but-unset parameter (real Azure behavior) instead of NotFound/empty; the
  catalog now maps names to defaults.
- MySQL Flex batch config update is atomic: all entries are validated before any
  is applied, via a new optional BatchConfigurations capability.
- Azure SQL database create/modify validates the referenced elastic pool exists
  (symmetry with the pool-delete member guard).
- Cloud SQL rejects child (database/user) names containing '/' that would orphan
  a row; get-paths add length guards on single-ID Describe lookups.
- Flex firewall create validates start <= end (parity with Azure SQL).
- Tests: aliasing, config defaults, batch atomicity, elastic-pool validation,
  child-name rejection, FG update/list, managed-database delete, and Azure
  wire-level error-mapping (404/400) across all three Azure SQL services.

* feat(gcp): add AlloyDB full-parity support

Adds GCP AlloyDB as a first-class managed database server, reusing the
relationaldb driver.

- Provider providers/gcp/alloydb: implements RelationalDB (clusters,
  instances, cluster backups→ClusterSnapshot, restore) + Users + Databases,
  plus a new optional rdsdriver.AlloyDB capability for AlloyDB-specific
  behavior — rich cluster/instance create, cross-region secondary + promote,
  instance failover/restart, continuous/automated-backup + maintenance config,
  and *Info accessors. Cloud Monitoring metrics on instance create.
  Copy-on-read (clone Tags/slices), '/'-name and instance-type validation,
  cascade delete, and lifecycle state guards throughout.
- Server server/gcp/alloydb: alloydb.googleapis.com/v1 REST handler
  (clusters[/instances|/users], backups, LRO operations, custom methods
  :promote/:createsecondary/:restore/:failover/:restart) using the SDK types
  for wire fidelity; SDK round-trip + wire-error (404/409/400) tests.
- Wiring: providers/gcp/gcp.go (field, monitoring, combined CloudSQL+AlloyDB
  relational discovery adapter, TypeAlloyDBCluster); server/gcp Drivers gains
  an opt-in AlloyDB field (left nil in DriversFrom — its paths collide with
  GKE's, so the two are mutually exclusive on one server).
- Dedicated AlloyDB cost rates; docs/services.md updated (capabilities, GCP
  column, operation counts).

* fix(gcp): address AlloyDB review comments

- One PRIMARY per cluster enforced (base + native create); SECONDARY instance
  requires a SECONDARY cluster; READ_POOL requires nodeCount > 0.
- Detach dangling SECONDARY links when their PRIMARY cluster is deleted (the
  replica-linkage class from #303).
- FailoverInstance requires a PRIMARY target; RestartInstance stays valid on
  any type.
- UpdateUser is now reachable via Users.Patch (was 405).
- Custom methods (:promote / :failover / :restart) are POST-only and unknown
  verbs 404 instead of misrouting to CRUD; GET on :promote no longer promotes.
- Deterministic list order: DescribeClusters/DescribeInstances use SortedValues.
- patchCluster/patchInstance handle the capability assertion; toWireUser returns
  the full resource path; removed banner comments.
- Wiring: guard New against AlloyDB+GKE both enabled (they share paths) and add
  DriversFromWithAlloyDB helper (enables AlloyDB in place of GKE).
- Tests for every guard + user PATCH + GET-:promote rejection + 400 wire error +
  instance output aliasing.
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.

1 participant