Dotnet Aws Ecs 标志

Dotnet Aws Ecs

组织
aws-samples
dotnet-aws-ecs

生成 IaC(CloudFormation 或 CDK)和部署指南,用于将 .NET 工作负载部署到使用 Linux 容器的 Amazon ECS Fargate,并搭配 Application Load Balancer。生成内容包括 VPC、ECS 集群、任务定义、ALB 和自动扩缩。 不适用于 Windows 容器、EC2 启动类型或 Kubernetes/EKS 部署。

Add to TypingMind

概览

发布者aws-samples
代码仓库sample-apex-skills
技能名称dotnet-aws-ecs
星标数
90
复刻数
20
附带文件
6
许可协议MIT-0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 6 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 aws-samples 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Dotnet Aws Ecs AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/aws-samples/sample-apex-skills/tree/main/skills/dotnet-aws-ecs
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/aws-samples/sample-apex-skills.git /tmp/sample-apex-skills
mkdir -p .claude/skills
cp -r /tmp/sample-apex-skills/skills/dotnet-aws-ecs .claude/skills/dotnet-aws-ecs
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Dotnet Aws Ecs,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Dotnet Aws Ecs。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Dotnet Aws Ecs 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Deploy .NET Workload to AWS ECS Fargate

When to Use This Skill

Use this skill when:

  • A .NET application (Web API, ASP.NET Core MVC/Razor, Blazor Server) is running locally and ready for cloud deployment
  • The developer wants to deploy to ECS Fargate (serverless containers) on AWS
  • The developer wants IaC that provisions everything in a single stack

Do NOT use this skill for:

  • Applications that aren't yet running locally
  • Windows container deployments
  • EC2 launch type deployments
  • Kubernetes/EKS deployments
  • Serverless (Lambda) deployments

Objective

Produce IaC (CloudFormation or CDK — user chooses) and a step-by-step deployment guide. The output provisions:

  • VPC with public and private subnets (2 AZs) — or uses an existing VPC and subnets provided by the user
  • Application Load Balancer (internet-facing or internal)
  • ECS Cluster with Fargate service (2 tasks)
  • ECR repository for the container image
  • IAM roles (task execution + task role)
  • Auto-scaling (CPU-based target tracking)
  • CloudWatch log group

Keep it focused on compute and networking. No databases, caches, or auth services.

Recommended MCP Server

This skill works best when the AWS Knowledge MCP server is configured. It provides access to up-to-date AWS documentation for ECS, CloudFormation, CDK, and related services.

  • URL: https://knowledge-mcp.global.api.aws
  • Usage: When generating IaC or resolving deployment issues, use the AWS Knowledge MCP to look up current resource property schemas, valid parameter values, and best practices (e.g., search_documentation for ECS task definition properties, Fargate platform versions, ALB listener rules, or CDK construct APIs).

If the MCP is not configured, the skill will still work using embedded guidance in the reference files, but results may not reflect the latest AWS service changes.

Phases

Phase 0 — Gather Information

Before generating anything, determine:

  1. Application details — find the web project, read .csproj for TargetFramework, check Program.cs for health check path
  2. Container port — check ASPNETCORE_URLS, launchSettings.json, or default (8080 for .NET 8+, 5000 for earlier)
  3. Existing Dockerfile — if one exists alongside the project, use it; otherwise generate one in Phase 2

Ask the Developer

  • IaC format: "Do you prefer CloudFormation (YAML) or CDK (C#)?"
  • VPC selection: "Would you like to deploy into a new VPC (default) or an existing VPC?"
    • If the user chooses existing VPC, ask for the VPC ID and subnet IDs (2 public, 2 private).
    • Optionally, if the AWS CLI is available and an AWS profile is configured, offer to retrieve the list of existing VPCs and their subnets by running:
      bash
      aws ec2 describe-vpcs --query "Vpcs[*].{VpcId:VpcId,Name:Tags[?Key=='Name']|[0].Value,CidrBlock:CidrBlock}" --output table
      Then, once the user selects a VPC:
      bash
      aws ec2 describe-subnets --filters "Name=vpc-id,Values=<vpc-id>" --query "Subnets[*].{SubnetId:SubnetId,AZ:AvailabilityZone,CidrBlock:CidrBlock,Name:Tags[?Key=='Name']|[0].Value,Public:MapPublicIpOnLaunch}" --output table
      Important: Always ask for user approval before running any AWS CLI commands.
  • ALB scheme: "Should the load balancer be internet-facing or internal?"
  • Container health check: "By default, the chiseled (minimal) Docker image is used for security. This means the ECS console will show container health as 'Unknown' since chiseled images have no shell or curl — the ALB health check still protects against unhealthy tasks. Would you like to enable the ECS container health check instead? This requires switching to a non-chiseled image (larger, but gives explicit 'Healthy' status in the ECS console)."
    • If the user chooses container health check: use the non-chiseled runtime image (-noble) in the Dockerfile and add a HealthCheck block to the task definition container. See references/cloudformation-template-guide.md § "Container Health Check" and references/dockerfile-guide.md § "Non-Chiseled Alternative".
    • If the user declines (default): use the chiseled image and do not add a container-level health check. After deployment, inform the user that "Unknown" container health in the ECS console is expected.
  • Target AWS region (default to ap-southeast-1 if not specified)
  • Environment name (default to dev if not specified)

Phase 1 — Generate IaC

Generate the ECS Fargate infrastructure based on the user's IaC choice.

Read references/cloudformation-template-guide.md for CloudFormation structure, or references/cdk-template-guide.md for CDK structure.

New VPC (default)

Both formats must include:

  • VPC, subnets (2 public, 2 private), Internet Gateway, NAT Gateways, route tables
  • ALB security group, ECS task security group
  • Application Load Balancer (scheme per user choice), target group, HTTP listener
  • ECR repository
  • ECS cluster, task definition (Fargate, Linux, 256 CPU / 512 MiB), service (2 tasks)
  • IAM roles: ECS Task Execution Role, ECS Task Role
  • Auto-scaling: target tracking on CPU at 70%
  • CloudWatch log group
Existing VPC

When the user opts to deploy into an existing VPC, the template must:

  • Accept VPC ID and subnet IDs as parameters (no VPC/subnet/gateway/route resources are created)
  • Still create all security groups, ALB, ECS, ECR, IAM, auto-scaling, and log group resources
  • Reference the provided VPC/subnet IDs wherever the new-VPC template would reference !Ref VPC or !Ref PublicSubnet1, etc.

See the "Existing VPC Mode" sections in references/cloudformation-template-guide.md and references/cdk-template-guide.md for implementation details.

Output Location
  • CloudFormation: <project-root>/infra/ecs-fargate.yaml
  • CDK: <project-root>/infra/EcsFargate.Cdk/

Phase 2 — Generate Dockerfile

If the application doesn't already have a Dockerfile, generate one.

Read references/dockerfile-guide.md for the patterns.

Key points:

  • Multi-stage build (SDK → chiseled-ubuntu runtime)
  • Match base image to TargetFramework
  • Expose the correct port
  • Run as non-root user via $APP_UID (chiseled images have no shell/adduser)
  • Place alongside the web project (same directory as the .csproj)
  • Place .dockerignore at the Docker build context root, not inside the web project folder

Phase 2.5 — Validate Docker Build Locally

After generating the Dockerfile, validate the Docker image builds successfully.

Read references/dockerfile-guide.md § "Local Validation" for the procedure.

Key points:

  • Check if Docker is installed locally; if not, skip validation and add a manual validation section to the deployment guide
  • Run docker build from the build context root
  • Run the container briefly to confirm the runtime starts (expect DB connection errors if no database is available — that's OK)
  • Clean up all test containers and images after validation
  • If the build fails, fix the Dockerfile and retry before proceeding

Phase 3 — Generate Deployment Guide

Produce a markdown deployment guide with step-by-step CLI commands.

Read references/deployment-guide-template.md for the structure.

The guide must cover:

  1. Prerequisites (AWS CLI, Docker)
  2. Deploy the infrastructure stack
  3. Build and push the container image to ECR
  4. Update the ECS service to pull the new image
  5. Verify deployment (ALB URL, ECS service status, logs)
  6. Cleanup (delete stack, delete ECR images)
  7. Cost estimation
  8. Next steps (HTTPS, custom domain, CI/CD)
Output Location

<project-root>/infra/DEPLOYMENT.md

Constraints

  • Single stack — not multiple stacks or nested stacks
  • Use !Sub with ${EnvironmentName} prefix for resource names (CloudFormation) or equivalent parameterization (CDK)
  • All ECS tasks in private subnets, ALB in public subnets
  • Default to 256 CPU / 512 MiB for dev — add comments noting production sizing
  • 2 desired tasks with deployment circuit breaker enabled
  • Do NOT include databases, caches, queues, or auth services
  • Do NOT hardcode account IDs or regions
  • Dockerfile lives alongside the .csproj (application source), NOT in the infra/ folder

Output Structure

<project-root>/
├── infra/
│   ├── ecs-fargate.yaml              # CloudFormation template (if chosen)
│   ├── EcsFargate.Cdk/               # CDK project (if chosen)
│   └── DEPLOYMENT.md                 # Step-by-step deployment guide
├── <WebProject>/
│   └── Dockerfile                    # If not already present (alongside .csproj)

Reporting

After generation, summarize:

  • What the stack provisions
  • IaC format chosen
  • VPC mode (new VPC or existing VPC with ID)
  • ALB scheme (internet-facing or internal)
  • Estimated monthly cost (dev environment)
  • Any manual steps required
  • Suggested next steps

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Dotnet Aws Ecs AI 技能有什么作用?

生成 IaC(CloudFormation 或 CDK)和部署指南,用于将 .NET 工作负载部署到使用 Linux 容器的 Amazon ECS Fargate,并搭配 Application Load Balancer。生成内容包括 VPC、ECS 集群、任务定义、ALB 和自动扩缩。 不适用于 Windows 容器、EC2 启动类型或 Kubernetes/EKS 部署。

为什么在 TypingMind 中使用 Dotnet Aws Ecs?

因为您只需安装一次,就能搭配任何模型使用。Dotnet Aws Ecs 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Dotnet Aws Ecs?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/aws-samples/sample-apex-skills/tree/main/skills/dotnet-aws-ecs。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Dotnet Aws Ecs?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Dotnet Aws Ecs 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Dotnet Aws Ecs 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Dotnet Aws Ecs AI 技能免费吗?

是的。aws-samples 已在 GitHub 上根据 MIT-0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇