AI Skill Hub 推荐使用:Dify AI应用开发平台 是一款优质的Dify应用。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的Dify应用解决方案,这是一个值得深入了解的选择。
Dify AI应用开发平台 是一款基于 TypeScript 开发的开源工具,专注于 aws-cdk、dify、typescript 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
Dify AI应用开发平台 是一款基于 TypeScript 开发的开源工具,专注于 aws-cdk、dify、typescript 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:npm 全局安装 npm install -g dify-self-hosted-on-aws # 方式二:npx 直接运行(无需安装) npx dify-self-hosted-on-aws --help # 方式三:项目依赖安装 npm install dify-self-hosted-on-aws # 方式四:从源码运行 git clone https://github.com/aws-samples/dify-self-hosted-on-aws cd dify-self-hosted-on-aws npm install npm start
# 命令行使用
dify-self-hosted-on-aws --help
# 基本用法
dify-self-hosted-on-aws [options] <input>
# Node.js 代码中使用
const dify_self_hosted_on_aws = require('dify-self-hosted-on-aws');
const result = await dify_self_hosted_on_aws.run(options);
console.log(result);
# dify-self-hosted-on-aws 配置说明 # 查看配置选项 dify-self-hosted-on-aws --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export DIFY_SELF_HOSTED_ON_AWS_CONFIG="/path/to/config.yml"
Self-host Dify, an LLM app development platform, using AWS managed services with AWS CDK.

Key Features:
You must have the following dependencies installed to deploy this app:
npm ci
npx cdk bootstrap
You can adjust configuration parameters such as AWS regions by modifying bin/cdk.ts. Please also check EnvironmentProps interface for all the available parameters.
Then you can run the following commands to deploy the entire stack.
```sh
npx cdk deploy --all
The initial deployment usually takes about 20 minutes. After a successful deployment, you will get the URL for the app.
✅ DifyOnAwsCdkStack
✨ Deployment time: 326.43s
Outputs: DifyOnAwsStack.DifyUrl = https://dify.example.com ```
You can open the URL with a browser and get started!
You can use a dedicated script that works even in an environment with limited storage space such as AWS CloudShell.
In CloudShell, you can just run the following commands:
git clone https://github.com/aws-samples/dify-self-hosted-on-aws.git
cd dify-self-hosted-on-aws
./simple-deploy.sh
Then follow the prompts from the shell script. You will finally get the DifyOnAwsStack.DifyUrl output in the CLI.
After logged in, you can setup Dify to use Bedrock LLMs.
[!IMPORTANT] Before setting up models in Dify, you have to enable models you want to use in Bedrock management console. Please read this document for more details.
Go to settings by clicking the right-top profile, click WORKSPACE -> Model Provider, and select AWS Bedrock model.
IAM policies are already configured properly, so you can just select a correct AWS region (where the models are enabled) to use Bedrock models, and click Save.

You can deploy the system on a closed network (i.e. a VPC without internet gateway or NAT gateway) with a few simple additional steps.
To deploy on a closed network, please follow the steps below:
1. Set configuration parameters in bin/cdk.ts as below:
export const props: EnvironmentProps = {
// set region and account explicitly.
awsRegion: 'ap-northeast-1',
awsAccount: '123456789012',
// Set your internal IP address ranges here.
allowedIPv4Cidrs: ['10.0.0.0/16'],
// The below two flags must be set for closed network deployment.
useCloudFront: false,
internalAlb: true,
// If Docker Hub is not accessible from your vpc subnets, set this property and run copy-to-ecr script (see step#2)
customEcrRepositoryName: 'dify-images',
// To let the CDK create a VPC with closed network, set this property.
vpcIsolated: true,
// Or, optionally you can import an existing VPC.
vpcId: 'vpc-12345678',
// Other properties can be configured as you like.
};
2. Open python-requirements.txt and remove all the dependencies from it This is only required if PyPI is not accessible from your vpc subnets. 3. Copy all the dify container images in Docker Hub to an ECR repository by executing npx ts-node scripts/copy-to-ecr.ts. The script handles all the tasks required to copy images. You will also need to run npm ci before this. You can create an ECR repository with the name of customEcrRepositoryName by yourself, or the script creates one if it does not exist yet. This script must be executed in an environment that has access to the Internet. Please run the script every time you change difyImageTag or difySandboxImageTag property. This is only required if Docker Hub is not accessible from your vpc subnets. 4. If you are using an existing VPC (vpcId property), make sure the required VPC endpoints are provisioned before deployment. See vpc-endpoints.ts for the list of required VPC endpoints. If you let CDK create a VPC (by setting vpcIsolated: true), all the endpoints are created automatically. 5. Deploy the CDK project following the Deploy section. 6. After the deployment, please configure Bedrock in Dify with the same AWS region as your VPC (see setup section) * This is only required if Bedrock API in other regions are not accessible from your vpc subnets.
[!WARNING] From Dify v1, you often need access to the PyPI server to install Dify plugins, which happens every time the plugin-daemon container starts. You can use solutions like pypi-mirror to avoid the limitation. See issue#69 for more details.
You can let Dify send emails to invite new users or reset passwords. To enable the feature, set setupEmail and domainName property in bin/cdk.ts. Note that you can only configure one email server (Amazon SES Identity) per domainName property.
After a successful deployment, you have to move out from SES sandbox to send emails to non-verified addresses and domains. Please refer to the document for more details: Request production access (Moving out of the Amazon SES sandbox)
DifyOnAwsStack.ConsoleConnectToTaskCommand = aws ecs execute-command --region ap-northeast-1 --cluster DifyOnAwsStack-ClusterEB0386A7-redacted --container Main --interactive --command "bash" --task $(...) ```
Execute this command to start an interactive bash session in the container, where you can run any commands needed for maintenance or migration tasks.
If you need to upgrade Dify without running automatic database migrations (e.g., to handle breaking changes manually), you can toggle the autoMigration flag:
autoMigration: false in lib/dify-on-aws-stack.ts (ApiService construct)ConsoleConnectToTaskCommand to connect to the containerautoMigration: true and deploy again to re-enable automatic migrationsFor a quick and convenient deployment, you can use the one-click deployment option available at: * One-Click Deployment for Dify on AWS
本リポジトリの使い方について、日本語で書かれた資料もあります: Dify on AWS 環境構築手順 (スライド形式) AWS CDKでDifyを一撃構築 * AWSマネージドサービスで Dify のセルフホスティングを試してみた
You can configure additional environment variables for Dify containers by using the additionalEnvironmentVariables property:
new DifySelfHostedOnAwsStack(app, 'DifySelfHostedOnAwsStack', {
additionalEnvironmentVariables: [
{
// Example of applying environment variable to all containers
key: 'GLOBAL_SETTING',
value: 'value',
// Omitting targets applies to all containers
},
{
// Example of referencing Systems Manager parameter
key: 'CONFIG_PARAM',
value: { parameterName: 'my-parameter' },
targets: ['web', 'api'],
},
{
// Example of referencing a specific field in Secrets Manager
key: 'API_KEY',
value: { secretName: 'my-secret', field: 'apiKey' },
targets: ['worker'],
},
],
});
This feature allows you to inject custom environment variables into Dify containers. The container types that can be specified in targets are 'web', 'api', 'worker', and 'sandbox'.
You can add Python packages that is available in Dify code execution feature. Edit python-requirements.txt following the Requirements File Format.
In some libraries, you have to allow additonal system calls in Dify sandbox. This CDK project let you to allow all the system calls by allowAnySysCalls flag in bin/cdk.ts.
[!WARNING] If you enable allowAnySysCalls flag, please make sure that code executed in your Dify tenant can be fully trusted.
Please also refer to this blog article for more details: Using any Python libraries in Dify's code block
该项目使用TypeScript编写,基于AWS CDK进行部署,易于维护和扩展,值得关注。
该工具使用 MIT-0 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
📄 MIT-0 — 请查阅原始协议条款了解具体使用限制。
总体来看,Dify AI应用开发平台 是一款质量良好的Dify应用,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | dify-self-hosted-on-aws |
| 原始描述 | 开源Dify应用:Self-host Dify on AWS。⭐188 · TypeScript |
| Topics | aws-cdkdifytypescript |
| GitHub | https://github.com/aws-samples/dify-self-hosted-on-aws |
| License | MIT-0 |
| 语言 | TypeScript |
收录时间:2026-05-18 · 更新时间:2026-05-19 · License:MIT-0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端