Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7010e07cb0 |
No files matched your search
@@ -1,262 +0,0 @@
|
||||
# How can Home Assistant consume jobs from an external system?
|
||||
|
||||
Research for Gitea issue #47 (part of map #44). Researched 2026-11-23 against
|
||||
current Home Assistant (HA) docs, HA core source (`dev` branch), and RabbitMQ 4.x
|
||||
docs.
|
||||
|
||||
**Question:** What mechanisms does HA offer for receiving or pulling commands
|
||||
from an external system (hAPI in the cloud)? For each one: which side opens the
|
||||
connection, how it authenticates, how reliable it is and how results get
|
||||
acknowledged, and how much maintenance it needs.
|
||||
|
||||
## TL;DR
|
||||
|
||||
- **HA has no AMQP or RabbitMQ integration.** Neither `/integrations/amqp/` nor
|
||||
`/integrations/rabbitmq/` exists, and HA core has no such component. HA's
|
||||
only built-in message-bus client is MQTT.
|
||||
- **The HA MQTT docs say RabbitMQ's MQTT plugin is not supported:**
|
||||
"Neither ActiveMQ MQTT broker nor the RabbitMQ MQTT Plugin are supported, use
|
||||
a known working broker like Mosquitto instead."
|
||||
([HA MQTT](https://www.home-assistant.io/integrations/mqtt/)). Using RabbitMQ
|
||||
as the broker would mean running HA on a configuration it does not support.
|
||||
- **HA's MQTT client always connects with a clean session.** It sets
|
||||
`clean_start=True` on MQTT 5 and `clean_session=True` on 3.1.1
|
||||
([core `mqtt/client.py`](https://github.com/home-assistant/core/blob/dev/homeassistant/components/mqtt/client.py)).
|
||||
So any job published while HA is disconnected is dropped unless it is
|
||||
retained. A broker cannot queue jobs for HA while it is offline, whichever
|
||||
broker is used. MQTT QoS 1 only covers delivery on a live connection.
|
||||
- **None of the built-in options acknowledge at the job level.** For durable
|
||||
jobs, hAPI has to provide the durability: keep a job table in Postgres, and
|
||||
have HA report each result back to hAPI, either by calling hAPI or by
|
||||
returning it on the same call.
|
||||
- **Candidates by direction of connection:**
|
||||
- *HA opens the connection* (no inbound path to the home network needed):
|
||||
MQTT to a broker run by hAPI; REST polling of hAPI plus `rest_command`
|
||||
callbacks; or a custom integration.
|
||||
- *hAPI opens the connection* (needs the private link from #46, or Nabu Casa
|
||||
for webhooks): the WebSocket API, the REST API, or a webhook trigger.
|
||||
|
||||
## Mechanism by mechanism
|
||||
|
||||
### 1. MQTT integration (HA connects out to a broker)
|
||||
|
||||
- **Direction:** HA is the MQTT client. You give it the broker's "hostname
|
||||
(or IP address) and port"
|
||||
([HA MQTT](https://www.home-assistant.io/integrations/mqtt/)). If the broker
|
||||
runs in the cluster, HA connects outbound, so nothing has to accept inbound
|
||||
connections at home.
|
||||
- **Protocol:** "Home Assistant requires that your broker supports MQTT protocol
|
||||
version 5" (same page). Core supports 3.1, 3.1.1, and 5, and defaults to 5
|
||||
(`DEFAULT_PROTOCOL = PROTOCOL_5` in
|
||||
[`mqtt/const.py`](https://github.com/home-assistant/core/blob/dev/homeassistant/components/mqtt/const.py)).
|
||||
- **Auth:** username and password; broker certificate validation (Auto, or
|
||||
Custom with an uploaded CA); and an optional client certificate plus private
|
||||
key for mutual TLS. WebSockets transport is also available, with custom
|
||||
headers. Source: [HA MQTT](https://www.home-assistant.io/integrations/mqtt/).
|
||||
- **Receiving jobs:** the `mqtt` automation trigger fires "when a message is
|
||||
received on an MQTT topic". It has a `qos` option (0, 1, or 2; default 0), and
|
||||
JSON payloads are exposed as `trigger.payload_json`
|
||||
([MQTT trigger](https://www.home-assistant.io/triggers/mqtt/)).
|
||||
- **Returning results:** the `mqtt.publish` action, with `retain` and a
|
||||
templated payload ([HA MQTT](https://www.home-assistant.io/integrations/mqtt/)).
|
||||
A typical setup has HA publish to `hapi/results/<job_id>` or a single results
|
||||
topic.
|
||||
- **Reliability:**
|
||||
- *Clean sessions.* Session data is cleared on every connect (see TL;DR),
|
||||
so the broker does not queue jobs for HA across disconnects. A retained
|
||||
message survives, but the broker keeps only one per topic, which makes it
|
||||
the wrong tool for a queue.
|
||||
- *QoS.* QoS 1 gives at-least-once delivery while HA is connected. Duplicates
|
||||
are possible, so job handlers should be idempotent (key them on `job_id`).
|
||||
- *No job-level ack.* MQTT has no acknowledgement for "the job ran"; HA has to
|
||||
publish a result message for that.
|
||||
- *Liveness.* HA publishes a Birth message (`online`) and a Last Will message
|
||||
(`offline`) on `homeassistant/status`
|
||||
([HA MQTT](https://www.home-assistant.io/integrations/mqtt/)). hAPI can
|
||||
subscribe to know whether HA is connected and hold or fail jobs to match.
|
||||
- **Maintenance:** low on the HA side, since this is a first-class, actively
|
||||
maintained integration. On the cluster side, it means running and securing a
|
||||
broker (for example Mosquitto) with TLS and per-client credentials. The job
|
||||
automations are YAML or UI automations in HA.
|
||||
|
||||
### 1a. RabbitMQ's MQTT plugin as that broker
|
||||
|
||||
- **What RabbitMQ supports:** MQTT 3.1, 3.1.1, and 5.0. QoS 0 and 1 are
|
||||
supported, but QoS 2 is not. An MQTT 5 client that publishes at QoS 2 is
|
||||
disconnected with "reason code `155: QoS not supported`"; 3.x clients are
|
||||
downgraded to QoS 1. MQTT topics are routed through the `amq.topic` exchange,
|
||||
with `/` mapped to `.` and `+` mapped to `*`, so AMQP 0-9-1, AMQP 1.0, and
|
||||
STOMP clients can talk to MQTT clients. Auth options are username and
|
||||
password, or x.509 client certificates via `ssl_cert_login`
|
||||
([RabbitMQ MQTT](https://www.rabbitmq.com/docs/mqtt)).
|
||||
- **Retained-message caveats:** retained messages are stored node-local and not
|
||||
replicated, and "subscriptions using wildcard filters receive no retained
|
||||
messages" (same page).
|
||||
- **HA's position:** HA marks the plugin as not supported (quoted in the
|
||||
TL;DR). The HA page gives a reason only for ActiveMQ (retention bugs).
|
||||
*Inference:* the RabbitMQ wildcard limitation is probably the reason, because
|
||||
HA's MQTT discovery subscribes with wildcards and depends on retained config
|
||||
messages. hAPI jobs on fixed topics with no discovery might work, but nobody
|
||||
would support or test that setup, and the clean-session limit still applies.
|
||||
- **What RabbitMQ would add:** hAPI could use AMQP queues on the cloud side for
|
||||
its own durability and routing, bridging to HA over MQTT. That adds little
|
||||
over a Postgres job table plus Mosquitto, and it costs running RabbitMQ
|
||||
itself.
|
||||
|
||||
### 2. AMQP
|
||||
|
||||
- **No built-in integration.** HA's docs have no AMQP or RabbitMQ page (both
|
||||
URLs return 404), and HA core has no `amqp` or `rabbitmq` component (checked
|
||||
against the GitHub contents API for `homeassistant/components`).
|
||||
- **Only route:** a custom integration that embeds an AMQP client (see section
|
||||
6). The custom integration would own every reliability property: durable
|
||||
queues, manual acks after the HA action completes, and reconnects.
|
||||
|
||||
### 3. REST API (hAPI calls HA)
|
||||
|
||||
- **Direction:** inbound to HA at `/api/...`, so it needs the private link
|
||||
(#46) or some exposure of HA.
|
||||
- **Auth:** `Authorization: Bearer <long-lived access token>`
|
||||
([REST API](https://contributors.home-assistant.io/core/internals/rest-api/)).
|
||||
Long-lived tokens are "valid for 10 years" and act as the user who created
|
||||
them ([Auth API](https://contributors.home-assistant.io/core/internals/auth-api/)).
|
||||
The docs describe no way to scope a token, so it should be created for a
|
||||
dedicated, non-admin HA user. Some endpoints, such as firing events, are
|
||||
marked Admin.
|
||||
- **Semantics:** `POST /api/services/<domain>/<service>` "calls an action and
|
||||
waits until it is done". It returns the changed states, plus a
|
||||
`service_response` with `?return_response` for actions that produce data. A
|
||||
failing action returns 500, and every endpoint returns 503 during shutdown.
|
||||
This makes the call a synchronous request and result, so the HTTP response
|
||||
serves as the ack. hAPI retries on timeout or 5xx, which means actions must
|
||||
be idempotent.
|
||||
- **Maintenance:** none on the HA side. hAPI needs an HTTP client and a token
|
||||
secret.
|
||||
|
||||
### 4. WebSocket API (hAPI holds a socket open to HA)
|
||||
|
||||
- **Direction:** inbound to HA at `/api/websocket`
|
||||
([WebSocket API](https://contributors.home-assistant.io/core/internals/websocket-api/)).
|
||||
- **Auth:** the server sends `auth_required`, the client replies with `auth`
|
||||
containing an `access_token`, and the server answers `auth_ok` or
|
||||
`auth_invalid`. A long-lived token works.
|
||||
- **Semantics:**
|
||||
- *Commands.* Each command gets a `result` with the same `id`, carrying
|
||||
`success` true or false and an `error` with a `code`. `call_service`
|
||||
accepts `return_response: true`.
|
||||
- *Subscriptions.* `subscribe_events` and `subscribe_trigger` (Admin) let hAPI
|
||||
receive HA state changes and events in real time.
|
||||
- *Liveness.* `ping` and `pong` work as a heartbeat.
|
||||
- **Reliability:** each request gets a result on a live connection. If the
|
||||
connection drops, in-flight commands have unknown outcomes and hAPI must
|
||||
reconcile them.
|
||||
- **Maintenance:** a long-lived connection with reconnect logic in hAPI (one
|
||||
pod, or leader election). It is the richest option if hAPI also needs HA state
|
||||
for the Smart home domain.
|
||||
|
||||
### 5. Webhook trigger (hAPI calls HA)
|
||||
|
||||
- **Direction:** inbound. `local_only` defaults to true, so only the home
|
||||
network is accepted. With Home Assistant Cloud (Nabu Casa) "a webhook gets a
|
||||
public address", but only when local-only is off
|
||||
([Webhook trigger](https://www.home-assistant.io/triggers/webhook/)).
|
||||
- **Auth:** none beyond the ID: "A webhook doesn't need a password or a token."
|
||||
The docs say not to use webhooks for destructive or safety-critical actions,
|
||||
and give unlocking a door as an example.
|
||||
- **Semantics:** fire-and-forget. HA "almost always returns `200 OK`" so that
|
||||
webhook IDs can't be discovered, which means hAPI learns nothing about the
|
||||
outcome. Results have to come back through a separate channel, such as a
|
||||
`rest_command` to hAPI. Payloads are available as `trigger.json`,
|
||||
`trigger.data`, and `trigger.query`.
|
||||
- **Fit:** poor for hAPI given the "assume hostile internet" stance. A bearer ID
|
||||
with no per-call result is weaker than the REST or WebSocket APIs on the same
|
||||
network path.
|
||||
|
||||
### 6. REST polling plus `rest_command` (HA pulls from hAPI)
|
||||
|
||||
- **Direction:** HA opens every connection, so nothing inbound is needed at
|
||||
home.
|
||||
- **Pulling jobs:** the RESTful integration polls an endpoint every
|
||||
`scan_interval`, 30 s by default. It supports `basic` or `digest` auth, custom
|
||||
`headers` (so a bearer token works), and `verify_ssl`. JSON fields are exposed
|
||||
via `json_attributes`
|
||||
([RESTful](https://www.home-assistant.io/integrations/rest/)).
|
||||
- **Reporting results:** an automation that reacts to a state change does the
|
||||
job and then calls a `rest_command` to POST the result to hAPI.
|
||||
`rest_command` supports GET, PATCH, POST, PUT, and DELETE, a 10 s default
|
||||
timeout, and returns `status`, `content`, and `headers` through
|
||||
`response_variable`
|
||||
([RESTful Command](https://www.home-assistant.io/integrations/rest_command/)).
|
||||
- **Reliability:** latency equals the polling interval. A job queue built from
|
||||
sensor state and YAML templates is awkward, though acks are explicit because
|
||||
HA POSTs the result.
|
||||
- **Maintenance:** low infrastructure, but the job logic is spread across YAML
|
||||
that is hard to test.
|
||||
|
||||
### 7. Custom integration (`custom_components`)
|
||||
|
||||
- **What it is:** a Python package in `config/custom_components/<domain>/`
|
||||
whose `manifest.json` requires a `version` key for custom integrations
|
||||
([Integration manifest](https://developers.home-assistant.io/docs/creating_integration_manifest/)).
|
||||
It can run any client: an AMQP consumer, MQTT with a persistent session, a
|
||||
long-poll or SSE loop against hAPI, or an outbound WebSocket to hAPI. It
|
||||
calls HA actions directly and acks the job only after the action finishes.
|
||||
That makes it the only option where HA initiates the connection and still
|
||||
gets true at-least-once delivery with an explicit ack.
|
||||
- **Distribution changed in 2026.11:** "The Marketplace replaces the Home
|
||||
Assistant Community Store (HACS)". Custom repositories must be "a public
|
||||
repository on GitHub"
|
||||
([Marketplace](https://www.home-assistant.io/integrations/marketplace/)). A
|
||||
private integration hosted on the Owner's Gitea therefore cannot be installed
|
||||
or updated through the Marketplace; it would be copied into
|
||||
`custom_components` by hand or by a script.
|
||||
- **Maintenance:** highest. Changes to what custom integrations use from core
|
||||
are "deprecated for 12 months first", but the integration still has to keep
|
||||
up with HA releases; HA says to test against the beta
|
||||
([Publish a custom integration](https://contributors.home-assistant.io/marketplace/guides/integrations/)).
|
||||
|
||||
## Comparison
|
||||
|
||||
| Mechanism | Connection opened by | Auth | Job ack / result | Survives HA offline? | Upkeep |
|
||||
|---|---|---|---|---|---|
|
||||
| MQTT (Mosquitto in cluster) | HA (outbound) | user/pass, mTLS | HA publishes result message | No (clean session); hAPI must re-send | Low (plus broker) |
|
||||
| MQTT via RabbitMQ plugin | HA (outbound) | user/pass, x.509 | same | No | Unsupported by HA |
|
||||
| AMQP | n/a (no integration) | n/a | n/a | n/a | Needs custom integration |
|
||||
| REST API | hAPI (inbound) | Bearer long-lived token | Synchronous HTTP result | hAPI retries | Very low |
|
||||
| WebSocket API | hAPI (inbound) | access token in `auth` msg | `result` per `id` | hAPI reconnects and reconciles | Medium |
|
||||
| Webhook | hAPI (inbound) | secret ID only | None (always 200) | No | Low, weak security |
|
||||
| REST poll + `rest_command` | HA (outbound) | basic/digest/header token | HA POSTs result | Yes (job waits in hAPI) | Low infra, clunky YAML |
|
||||
| Custom integration | Either | anything | Explicit ack after action | Yes, if designed for it | High; no Marketplace for a Gitea repo |
|
||||
|
||||
## Implications for #55 (which bridge carries jobs)
|
||||
|
||||
- **Durability belongs in hAPI.** In every option, durability is cheapest as a
|
||||
hAPI-owned job table in Postgres (pending, sent, done, failed) with retry
|
||||
and idempotency keys. The transport only needs at-least-once delivery while
|
||||
connected and a result path back.
|
||||
- **If the private link (#46) exists:** calling HA's REST or WebSocket API from
|
||||
hAPI is the simplest path. It needs no broker and no HA-side code, and gives a
|
||||
synchronous result. HA would appear to hAPI as an external system that hAPI
|
||||
calls with a long-lived token belonging to a dedicated HA user.
|
||||
- **If HA must initiate:** MQTT to Mosquitto in the cluster is the supported
|
||||
path, with hAPI re-sending unacked jobs when it sees `online` on
|
||||
`homeassistant/status`. RabbitMQ is only worth it if hAPI wants AMQP for its
|
||||
own internal reasons, and its MQTT plugin is unsupported by HA.
|
||||
- **For HA to call hAPI** (to report results, or to poll), HA needs a hAPI
|
||||
credential. In GLOSSARY terms that makes it a **Bot** Principal.
|
||||
|
||||
## Sources
|
||||
|
||||
- HA MQTT integration: https://www.home-assistant.io/integrations/mqtt/
|
||||
- HA MQTT trigger: https://www.home-assistant.io/triggers/mqtt/
|
||||
- HA core MQTT client source: https://github.com/home-assistant/core/blob/dev/homeassistant/components/mqtt/client.py and `const.py`
|
||||
- RabbitMQ MQTT plugin: https://www.rabbitmq.com/docs/mqtt
|
||||
- HA REST API: https://contributors.home-assistant.io/core/internals/rest-api/
|
||||
- HA WebSocket API: https://contributors.home-assistant.io/core/internals/websocket-api/
|
||||
- HA Auth API: https://contributors.home-assistant.io/core/internals/auth-api/
|
||||
- HA Webhook trigger: https://www.home-assistant.io/triggers/webhook/
|
||||
- HA RESTful: https://www.home-assistant.io/integrations/rest/
|
||||
- HA RESTful Command: https://www.home-assistant.io/integrations/rest_command/
|
||||
- HA integration manifest: https://developers.home-assistant.io/docs/creating_integration_manifest/
|
||||
- HA Marketplace: https://www.home-assistant.io/integrations/marketplace/
|
||||
- Publishing a custom integration: https://contributors.home-assistant.io/marketplace/guides/integrations/
|
||||
@@ -0,0 +1,105 @@
|
||||
# Linode (Akamai Cloud) Managed PostgreSQL: networking, security, backups
|
||||
|
||||
Research for issue #49 (part of #44). Researched 2026-11-23 against Akamai TechDocs, the Akamai pricing page, and the `linode/terraform-provider-linode` repo (latest release v4.10.0, published 2026-11-19).
|
||||
|
||||
## Which generation this covers
|
||||
|
||||
There are two Linode/Akamai Managed Database generations. The API reports which one you have in the `platform` field: `rdbms-legacy` or `rdbms-default` ([API: create PostgreSQL DB][api-create]).
|
||||
|
||||
- **Legacy** (`rdbms-legacy`): the original Linode DBaaS. Akamai is migrating these databases to the new system. Some legacy endpoints, such as the database backups endpoints, aren't supported in the new product and will be deprecated ([changelog 2024-11-14][cl-2024]).
|
||||
- **Current** (`rdbms-default`): Akamai "reintroduced" the service on 2024-11-14, built with Aiven, in 20 core compute regions ([changelog 2024-11-14][cl-2024], [cluster overview][overview]).
|
||||
|
||||
**Everything below applies to the current (Aiven-based) generation only.** Older guides and blog posts that describe the legacy product (for example, ones listing PG 13 or a backups API) don't apply to it.
|
||||
|
||||
## Bottom line for hAPI
|
||||
|
||||
- **Private access is possible, through a VPC.** A database cluster can be attached to a VPC in the same region (`private_network.vpc_id` / `subnet_id`). Its hostname then resolves to a private IPv4 address in the VPC subnet, and public access is off unless `public_access = true` ([manage clusters][manage], [API: create][api-create]). Our self-managed Kubernetes nodes are plain Linode Compute instances, and "Linodes can join a VPC by specifying the VPC as a network interface" ([VPC][vpc]). So the nodes need a VPC interface in the same VPC and region as the database.
|
||||
- **Caveat: VPC for Managed Databases launched as beta (2025-09-30), and I found no GA announcement.** The API changelog says use of `private_network` "is in beta" and "may cause disruptions in certain production environments" ([API changelog 2025-09-30][api-cl-vpc], [cloud changelog 2025-09-30][cl-vpc]). The current manage-clusters page doesn't label it beta, but no changelog entry declares it GA. Treat it as beta until you see a GA entry.
|
||||
- **Without a VPC: public endpoint plus an IP allowlist.** Each cluster has an ACL, and "by default, all connections both public and private are blocked unless they appear on this list" ([manage clusters][manage]). The ACL still applies when a VPC is attached, so add the VPC subnet CIDR to `allow_list` (inference from that quote, not stated outright).
|
||||
- **The LKE auto-allowlist doesn't help us.** Akamai rewrites each database's ACL every 10 minutes with the IPs of all **LKE** nodes in the account ([manage clusters][manage]). hAPI runs self-managed Kubernetes on Compute, not LKE, so node IPs have to be managed ourselves (for example with Terraform `linode_database_access_controls`). Also note that if LKE is ever used in the same account, every LKE node is allowlisted on every database automatically. Opting out requires a support ticket.
|
||||
- **TLS is mandatory.** `ssl_connection` is "currently required to be `true`". A CA certificate is downloadable from Cloud Manager or available as the Terraform `ca_cert` attribute, so clients can use `sslmode=verify-full` ([API: create][api-create], [PostgreSQL doc][pg], [TF resource][tf]).
|
||||
- **Backups:** daily backups, kept 14 days, with point-in-time restore inside that window. Restores always create a new (forked) cluster ([overview][overview], [manage clusters][manage]).
|
||||
- **Cheapest option:** Shared 1 GB at $16/mo for one node or $37/mo for three nodes (HA). That plan has 9 GB of usable storage ([pricing][pricing]).
|
||||
|
||||
## Versions
|
||||
|
||||
- PostgreSQL **15, 16, 17, 18** are supported ([engines and plans][engines]). Engine IDs look like `postgresql/16`; the live list comes from the List engines API ([API: create][api-create]).
|
||||
- Major-version upgrades run in place, start immediately when you click Upgrade, and can't be reverted. A failed compatibility check rolls back. Discontinued versions are upgraded automatically during the maintenance window ([manage clusters][manage]). I found no published version EOL schedule.
|
||||
|
||||
## Plans and HA
|
||||
|
||||
- Plan families: Shared CPU and Dedicated CPU; premium Linode types are also accepted ([engines and plans][engines], [API changelog 2025-09-30][api-cl-vpc]). Ranges: Dedicated 1-3 nodes, 4-512 GB RAM, 80-7200 GB storage. Shared 1 or 3 nodes, 1-192 GB RAM, 25-7200 GB storage ([overview][overview]).
|
||||
- `cluster_size`: `1`, `2`, or `3`. `3` means one primary and two standbys. `2` is dedicated-only ([API: create][api-create]). Three-node clusters give "data redundancy and automatic failover" ([overview][overview]).
|
||||
- HA tuning through `engine_config`: `pglookout.max_failover_replication_time_lag` (TF default 60 s) and `synchronous_replication` (`quorum` or `off`, three-node only) ([API: create][api-create], [TF resource][tf]).
|
||||
- Single-node clusters have downtime during maintenance and resizes ([manage clusters][manage]).
|
||||
|
||||
## Networking details
|
||||
|
||||
- The VPC must be in the same region as the cluster. You can assign, change, or unassign a VPC after creation, but "any change of the networking settings causes a temporary downtime" ([manage clusters][manage]).
|
||||
- With `public_access = true`, a second hostname is published. Swap the `private-` prefix for `public-` to get it ([manage clusters][manage]). The API `endpoints` array (added 2026-03-31) lists each address with its role and `public_access` ([API changelog 2026-03][api-cl-2026]).
|
||||
- The VPC subnet doesn't automatically block outbound connections outside the subnet. Akamai recommends Cloud Firewall rules on the VPC Linodes, including blocking inbound traffic from the cluster's VPC range ([manage clusters][manage], search summary of [API: update][api-update]).
|
||||
- VPC traffic "is isolated from other cloud tenants, [but] it is not encrypted", and VPC interfaces have no IPv6 ([VPC][vpc]). TLS (mandatory) covers this.
|
||||
- The docs say "the connection to a database cluster over a private IP address is not supported" and recommend public IPv6 instead ([manage clusters][manage]). This sits in the ACL section, so I read it as referring to legacy Linode private IPv4 (`192.168.128.0/17`, shared by all Linodes in a region, [VPC][vpc]) rather than VPC addresses. The page doesn't define the term, though. **Verify before relying on either reading.**
|
||||
- Cost: inbound transfer is free. Public IPv4 from Linodes costs egress; IPv6 (AAAA) from same-region Linodes avoids transfer charges ([overview][overview], [manage clusters][manage]). VPCs themselves cost nothing extra. Egress overage is $0.005/GB ([pricing][pricing]).
|
||||
- Known issue: some PostgreSQL clients that prefer IPv6 can hang for about 3 minutes when only an IPv4 ACL entry exists ([manage clusters][manage]).
|
||||
- VPCs are single-region, can't be peered, and are no longer supported in distributed regions as of 2026-04-22 ([VPC][vpc]).
|
||||
|
||||
## Users, roles, extensions, pooling
|
||||
|
||||
- The admin user is `akmadmin`. **Superuser isn't available.** Akamai says to use `akmadmin`/`defaultdb` for administration only and to create separate users and databases for applications ([PostgreSQL doc][pg]). There's no API or Terraform resource for database users or roles, so per-app roles have to be created in SQL (for example, a migration or bootstrap job running as `akmadmin`).
|
||||
- The root password can be reset (a new random one is generated), but the root user can't be removed ([manage clusters][manage], [overview][overview]). Terraform exposes `root_username` and `root_password` as attributes, so the password ends up in Terraform state.
|
||||
- `engine_config_pg_password_encryption` defaults to **`md5`** according to the Terraform docs. Set `scram-sha-256` explicitly ([TF resource][tf]).
|
||||
- Extensions: Akamai links to Aiven's extension list instead of publishing its own ([PostgreSQL doc][pg]). `pg_stat_monitor` (toggle restarts the cluster), `pg_stat_statements` and `pg_partman` settings are exposed through `engine_config` ([TF resource][tf]).
|
||||
- PgBouncer connection pools (API-managed) were added on 2026-03-31 ([API changelog 2026-03][api-cl-2026]).
|
||||
- Encryption at rest: Terraform exports an `encrypted` attribute ([TF resource][tf]). I didn't find a first-party Akamai statement on at-rest encryption; the overview page only links to Aiven's encryption docs ([overview][overview]).
|
||||
- There's no OS access, config files can't be edited, and replicas can't be hosted outside the service ([overview][overview]).
|
||||
|
||||
## Backups and restore
|
||||
|
||||
- Daily backups, retained 14 days, no extra cost. Point-in-time recovery for any time in that window ([overview][overview]).
|
||||
- To restore, create a new database with `fork.source` and an optional `fork.restore_time` (must be newer than `oldest_restore_time`). Without `restore_time` you get the newest full backup plus incremental. A restore always makes a **new cluster**; delete the original to stop paying for both ([API: create][api-create], [manage clusters][manage]).
|
||||
- A deleted database's backups are kept for 180 days, and a suspended cluster can be resumed within 180 days ([manage clusters][manage]).
|
||||
- There's no off-platform or exportable backup feature and no configurable retention. For personal finance data, we'd need our own `pg_dump` to separate storage (such as Object Storage) to survive account-level loss or retention longer than 14 days. That's my inference, not an Akamai recommendation.
|
||||
|
||||
## Maintenance
|
||||
|
||||
- Window defaults to Sunday 20:00 UTC, weekly. `duration` "can only be `4`" hours and `frequency` "can only be `weekly`" via API/TF; day and hour (UTC) are configurable ([manage clusters][manage], [API: create][api-create]). The manage page says the default lasts 3 hours, which conflicts with the API's fixed 4.
|
||||
- Pending updates appear in `pending_updates`, with a deadline, and can be applied manually ([TF resource][tf], [manage clusters][manage]).
|
||||
|
||||
## Pricing (PostgreSQL = MySQL, monthly, USD)
|
||||
|
||||
| Plan | vCPU / RAM / usable storage | 1 node | 2 nodes | 3 nodes |
|
||||
|---|---|---|---|---|
|
||||
| Shared 1 GB | 1 / 1 GB / 9 GB | $16 | n/a | $37 |
|
||||
| Shared 2 GB | 1 / 2 GB / 30 GB | $32 | n/a | $74 |
|
||||
| Shared 4 GB | 2 / 4 GB / 58 GB | $63 | n/a | $147 |
|
||||
| G7 Dedicated 4 GB | 2 / 4 GB / 58 GB | $81.60 | $171.60 | $246 |
|
||||
|
||||
Source: [pricing][pricing]. The pricing page marks shared plans as "legacy hardware". Akamai also advertises a $100 trial credit.
|
||||
|
||||
## Terraform support
|
||||
|
||||
- Use `linode_database_postgresql_v2`. The v1 `linode_database_postgresql` doc no longer exists in the provider repo (404 on `main`). Remaining database resources: `database_postgresql_v2`, `database_mysql_v2`, `database_access_controls` ([provider repo docs][tf-dir]).
|
||||
- `linode_database_postgresql_v2` supports `engine_id`, `region`, `type`, `cluster_size`, `allow_list`, `private_network { vpc_id, subnet_id, public_access }` (in Terraform, `subnet_id` is **required** when `private_network` is set), `fork_source` / `fork_restore_time`, `updates`, and many `engine_config_*` fields. It exports `ca_cert`, `host_primary`, `host_secondary` (private host), `root_username`, `root_password`, `port`, and `encrypted`. Provisioning "can take up to half an hour" ([TF resource][tf]).
|
||||
- I didn't find PgBouncer pool resources in the provider docs listing.
|
||||
|
||||
## Open questions
|
||||
|
||||
- Is VPC for Managed Databases GA yet? No changelog entry says so, as of 2026-11-23.
|
||||
- What exactly does "connection over a private IP address is not supported" mean? See the networking section above.
|
||||
- Is at-rest encryption on by default? There's no first-party Akamai statement.
|
||||
|
||||
[overview]: https://techdocs.akamai.com/cloud-computing/docs/aiven-database-clusters
|
||||
[manage]: https://techdocs.akamai.com/cloud-computing/docs/aiven-manage-database
|
||||
[engines]: https://techdocs.akamai.com/cloud-computing/docs/database-engines-plans
|
||||
[pg]: https://techdocs.akamai.com/cloud-computing/docs/aiven-postgresql
|
||||
[vpc]: https://techdocs.akamai.com/cloud-computing/docs/vpc
|
||||
[api-create]: https://techdocs.akamai.com/linode-api/reference/post-databases-postgre-sql-instances
|
||||
[api-update]: https://techdocs.akamai.com/linode-api/reference/put-databases-postgre-sql-instance
|
||||
[api-cl-vpc]: https://techdocs.akamai.com/linode-api/changelog/sep-30-2025-managed-databases-vpc-support
|
||||
[cl-vpc]: https://techdocs.akamai.com/cloud-computing/changelog/vpc-for-dbaas
|
||||
[api-cl-2026]: https://techdocs.akamai.com/linode-api/changelog/mar-2026-managed-databases-updates
|
||||
[cl-2024]: https://techdocs.akamai.com/cloud-computing/changelog/nov-14-2024-database
|
||||
[pricing]: https://www.akamai.com/cloud/pricing/databases
|
||||
[tf]: https://github.com/linode/terraform-provider-linode/blob/main/docs/resources/database_postgresql_v2.md
|
||||
[tf-dir]: https://github.com/linode/terraform-provider-linode/tree/main/docs/resources
|
||||
Reference in new issue
Block a user