diff --git a/docs/concepts/compose.md b/docs/concepts/compose.md index ab8edb5ac..e5d1a8bbd 100644 --- a/docs/concepts/compose.md +++ b/docs/concepts/compose.md @@ -85,14 +85,14 @@ Here are a list of service-level properties of the [Compose specification](https Service-level means inside your `service`. A service-level property called `build` would look like: ```yaml service: - build: ... + build: … ``` Note that in your Compose file, you will need a top-level property called `services` to contain all of your services. For example: ```yaml services: service: - build: ... + build: … ``` ::: diff --git a/docs/concepts/managed-storage/managed-mongodb.md b/docs/concepts/managed-storage/managed-mongodb.md new file mode 100644 index 000000000..2d1ad04fc --- /dev/null +++ b/docs/concepts/managed-storage/managed-mongodb.md @@ -0,0 +1,50 @@ +--- +title: Managed MongoDB +description: Defang can help you provision managed MongoDB instances. +sidebar_position: 3000 +--- + +# Managed MongoDB + +:::info +This feature was introduced in Defang v1.2.0 released on June 3, 2025. [Upgrade to the latest version](https://docs.defang.io/docs/cli/defang_upgrade) +::: + +Managed MongoDB is a service that allows you to store and retrieve large amounts of data in a document-oriented format. MongoDB is ideal for storing unstructured data like JSON documents, making it a popular choice for modern applications. + +## Current Support + +| Provider | Managed MongoDB | +| --- | --- | +| [Playground](/docs/providers/playground#managed-services) | ⚠️ Unmanaged | +| [AWS](/docs/providers/aws#managed-storage) | ✅ DocumentDB | +| [DigitalOcean](/docs/providers/digitalocean#future-improvements) | ⚠️ Unmanaged | +| [GCP](/docs/providers/gcp#future-improvements) | ⚠️ Unmanaged | + +## How to use Managed MongoDB + +To use managed MongoDB, in your `compose.yaml` file, use the `x-defang-mongodb` extension to define your MongoDB service. Adding the extension will tell Defang to provision a managed instance, rather than running MongoDB as a container. + +### Required Configuration + +When using managed MongoDB, you **must** set a username and password for the database. By default, these are read from the `MONGO_INITDB_ROOT_USERNAME` and `MONGO_INITDB_ROOT_PASSWORD` config variables, conform [the official MongoDB container image](https://hub.docker.com/_/mongo). These can be set using the `defang config set MONGO_INITDB_ROOT_USERNAME` and `defang config set MONGO_INITDB_ROOT_PASSWORD` commands. If you do not provide these values, the deployment will fail. + +### Example + +```yaml +services: + app: + # [...] + environment: + MONGO_URI: mongodb://$MONGO_INITDB_ROOT_USERNAME:$MONGO_INITDB_ROOT_PASSWORD@db:27017/ + depends_on: + - db + + db: + image: mongo:5 + x-defang-mongodb: true +``` + +:::warning[Version] +AWS DocumentDB is compatible with MongoDB 3.6, 4.0, and 5.0. The `mongo:5` image is compatible with DocumentDB 5.0, so we recommend using this version for your MongoDB service. Deployment will fail for versions higher than 5. +::: diff --git a/docs/concepts/managed-storage/managed-postgres.mdx b/docs/concepts/managed-storage/managed-postgres.mdx index 14decba45..14a411b82 100644 --- a/docs/concepts/managed-storage/managed-postgres.mdx +++ b/docs/concepts/managed-storage/managed-postgres.mdx @@ -12,10 +12,10 @@ Postgres, or PostgreSQL, is a powerful open-source relational database system kn | Provider | Managed Postgres | | --- | --- | -| [Playground](/docs/providers/playground#managed-services) | ❌ | -| [AWS](/docs/providers/aws#managed-storage) | ✅ | -| [DigitalOcean](/docs/providers/digitalocean#future-improvements) | ❌ | -| [GCP](/docs/providers/gcp#managed-storage) | ✅ | +| [Playground](/docs/providers/playground#managed-services) | ⚠️ Unmanaged | +| [AWS](/docs/providers/aws#managed-storage) | ✅ RDS Postgres | +| [DigitalOcean](/docs/providers/digitalocean#future-improvements) | ⚠️ Unmanaged | +| [GCP](/docs/providers/gcp#managed-storage) | ✅ Cloud SQL Postgres | ## How to use Managed Postgres @@ -84,7 +84,7 @@ When a project is deployed to a [production environment](/docs/concepts/deployme The AWS Console can be used to restore a snapshot into a new instance of Postgres. This feature is not yet supported in GCP. -{/* +{/* ### Major Version Updating of Engine To update the database engine you can update the image to a later version in your Compose file and apply it via ```defang compose up --provider=aws```. In the example below, we change from Postgres 15 to 16. @@ -101,5 +101,5 @@ to ``` database: image: postgres:16 -``` +``` */} diff --git a/docs/concepts/managed-storage/managed-redis.md b/docs/concepts/managed-storage/managed-redis.md index c171709d9..5202a6e1d 100644 --- a/docs/concepts/managed-storage/managed-redis.md +++ b/docs/concepts/managed-storage/managed-redis.md @@ -12,10 +12,10 @@ Redis is an in-memory data structure store widely used for caching, real-time an | Provider | Managed Redis | | --- | --- | -| [Playground](/docs/providers/playground#managed-services) | ❌ | -| [AWS](/docs/providers/aws#managed-storage) | ✅ | -| [DigitalOcean](/docs/providers/digitalocean#future-improvements) | ❌ | -| [GCP](/docs/providers/gcp#managed-services) | ✅ | +| [Playground](/docs/providers/playground#managed-services) | ⚠️ Unmanaged | +| [AWS](/docs/providers/aws#managed-storage) | ✅ Elasticache | +| [DigitalOcean](/docs/providers/digitalocean#future-improvements) | ⚠️ Unmanaged | +| [GCP](/docs/providers/gcp#managed-services) | ✅ Memorystore | ## How to use Managed Redis diff --git a/docs/providers/aws/aws.md b/docs/providers/aws/aws.md index 87c761aab..1ec71f4cf 100644 --- a/docs/providers/aws/aws.md +++ b/docs/providers/aws/aws.md @@ -78,6 +78,10 @@ Defang offers integration with managed, cloud-native large language model servic When using [Managed LLMs](/docs/concepts/managed-llms/managed-language-models.md), the Defang CLI provisions an ElastiCache Redis cluster in your account. +### Managed MongoDB + +Defang will provision a DocumentDB instance for services that use the `x-defang-mongodb` service extension. This allows you to use MongoDB as a managed service, rather than running it as a container. + ### Managed Resources Defang will create and manage the following resources in your AWS account from its bootstrap CloudFormation template: