Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

aws-fis-experiment-prepareAWS FIS experiment prepare 搜索

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

1,997

周安装

80

GitHub Stars

公开资料未说明

下载量

646
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:aws-fis-experiment-prepare(AWS FIS experiment prepare 搜索)
来源仓库:https://github.com/panlm/skills
仓库路径:skills/aws-fis-experiment-prepare
安装命令:
npx skills add https://github.com/panlm/skills --skill aws-fis-experiment-prepare
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/panlm/skills --skill aws-fis-experiment-prepare

简介

用于自动生成并验证 AWS FIS 实验所需的全部配置文件,确保模板有效性。

  • 采用自愈式部署策略:首次部署失败则迭代修复直至堆栈成功,杜绝无效配置交付。
  • 输出包含 CFN 模板、IAM 角色、CloudWatch 仪表盘等完整实验工件目录。
  • 必须加载 references/output-format.md 与 cfn-base-template.md 获取标准格式要求。
  • 适用于混沌工程实践,帮助验证系统在部分故障下的容错能力。

SKILL.md

AWS FIS Experiment Prepare

Generate all configuration files needed to run an AWS FIS experiment, then deploy via CloudFormation with self-healing iteration until the stack succeeds. Outputs a self-contained directory with a validated, deployed experiment template ready for execution.

Core principle: Validate resource-action compatibility before generating files. Never deliver untested configuration — deploy and self-heal first.

References

Always load for every experiment:

  • references/output-format.md — directory layout, slug naming, README template
  • references/cfn-base-template.md — CFN skeleton (Parameters, IAM Role, Dashboard, FIS Template, Outputs)
  • references/slug-conventions.md — scenario/context slug abbreviations, resource naming, name length budget

Load conditionally by scenario:

  • references/az-power-interruption-guide.md — AZ Power Interruption (sub-action pruning, tagging strategy, permissions)
  • references/eks-pod-action-guide.md — any aws:eks:pod-* action (RBAC Lambda, EKS Access Entry, Pod memory stress calculation)
  • references/elasticache-redis-guide.md — ElastiCache Redis/Valkey (native AZ power interruption, primary node reboot via SSM Automation, or replication group failover via SSM Automation)
  • references/msk-guide.md — Amazon MSK (broker reboot via SSM Automation — no native FIS action exists)

Utility scripts (execute, do not read as reference):

  • scripts/precheck-cfn-permissions.sh — detects required CFN service role
  • scripts/deploy-with-retry.sh — validate + deploy + delete-on-fail
  • scripts/rename-output-dir.sh — appends FIS template ID to directory name

Script invocation: ${SKILL_DIR} refers to the absolute path of this skill's directory (where SKILL.md lives). Resolve it from the skill's filesystem location before running any scripts.

Output Language Rule

Detect the user's conversation language and use the same language for all output files (README.md, comments in JSON/YAML).

  • Chinese input → Chinese output
  • English input → English output
  • Mixed → follow the dominant language

Prerequisites

Required tools:

  • AWS CLIaws fis list-actions, resource discovery, CloudFormation
  • aws___search_documentation / aws___read_documentation — FIS docs research
  • jq — required by scripts/deploy-with-retry.sh and scripts/precheck-cfn-permissions.sh

EKS Pod fault injection: Cluster auth mode must be API_AND_CONFIG_MAP or API. Check:

aws eks describe-cluster --name {CLUSTER} \
  --query 'cluster.accessConfig.authenticationMode'

If CONFIG_MAP only, the user must update the cluster first. MANDATORY: For any aws:eks:pod-* action, follow references/eks-pod-action-guide.md.

Workflow

Step 1: Identify Scenario and Region

Classify user intent into one of these branches:

BranchTriggerAdditional Reference
Scenario LibraryAZ Power Interruption, AZ App Slowdown, Cross-AZ/Region scenariosRead AWS doc URL (table below)
Custom FIS actionUser specifies an action ID or describes a single fault
Custom FIS action (ElastiCache)ElastiCache AZ power interruption or Redis/Valkey failoverreferences/elasticache-redis-guide.md
SSM AutomationTarget service has no native FIS action (MSK, ElastiCache primary reboot, ElastiCache failover)references/msk-guide.md or references/elasticache-redis-guide.md

If ambiguous, ask the user.

Scenario Library documentation URLs (JSON templates are NOT available via CLI/API — read the doc to extract):

ScenarioDocumentation URL
AZ Power Interruptionhttps://docs.aws.amazon.com/en_us/fis/latest/userguide/az-availability-scenario.html
AZ Application Slowdownhttps://docs.aws.amazon.com/en_us/fis/latest/userguide/az-application-slowdown-scenario.html
Cross-AZ Traffic Slowdownhttps://docs.aws.amazon.com/en_us/fis/latest/userguide/cross-az-traffic-slowdown-scenario.html
Cross-Region Connectivityhttps://docs.aws.amazon.com/en_us/fis/latest/userguide/cross-region-scenario.html

Region detection order:

  1. User explicitly specifies
  2. Infer from context (ARNs, previous conversation)
  3. aws configure get region
  4. Ask the user

Store as TARGET_REGION.

Default experiment duration: PT10M (10 minutes) for all scenarios and sub-actions unless the user specifies otherwise. For AZ Power Interruption, scale ARC Zonal Autoshift timing proportionally (ARC starts at minute 2, runs for 8 minutes at PT10M; formula: startAfter = duration × (5/30)).

Step 2: Discover Target Resources

For Scenario Library Scenarios

CRITICAL: Scenario Library experiment templates CANNOT be generated via FIS API. You MUST call aws___read_documentation with the scenario URL (Step 1 table) to extract the JSON experiment template before generating any files. The documentation is the only authoritative source.

Target identification — prefer resourceArns over resourceTags:

  • Use resourceArns (exact ARNs) for most resource types — more precise, no pre-tagging needed
  • Exception — these types do NOT support resourceArns, use resourceTags instead:

- aws:elasticache:replicationgroup - aws:ec2:autoscaling-group

  • EKS pod actions use Kubernetes namespace + pod labels (neither resourceArns nor resourceTags)

resourceArns and filters are mutually exclusive. FIS rejects targets that specify both. For AZ-scoped targeting, either use resourceArns with only the target AZ's ARNs, or use resourceTags + filters together.

If scenario is AZ Power Interruption: follow references/az-power-interruption-guide.md for sub-action pruning, tagging strategy, permissions, and one-Stack-per-AZ design.

Ask the user:

  1. Which AZ to target (for AZ-level scenarios)
  2. Which services to include (for AZ Power Interruption) — if user mentions specific services, include ONLY those + mandatory infrastructure sub-actions
  3. Target resource identifiers (cluster IDs, instance IDs, etc.)

For Custom FIS Actions

aws fis get-action --id "ACTION_ID" --region TARGET_REGION

Extract required targets and parameters. Resolve user-provided identifiers to ARNs via AWS CLI.

For Services Without Native FIS Actions (SSM Automation)

  1. Confirm no native action exists: aws fis list-actions \ --query "actions[?starts_with(id, 'aws:{SERVICE}:')]" \ --region TARGET_REGION
  2. If empty, follow the service-specific guide:

- Amazon MSK → references/msk-guide.md - ElastiCache primary node reboot → references/elasticache-redis-guide.md (Scenario 2) - Other services → not yet documented. Stop and inform the user.

Special case — ElastiCache: Has a native FIS action for AZ-level impact (aws:elasticache:replicationgroup-interrupt-az-power) but no native action for single-node reboot or replication group failover. For primary node reboot, use SSM Automation per references/elasticache-redis-guide.md → Scenario 2. For replication group failover (TestFailover), use SSM Automation per references/elasticache-redis-guide.md → Scenario 3.

  1. Discover resources via the target service's CLI (aws kafka list-clusters, etc.).

Step 2.5: EKS Pod Action Setup Gate

**If the experiment includes ANY aws:eks:pod-* action, complete this gate BEFORE Step 3.**

Applicable actions: aws:eks:pod-cpu-stress, aws:eks:pod-delete, aws:eks:pod-io-stress, aws:eks:pod-memory-stress, aws:eks:pod-network-blackhole-port, aws:eks:pod-network-latency, aws:eks:pod-network-packet-loss.

  1. Read the official documentation: aws___read_documentation: url: https://docs.aws.amazon.com/fis/latest/userguide/eks-pod-actions.html
  2. Follow ALL requirements in references/eks-pod-action-guide.md:

- Lambda-backed CFN Custom Resource for K8s RBAC (fixed names: fis-sa, fis-experiment-role, fis-experiment-role-binding) - EKS Access Entry for FIS Experiment Role (Username: fis-experiment) - Cluster auth mode check (API_AND_CONFIG_MAP or API) - Pod readOnlyRootFilesystem: false check - Network action limitations (no Fargate, no bridge mode) - Pod memory stress threshold calculation (if action is aws:eks:pod-memory-stress) — user's percent is total target, not injection value

Do NOT skip. EKS pod actions have complex setup requirements that differ significantly from other FIS actions.

Step 3: Validate Resource-Action Compatibility

CRITICAL GATE. Before generating any files, verify that the user's actual resources are compatible with the chosen FIS action(s).

3a. Inspect the Actual Resource

User SaysCLI CommandKey Fields
RDS databaseaws rds describe-db-instances --db-instance-identifier {ID}Engine, DBClusterIdentifier
RDS/Aurora clusteraws rds describe-db-clusters --db-cluster-identifier {ID}Engine, EngineMode, MultiAZ
EC2 instanceaws ec2 describe-instances --instance-ids {ID}InstanceType, Placement.AvailabilityZone
EKS clusteraws eks describe-cluster --name {NAME}accessConfig.authenticationMode, version
ElastiCacheaws elasticache describe-replication-groups --replication-group-id {ID}NodeGroupConfiguration, MultiAZ
ASGaws autoscaling describe-auto-scaling-groups --auto-scaling-group-names {NAME}AvailabilityZones, Instances

3b. Cross-Check Against FIS Action Requirements

aws fis get-action --id "ACTION_ID" --region TARGET_REGION \
  --query 'action.targets' --output json

Common incompatibility traps:

FIS ActionRequired resourceTypeIncompatible WithDetection
aws:rds:failover-db-clusteraws:rds:clusterStandalone RDS (non-Aurora)DBClusterIdentifier is null
aws:rds:reboot-db-instancesaws:rds:dbAurora clustersEngine starts with aurora
aws:elasticache:replicationgroup-interrupt-az-poweraws:elasticache:replicationgroupStandalone ElastiCache nodesNo replication group
aws:ec2:stop-instancesaws:ec2:instanceSpot instancesInstanceLifecycle = spot

3c. Decision Gate

  • Compatible → proceed to Step 4.
  • Incompatible → explain the mismatch, suggest alternatives based on the actual resource type, ask the user to confirm or abort.

Example alternatives:

  • Standalone RDS Multi-AZ → aws:rds:reboot-db-instances with --force-failover
  • Aurora cluster → aws:rds:failover-db-cluster
  • ElastiCache standalone → explain replication group is required

3d. For Scenario Library Scenarios

Validate EACH included sub-action against its target resources. Only validate sub-actions that remain after service-scoped pruning (Step 2).

Step 4: Determine Monitoring Configuration

Stop Conditions — default: source: "none" (no alarm). Only create a CloudWatch Alarm if the user explicitly provides one.

Dashboard Metrics — comprehensive, per-service. Group widgets by service, 3 widgets per service (availability, performance, errors/latency). Include only services actually affected by the experiment.

ServiceMetrics
EC2StatusCheckFailed, CPUUtilization, NetworkIn/Out, NetworkPacketsIn/Out
RDS/AuroraDatabaseConnections, ReadLatency, WriteLatency, AuroraReplicaLag, FreeableMemory
EKSpod_number_of_running_pods, pod_number_of_container_restarts, node_cpu_utilization, node_memory_utilization
ElastiCacheReplicationLag, EngineCPUUtilization, CurrConnections, CacheHitRate, Evictions, IsMaster
ALBHealthyHostCount, UnHealthyHostCount, HTTPCode_ELB_5XX_Count, TargetResponseTime
NLBActiveFlowCount, TCP_Client_Reset_Count, TCP_Target_Reset_Count

Step 5: Generate Configuration Files

Create output directory:

# ─── Fill in from user's request + references/slug-conventions.md ───
SCENARIO_SLUG="..."         # e.g., pod-delete, az-power-int, rds-failover
TARGET_RESOURCE_ID="..."    # e.g., my-aurora-cluster, i-0abc123def
CONTEXT_NAME=""             # optional (e.g., redis, msk); leave empty if N/A
# ────────────────────────────────────────────────────────────────────

# Derived values (do not edit):
TARGET_SLUG=$(echo "${TARGET_RESOURCE_ID}" | tr '[:upper:]' '[:lower:]' | tr ' :/' '-' | cut -c1-20)
CONTEXT_SLUG=$(echo "${CONTEXT_NAME}" | tr '[:upper:]' '[:lower:]' | tr ' :/' '-' | cut -c1-10)
TIMESTAMP=$(TZ=Asia/Shanghai date +%Y-%m-%d-%H-%M-%S)

if [ -n "${CONTEXT_SLUG}" ]; then
    OUTPUT_DIR="./${TIMESTAMP}-${SCENARIO_SLUG}-${TARGET_SLUG}-${CONTEXT_SLUG}"
else
    OUTPUT_DIR="./${TIMESTAMP}-${SCENARIO_SLUG}-${TARGET_SLUG}"
fi
mkdir -p "${OUTPUT_DIR}"

REQUIRED: Before generating cfn-template.yaml, read the AWS::FIS::ExperimentTemplate CloudFormation resource documentation:

aws___read_documentation:
  url: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-fis-experimenttemplate.html

ALSO REQUIRED: Search for CloudFormation examples for the resources used:

aws___search_documentation:
  search_phrase: "<CFN resource types in this experiment>"
  topics: ["cloudformation"]

Generate files:

  1. cfn-template.yaml — use references/cfn-base-template.md as the skeleton. Extend with scenario-specific resources per:

- references/az-power-interruption-guide.md (if AZ Power Interruption) - references/eks-pod-action-guide.md (if EKS pod actions) - references/msk-guide.md (if MSK) - references/elasticache-redis-guide.md (if ElastiCache)

  1. README.md — use the template in references/output-format.md.

Step 5.5: CFN Permission Pre-Check

Run the precheck script to detect whether a CFN service role is required:

CFN_ROLE_ARN=$("${SKILL_DIR}/scripts/precheck-cfn-permissions.sh")

If the caller lacks CloudFormation permissions, the script exits 1 with guidance — stop and inform the user. Otherwise, CFN_ROLE_ARN is either empty (no service role needed) or contains the required role ARN.

Step 6: Deploy CFN Template (Self-Healing Loop)

Generate deployment parameters:

# See references/slug-conventions.md for the ExperimentName composition rule
RANDOM_SUFFIX=$(LC_ALL=C tr -dc 'a-z0-9' < /dev/urandom | head -c6)

if [ -n "${CONTEXT_SLUG}" ]; then
    EXPERIMENT_NAME="${SCENARIO_SLUG}-${TARGET_SLUG}-${CONTEXT_SLUG}-${RANDOM_SUFFIX}"
else
    EXPERIMENT_NAME="${SCENARIO_SLUG}-${TARGET_SLUG}-${RANDOM_SUFFIX}"
fi
STACK_NAME="fis-${EXPERIMENT_NAME}"

Deploy with self-healing retry loop (maximum 5 attempts driven by the agent). The deploy-with-retry.sh script performs one attempt — the agent drives the loop externally. On each attempt:

  1. Run scripts/deploy-with-retry.sh: "${SKILL_DIR}/scripts/deploy-with-retry.sh" \ "${OUTPUT_DIR}/cfn-template.yaml" \ "${STACK_NAME}" \ "${TARGET_REGION}" \ "${CFN_ROLE_ARN}" \ "ExperimentName=${EXPERIMENT_NAME}" \ "RandomSuffix=${RANDOM_SUFFIX}"
  2. Exit 0 → deployment succeeded, proceed to "On Successful Deployment".
  3. Exit 1 (validation failed) or 2 (deployment failed, stack deleted) → analyze stderr output, fix cfn-template.yaml, increment attempt counter, re-invoke the script.
  4. After 5 failed attempts → stop and report to the user with the last error, all fixes attempted, and the current cfn-template.yaml.

Common CFN errors and fixes:

Error PatternRoot CauseFix
Property validation failureInvalid CFN property name/valueFix the resource property
Template format errorYAML syntax issueFix indentation/structure
Resource type not supportedResource unavailable in regionCheck regional availability
Circular dependencyResources reference each otherUse DependsOn or restructure
RoleArn... is invalidIAM role not yet propagatedAdd DependsOn for IAM role
Empty logConfigurationAZ Power Interruption doc artifactRemove the logConfiguration block

On Successful Deployment

  1. Extract stack outputs: aws cloudformation describe-stacks \ --stack-name "${STACK_NAME}" \ --query 'Stacks[0].Outputs' \ --region "${TARGET_REGION}" --output table
  2. Update README.md with actual stack name, template ID, dashboard URL, and cleanup command. Replace ALL {STACK_NAME} placeholders — do NOT leave placeholders in the final output.

Step 7: Rename Output Directory with Template ID

Run the rename script:

NEW_OUTPUT_DIR=$("${SKILL_DIR}/scripts/rename-output-dir.sh" \
    "${OUTPUT_DIR}" \
    "${STACK_NAME}" \
    "${TARGET_REGION}")
OUTPUT_DIR="${NEW_OUTPUT_DIR}"

Update README.md's **Directory:** field with the full absolute path of the renamed directory. If CFN deployment failed (Step 6 exceeded max retries), skip this step.

Print a brief summary to the terminal:

  • Experiment output directory (with template ID)
  • CFN stack name and deployment status
  • Experiment template ID
  • Next step instruction

Important Guidelines

  • Scenario Library templates come from documentation. Call aws___read_documentation on the scenario's doc URL (Step 1 table) before generating any files. The documentation is the only authoritative source.
  • Never start the FIS experiment in this skill. Starting the experiment is handled by aws-fis-experiment-execute or manually by the user.
  • Validate resource-action compatibility BEFORE generating files (Step 3). The most common source of wasted effort is deploying a template that targets an incompatible resource.
  • Always deploy and validate. Do not just generate files — deploy the CFN template and iterate until it succeeds (Step 6). The user should receive a working, deployed experiment template ready to start.
  • Self-heal on CFN errors. Read stack events, diagnose, fix the template, delete the failed stack, retry. Do not ask the user to fix CFN errors.
  • Verify FIS action availability (aws fis list-actions / aws fis get-action) before generating templates. Don't fabricate action IDs.
  • Prefer resourceArns over resourceTags for targets. Exceptions: aws:elasticache:replicationgroup, aws:ec2:autoscaling-group. Never combine resourceArns with filters.
  • IAM policy must be least-privilege. Only include permissions for the specific actions in the experiment.
  • CFN template must be self-contained. Deploy the CFN template and get a working experiment without any other steps.
  • Sequential MCP calls. All aws___read_documentation and aws___search_documentation calls must be sequential, never parallel. Retry up to 10 times on rate limit errors.
  • Keep local files in sync. After successful deployment, update README.md with real ARNs and stack outputs.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.58%
按下载量换算243

Claude

32.04%
按下载量换算207

Cursor

17.06%
按下载量换算110

Gemini CLI

9.91%
按下载量换算64

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills