From 86b4b2c44b86c7810b8cf0dac81c598a525f92e6 Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Wed, 14 Jan 2026 13:51:22 -0800 Subject: [PATCH 1/3] Add support for configs --- defang/POWER.md | 5 +- defang/steering/deploying-to-aws.md | 8 ++- defang/steering/deploying-to-gcp.md | 10 ++-- defang/steering/managing-configs.md | 78 +++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 7 deletions(-) create mode 100644 defang/steering/managing-configs.md diff --git a/defang/POWER.md b/defang/POWER.md index 7c93432..c35e79e 100644 --- a/defang/POWER.md +++ b/defang/POWER.md @@ -2,6 +2,7 @@ name: "defang" displayName: "Defang" description: "Deploy Docker Compose apps to your own cloud account using Defang." +author: "DefangLabs" keywords: [ "deploy", @@ -31,9 +32,9 @@ Ensure that the step above ## Validate tools is completed before proceeding to t - Ask the user which cloud provider they want to use (AWS, GCP) - If AWS: - - Use the steering file `getting-started-aws` + - Use the steering file `deploying-to-aws` - If GCP: - - Use the steering file `getting-started-gcp` + - Use the steering file `deploying-to-gcp` # Available Steering Files diff --git a/defang/steering/deploying-to-aws.md b/defang/steering/deploying-to-aws.md index 2634d61..afa5449 100644 --- a/defang/steering/deploying-to-aws.md +++ b/defang/steering/deploying-to-aws.md @@ -14,7 +14,7 @@ When the user's project has a compose.yaml file and would like to deploy to aws. ## Step 1: Select the stack to which the application will be deployed -A stack is a single deployed instance of your project in a specific AWS account and region. You can deploy multiple stacks into the same account and region, for example: `staging` and `production`. +A [stack](https://docs.defang.io/docs/concepts/stacks) is a single deployed instance of your project in a specific AWS account and region. You can deploy multiple stacks into the same account and region, for example: `staging` and `production`. Check if there are any stacks in the current project. @@ -25,7 +25,7 @@ The following information will be needed to create a stack: - Stack name: must be alphanumeric and must not start with a number - Region: for example: `us-west-2` -- AWS Profile: the AWS profile with which the user should authenticate to AWS +- AWS Profile: the AWS profile with which the user should authenticate to AWS. First, verify the AWS CLI is installed and configured by running `aws`. You can list available profiles with `aws configure list-profiles`, and once the profiles are retrieved; prompt the user to select one. If the AWS CLI is not installed or configured, direct the user to the [installation guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html). Once the AWS CLI has been successfully installed, guide the user to configure an AWS Profile by running `aws configure` and entering their credentials. Then restart the stack creation process. - Deployment Mode: The deployment mode is the primary parameter for managing the cost and resiliency of your application's deployment. The following deployment modes are available: `affordable`, `balanced`, and `high_availability`. The default is `affordable`. Learn more at https://docs.defang.io/docs/concepts/deployment-modes If a new stack is created, make sure to select it before it can be used. @@ -34,6 +34,10 @@ If a new stack is created, make sure to select it before it can be used. Now that a stack is selected, the project can be deployed. +### Configs + +The deployment call will error back if any required configs are missing. Please refer to the steering file `managing-configs` for more information on how to manage configs. + ## Step 3: Monitor the deployment Once the deployment has begun, progress can be monitored by tailing the logs or periodically checking service status. diff --git a/defang/steering/deploying-to-gcp.md b/defang/steering/deploying-to-gcp.md index d0e897d..169fd13 100644 --- a/defang/steering/deploying-to-gcp.md +++ b/defang/steering/deploying-to-gcp.md @@ -10,16 +10,16 @@ This guide describes how to deploy applications to GCP with Defang. ## Trigger -When the user's project has a compose.yaml file and would like to deploy to aws. +When the user's project has a compose.yaml file and would like to deploy to gcp. ## Step 1: Select the stack to which the application will be deployed -A stack is a single deployed instance of your project in a specific AWS account and region. You can deploy multiple stacks into the same account and region, for example: `staging` and `production`. +A [stack](https://docs.defang.io/docs/concepts/stacks) is a single deployed instance of your project in a specific GCP project and region. You can deploy multiple stacks into the same project and region, for example: `staging` and `production`. Check if there are any stacks in the current project. - If a stack is already defined, ask the user if they would like to select one of the existing stacks, or if they would like to create a new one. -- If there are no stacks, prompt user to create a new AWS stack. +- If there are no stacks, prompt user to create a new GCP stack. The following information will be needed to create a stack: @@ -34,6 +34,10 @@ If a new stack is created, make sure to select it before it can be used. Now that a stack is selected, the project can be deployed. +### Configs + +The deployment call will error back if any required configs are missing. Please refer to the steering file `managing-configs` for more information on how to manage configs. + ## Step 3: Monitor the deployment Once the deployment has begun, progress can be monitored by tailing the logs or periodically checking service status. diff --git a/defang/steering/managing-configs.md b/defang/steering/managing-configs.md new file mode 100644 index 0000000..8e35d1c --- /dev/null +++ b/defang/steering/managing-configs.md @@ -0,0 +1,78 @@ +# Managing Configs + +Configs are key-value pairs that can be used to store sensitive information such as API keys, database credentials, or any other configuration data that should not be hardcoded into your application. + +**IMPORTANT**: +Do not assume default values for configs; always prompt the user for input. For example, do not assume a default password for a database config is always randomly generated. Always present the user with the options to provide a value or choose to generate a random one before setting each config. + +## Viewing Configs + +To view the current configs for your project, use the following MCP tool: + +```bash +list_configs +``` + +This will display a list of all the configs currently set for your project. This list does not represent configs you are still required to set; it only shows what has already been set. + +## Setting Configs + +To set a config, use the following MCP tool: + +```bash +set_config +``` + +When setting configs, make sure to ask the user for either a specific value or whether to generate a random value. Do not assume choices on behalf of the user. + +**IMPORTANT**: +When using the `set_config` tool, ensure that only one of the following options is provided: either the `value` parameter or the `random` flag. +Providing both will result in an error. +Example: + +```json +{ + "name": "POSTGRES_PASSWORD", + "value": "helloworld123", + "random": true, + "working_directory": "." +} +``` + +Available parameters: + +- `name` (required): The key for the config you want to set. +- `value` (optional): The value for the config. Do not provide this parameter if you are using the `random` parameter. + Example: + ```json + { + "name": "POSTGRES_PASSWORD", + "value": "helloworld123", + "working_directory": "." + } + ``` +- `random` (optional): If this flag is provided, a random value will be generated for the config. Do not provide the `value` parameter if you are using this parameter. + Example: + ```json + { + "name": "POSTGRES_PASSWORD", + "random": true, + "working_directory": "." + } + ``` + +## Deleting Configs + +To delete a config, use the following MCP tool: + +```bash +remove_config +``` + +This will remove the specified config from your project. + +## Best Practices + +- Avoid hardcoding sensitive information in your codebase. Use configs instead. +- Regularly rotate sensitive configs such as API keys and passwords. +- Use descriptive keys for your configs to make them easily identifiable. From bf88c446359543d06fbd658c14e435d0f7ea2d8b Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Wed, 14 Jan 2026 13:59:52 -0800 Subject: [PATCH 2/3] Make aws instructions more readable --- defang/steering/deploying-to-aws.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/defang/steering/deploying-to-aws.md b/defang/steering/deploying-to-aws.md index afa5449..99ffdd1 100644 --- a/defang/steering/deploying-to-aws.md +++ b/defang/steering/deploying-to-aws.md @@ -25,7 +25,13 @@ The following information will be needed to create a stack: - Stack name: must be alphanumeric and must not start with a number - Region: for example: `us-west-2` -- AWS Profile: the AWS profile with which the user should authenticate to AWS. First, verify the AWS CLI is installed and configured by running `aws`. You can list available profiles with `aws configure list-profiles`, and once the profiles are retrieved; prompt the user to select one. If the AWS CLI is not installed or configured, direct the user to the [installation guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html). Once the AWS CLI has been successfully installed, guide the user to configure an AWS Profile by running `aws configure` and entering their credentials. Then restart the stack creation process. +- AWS Profile: the AWS profile with which the user should authenticate to AWS. + - First, verify the AWS CLI is installed and configured by running `aws`. + - List available profiles with `aws configure list-profiles` and prompt the user to select one. + - If the AWS CLI is not installed or configured: + - Direct the user to the [installation guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html). + - Once installed, guide the user to configure an AWS Profile by running `aws configure` and entering their credentials. + - Restart the stack creation process. - Deployment Mode: The deployment mode is the primary parameter for managing the cost and resiliency of your application's deployment. The following deployment modes are available: `affordable`, `balanced`, and `high_availability`. The default is `affordable`. Learn more at https://docs.defang.io/docs/concepts/deployment-modes If a new stack is created, make sure to select it before it can be used. From a30673eecfe25ab0303b71ceb914550485f4dfd4 Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Wed, 14 Jan 2026 14:16:32 -0800 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Jordan Stephens --- defang/steering/deploying-to-aws.md | 2 +- defang/steering/deploying-to-gcp.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/defang/steering/deploying-to-aws.md b/defang/steering/deploying-to-aws.md index 99ffdd1..b674831 100644 --- a/defang/steering/deploying-to-aws.md +++ b/defang/steering/deploying-to-aws.md @@ -42,7 +42,7 @@ Now that a stack is selected, the project can be deployed. ### Configs -The deployment call will error back if any required configs are missing. Please refer to the steering file `managing-configs` for more information on how to manage configs. +The deployment will fail if any of the config values required by the project are not set. Please refer to the steering file `managing-configs` for more information on how to manage configs. ## Step 3: Monitor the deployment diff --git a/defang/steering/deploying-to-gcp.md b/defang/steering/deploying-to-gcp.md index 169fd13..8cfb860 100644 --- a/defang/steering/deploying-to-gcp.md +++ b/defang/steering/deploying-to-gcp.md @@ -36,7 +36,7 @@ Now that a stack is selected, the project can be deployed. ### Configs -The deployment call will error back if any required configs are missing. Please refer to the steering file `managing-configs` for more information on how to manage configs. +The deployment will fail if any of the config values required by the project are not set. Please refer to the steering file `managing-configs` for more information on how to manage configs. ## Step 3: Monitor the deployment