Mastra 平台推出 VPC 隔离的 Postgres 数据库
Introducing VPC-isolated Postgres on Mastra Platform
Mastra 平台现在支持将 VPC 隔离的 Postgres 数据库挂载到任意环境,限制只有同网络资源才能访问。该数据库与 Turso、Neon 托管数据库并列,适用于需要额外访问限制的场景,MongoDB 和 Redis 即将推出。使用 VPC 数据库时 --region 参数不生效,平台会自动将数据库部署到与环境相同的区域。
正文
当前显示原文,中文全文译文尚未就绪。
You can now attach a VPC-isolated Postgres database to any environment on Mastra platform, letting you restrict access to same-network resources.
Typically, hosted databases are accessible from any client. Mastra platform's VPC provides an extra layer of security by preventing access from resources hosted outside the network.
In June, we launched managed databases with Turso and Neon. VPC Postgres joins the lineup for use cases where extra restrictions are required, with MongoDB and Redis coming soon.
When using a VPC-provisioned database, --region doesn't apply. The platform deploys the database to the same region as the environment to ensure it uses the same server network.
Install or upgrade the global Mastra CLI:
Attach a database to an environment:
Or leave DATABASE_URL in .env unset and let the preflight checks run when you next deploy:
The platform injects DATABASE_URL at deploy time, so your PostgresStore config can remain the same:
Database status
You can't connect to a VPC database from outside the network. Using psql to connect will return an error:
To check the status of a VPC database, use mastra env db show:
ready means provisioned and attached. mastra env db list reports the same for every database in the project and shows which environment each one is attached to.
For more information and full configuration options, see:
Hosted databases; Deploy; Environments; mastra env db create reference; mastra env db show reference; PostgreSQL integration