Skip to content
Merged
2 changes: 1 addition & 1 deletion blog/2024-03-20-dev-environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ We want it to be easy for you to try Defang with as little friction as possible,

## Codespaces

If you want to get started with Codespaces, you can just fork [this repo](https://github.com/DefangLabs/github-codespace). It comes with the Defang CLI pre-installed so you can start playing with it immediately. It's setup using the Defang CLI [Dev Container Feature](https://github.com/DefangLabs/devcontainer-feature/pkgs/container/devcontainer-feature%2Fdefang-cli).
If you want to get started with Codespaces, you can just fork [this repo](https://github.com/DefangLabs/github-codespace). It comes with the Defang CLI pre-installed so you can start playing with it immediately. It's set up using the Defang CLI [Dev Container Feature](https://github.com/DefangLabs/devcontainer-feature/pkgs/container/devcontainer-feature%2Fdefang-cli).

## Dev Containers

Expand Down
26 changes: 16 additions & 10 deletions docs/concepts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ sidebar_position: 225

# Configuration

Defang allows you to configure your application using environment variables. You can set environment variables in your [`compose.yaml` file](./compose.md), or in your [Pulumi program](./pulumi.md). Using Pulumi gives you the advantage of being able to manage your environment variables across different environments using Pulumi stacks.
Defang allows you to configure your application using environment variables. You can set environment variables in your [`compose.yaml` file](./compose.md), or in your [Pulumi program](#using-config-with-pulumi).

:::tip Sample
You can find a sample of how to set environment variables with Pulumi [here](https://github.com/DefangLabs/defang/tree/main/samples/nodejs/remix-aiven-postgres).
:::

# Sensitive Config aka Secrets
# Sensitive Config (aka Secrets)

The Defang CLI allows you to securely store sensitive information such as API keys, passwords, and other credentials. To do so, run:

Expand Down Expand Up @@ -44,6 +40,10 @@ services:

Use the `defang config` command of the Defang CLI to manage the values.

:::tip
You can find a sample of how to set sensitive config values [here](https://github.com/DefangLabs/samples/tree/main/samples/nodejs-openai).
:::

## Interpolation

Environment variables are set within the *environment* section of a service in a `compose.yaml` file. Any variables declared here will become available within the service container.
Expand All @@ -62,18 +62,24 @@ In the example above, if we assume the value of the configuration variable ***US

During `defang compose up` all variable references will be replaced with the actual value and made available in the container. If any referenced variable is not found the `defang compose up` command will be canceled.

## Using Config with Pulumi
In Defang, using config with [Pulumi](./pulumi.md) gives you the advantage of being able to manage your environment variables across different environments using Pulumi stacks.

:::tip
You can find a sample of how to set environment variables with Pulumi [here](https://github.com/DefangLabs/samples/tree/main/samples/pulumi-remix-postgres).
:::

## Connecting Services

If you have created a service before a secret you can connect it by running the `defang compose start` command if using the [`defang compose` workflow](./compose.md). If you are using the [Pulumi-based workflow](./pulumi.md) you will need to redeploy using Pulumi.

:::tip Sample
You can find a sample of how to set sensitive config values [here](https://github.com/DefangLabs/defang/tree/main/samples/nodejs/ChatGPT%20API).
:::

## Providers

Here are the different ways sensitive config values are stored depending on the provider you are using:

* [AWS](../providers/aws/aws.md#secrets)
* [DigitalOcean](../providers/digitalocean#secrets)
* [GCP](../providers/gcp#secrets)



2 changes: 1 addition & 1 deletion docs/concepts/defang-byoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_position: 50

Defang aims to make it easier to deploy your services to the cloud. Specifically, Defang's goal is to make it easier to deploy your workloads to your *own* cloud accounts. We refer to this as bring-your-own-cloud (BYOC). We also provide Defang Playground, but it is only intended for non-production workloads so you can get a feel for how Defang works.

Defang provisions and configures the necessary native managed services from your cloud provider to get your services up and running. For example, on AWS, Defang will configure an [ALB](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/), setup [ECR](https://aws.amazon.com/ecr/), configure [CloudWatch](https://aws.amazon.com/cloudwatch/?nc2=type_a), and run your service on [ECS](https://aws.amazon.com/ecs/?nc2=type_a) and more. The following lists the existing and planned support for cloud providers.
Defang provisions and configures the necessary native managed services from your cloud provider to get your services up and running. For example, on AWS, Defang will configure an [ALB](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/), set up [ECR](https://aws.amazon.com/ecr/), configure [CloudWatch](https://aws.amazon.com/cloudwatch/?nc2=type_a), and run your service on [ECS](https://aws.amazon.com/ecs/?nc2=type_a) and more. The following lists the existing and planned support for cloud providers.

:::info
Defang does not install or run any Defang or third party services at runtime.
Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/generate.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ An HTTP GET endpoint that returns an HTML with a random meme from the imgflip AP
**An example of a more complex prompt**

```
A service that uses bullmq and redis. The compose file should also include a redis service. The code should setup a queue. It should also expose three endpoints with express: one to add a job to the queue, another to check how many tasks are in the queue, and a last one that runs on / which is just a healthcheck. The code should also include a worker that processes the queue by logging what's in each task. Use environment variables to configure the redis connection. No password.
A service that uses bullmq and redis. The compose file should also include a redis service. The code should set up a queue. It should also expose three endpoints with express: one to add a job to the queue, another to check how many tasks are in the queue, and a last one that runs on / which is just a healthcheck. The code should also include a worker that processes the queue by logging what's in each task. Use environment variables to configure the redis connection. No password.
```
2 changes: 1 addition & 1 deletion docs/concepts/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_position: 600

You can easily monitor and debug your Defang services at build and runtime using the Defang CLI and portal.

When you deploy a service using the `defang compose up` the CLI will automatically start tailing the build and runtime logs for your service. You can also view the logs for your service in the portal, or by using the `defang tail` command.
When you deploy a service using the `defang compose up`, the CLI will automatically start tailing the build and runtime logs for your service. You can also view the logs for your service in the portal, or by using the `defang tail` command.

:::warning
Keep in mind that the Defang Portal only displays services deployed to Defang Playground.
Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ const service = new defang.DefangService("gpu-service", {
```

:::info GPUs
If you require access to GPUs, you can specify this in the `deploy.resources.reservations.devices[0].capabilities` section of your service as in the examples above. You can learn more about this in the [docker-compose documentation](https://docs.docker.com/compose/gpu-support/). This is the only supported value in the `deploy.resources.reservations.devices` section.
If you require access to GPUs, you can specify this in the `deploy.resources.reservations.devices[0].capabilities` section of your service as in the examples above. You can learn more about this in the [Docker-Compose documentation](https://docs.docker.com/compose/gpu-support/). This is the only supported value in the `deploy.resources.reservations.devices` section.
:::

10 changes: 5 additions & 5 deletions docs/providers/digitalocean/digitalocean.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ sidebar_position: 010
# DigitalOcean

:::info
This feature is available for Public Preview as of October 2024. This page will be updated when it is GA.
The Defang DigitalOcean Provider is available for Public Preview as of October 2024.
:::

Why should you use Defang with DigitalOcean? Defang allows you to easily create and manage full, scalable applications with DigitalOcean. Defang aims to make it easier to deploy your services to the cloud. DigitalOcean is one of the most popular cloud providers in the world and with Defang, you dont have to waste your time understanding the complexities and challenges of the DigitalOcean platform. Let Defang do it for you and spend more time working on whats important to you!
Why should you use Defang with DigitalOcean? Defang allows you to easily create and manage full, scalable applications with DigitalOcean. Defang aims to make it easier to deploy your services to the cloud. DigitalOcean is one of the most popular cloud providers in the world and with Defang, you don't have to waste your time understanding the complexities and challenges of the DigitalOcean platform. Let Defang do it for you and spend more time working on what's important to you!

## Getting Started

Expand All @@ -19,10 +19,10 @@ Why should you use Defang with DigitalOcean? Defang allows you to easily create
To get started with the Defang BYOC DigitalOcean Provider, first [install the latest version of the Defang CLI](../getting-started#authenticate-with-defang).

### Sign up for DigitalOcean
Next make sure you have signed up for a [DigitalOcean account](https://try.digitalocean.com/freetrialoffer/).
Next, make sure you have signed up for a [DigitalOcean account](https://try.digitalocean.com/freetrialoffer/).

### Authenticate with DigitalOcean
After signing up for your account, be sure to setup your [personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/). Defang will need to find this value in your shell as the `DIGITALOCEAN_TOKEN` environment variable.
After signing up for your account, be sure to set up your [personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/). Defang will need to find this value in your shell as the `DIGITALOCEAN_TOKEN` environment variable.

### Authenticate with DigitalOcean Spaces
You will also need a [DigitalOcean Spaces access key](https://docs.digitalocean.com/products/spaces/how-to/manage-access/). Defang will need to find this value in your shell as the `SPACES_ACCESS_KEY_ID`, and `SPACES_SECRET_ACCESS_KEY` environment variables.
Expand Down Expand Up @@ -64,7 +64,7 @@ The Provider runs your workloads using the [DigitalOcean App Platform](https://d

### Secrets

Defang allows you to configure your services with sensitive config values. Sensitive values are added and stored with [encryption](https://docs.digitalocean.com/products/app-platform/how-to/use-environment-variables/) in your app once it has been deployed.
Defang allows you to configure your services with [sensitive config values](https://docs.digitalocean.com/products/app-platform/how-to/use-environment-variables/) in DigitalOcean. Sensitive values are added and stored with encryption in your app once it has been deployed.

### Future Improvements

Expand Down
4 changes: 2 additions & 2 deletions docs/providers/gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 3000
# Google Cloud Platform (GCP)

:::info
The Defang GCP provider is available for Public Preview as of December 2024.
The Defang GCP Provider is available for Public Preview as of December 2024.
:::

Defang enables you to effortlessly develop and deploy full, scalable applications with GCP. It is designed to simplify deploying your services to the cloud. As one of the leading cloud providers globally, GCP offers powerful tools and resources, and with Defang, you can bypass the complexities of the GCP platform. Let Defang handle the heavy lifting so you can focus on what matters most to you!
Expand All @@ -20,7 +20,7 @@ After signing in to your GCP account, select an existing project or [create a ne
export GCP_PROJECT_ID=<your-project-id>
```

Next step is to [authenticate your local environment with GCP](https://cloud.google.com/docs/authentication). Our preferred method is to setup [Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc) with the Google Cloud CLI. Once the [Google Cloud CLI is installed](https://cloud.google.com/sdk/docs/install), run the following command to authenticate:
Next step is to [authenticate your local environment with GCP](https://cloud.google.com/docs/authentication). Our preferred method is to set up [Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc) with the Google Cloud CLI. Once the [Google Cloud CLI is installed](https://cloud.google.com/sdk/docs/install), run the following command to authenticate:

```bash
gcloud init
Expand Down
4 changes: 2 additions & 2 deletions docs/providers/playground.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The Defang Playground is a free tier that allows you to experiment with Defang.
This page highlights architectural considerations when deploying to the Playground and any differences you might encounter when deploying to the Playground versus deploying to your own cloud account.

:::info
The Playground allows only 1 deployed project at a time. Use the CLI `defang down` to tear down a project before deploying a new one.
The Playground allows only 1 deployed project at a time. Use the CLI `defang down` command to tear down a project before deploying a new one.
:::

## Overview
Expand All @@ -18,4 +18,4 @@ Overall, the Defang Playground is very similar to deploying to your own cloud ac

### Managed services

In essence, the Playground does not support any [managed storage](../concepts/managed-storage) services, ie. `x-defang-postgres` and `x-defang-redis` are ignored when deploying to the Playground. You can however run both postgres and redis as regular container services for testing purposes.
In essence, the Playground does not support any [managed storage](../concepts/managed-storage) services, ie. `x-defang-postgres` and `x-defang-redis` are ignored when deploying to the Playground. You can however run both Postgres and Redis as regular container services for testing purposes.
2 changes: 1 addition & 1 deletion docs/tutorials/use-your-own-domain-name.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This tutorial will show you how to set up and use your own domain when deploying
* [The Defang CLI](/docs/getting-started#install-the-defang-cli)
* [AWS Account Credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html)

## Step 1 - Setup a Hosted Zone in AWS Route 53
## Step 1 - Set up a Hosted Zone in AWS Route 53

:::info
**If you purchased your domain with AWS, you can skip this step.**
Expand Down
Loading