Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions defang/POWER.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: "defang"
displayName: "Defang"
description: "Deploy Docker Compose apps to your own cloud account using Defang."
author: "DefangLabs"
keywords:
[
"deploy",
Expand Down Expand Up @@ -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

Expand Down
14 changes: 12 additions & 2 deletions defang/steering/deploying-to-aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
- 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.
Expand All @@ -34,6 +40,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 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

Once the deployment has begun, progress can be monitored by tailing the logs or periodically checking service status.
10 changes: 7 additions & 3 deletions defang/steering/deploying-to-gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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 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

Once the deployment has begun, progress can be monitored by tailing the logs or periodically checking service status.
78 changes: 78 additions & 0 deletions defang/steering/managing-configs.md
Original file line number Diff line number Diff line change
@@ -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.
Comment on lines +8 to +16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this? We have tool descriptions which should serve this purpose.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


## 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.
Comment on lines +18 to +72
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this is roughly redundant to our tool descriptions

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tested this in Kiro, it didn’t seem to have enough context on how to manage configurations. I ran experiments without this file before creating it, and the tool was not able to reliably set configs until the file was added.

It’s possible that the Kiro team hasn’t fully implemented reading tool parameter descriptions yet. For example, the Terraform Power includes a dedicated file that explains how to use their MCP server, which likely helps provide that missing context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be amending our tool descriptions?


## 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.