Behavior validator
Skill pantheon-org/tekhne/skills/infrastructure/cfn/behavior-validator
Agents Skills
npx -y skills add pantheon-org/tekhne --skill behavior-validatorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 9 stars9 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Creates test stacks, analyzes CloudFormation events, and compares actual vs documented update behavior to validate whether resource property changes trigger replacement or in-place updates. Use when: a user wants to test if a CFN property change causes resource replacement; when investigating stack update behavior or "Update requires" documentation accuracy; when validating whether a workaround (e.g. hash-based logical IDs) is actually necessary; when questioning UpdateRequiresReplacement behavior for immutable properties; when empirical evidence is needed before an architectural decision involving CDK or CloudFormation stack updates.
SKILL.md
5.8 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
CloudFormation Resource Update Behavior Validator
Purpose
Empirically validate how CloudFormation handles specific resource property changes by deploying a controlled test stack, making a targeted change, and observing actual CFN events — then deciding whether workarounds are justified.
Workflow
1. Research
- Find the resource's CloudFormation reference page; note "Update requires" for the target property.
- Search GitHub (AWS CDK repo), Stack Overflow, and AWS re:Post for community reports of discrepancies.
- State a hypothesis: "Docs say Replacement — does CFN actually replace the resource?"
2. Design Minimal Test Stack
- Use a non-production, disposable environment.
- Isolate the single property under test; remove unrelated resources.
- Define observable success criteria (e.g. DELETE + CREATE events for the resource type).
// Example: minimal CDK stack parameterised via context
export class BehaviorTestStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// Add only the resource under test, driven by this.node.tryGetContext(...)
}
}
3. Execute Test
# 1. Deploy initial state
cdk deploy --require-approval never
# 2. Record resource ARNs / IDs, confirm any required manual steps (e.g. email confirmation)
# 3. Make the single property change, then redeploy
cdk deploy --require-approval never
# 4. Inspect CFN events — stop and debug if deployment fails before proceeding
aws cloudformation describe-stack-events \
--stack-name <stack-name> \
--query 'StackEvents[?ResourceType==`<ResourceType>`].[Timestamp,ResourceStatus,ResourceStatusReason]' \
--output table
Validation gates:
- If initial deployment fails → stop and fix before making any changes.
- If events show unexpected behavior → document immediately and abort further changes.
- If behavior is ambiguous → repeat the test to confirm repeatability.
4. Document Findings & Decide
## CloudFormation Behavior Test Results
- **Date / Region / CDK Version:**
- **Resource Type & Property Changed:**
- **AWS Docs Say:** "Update requires: ..."
- **What Actually Happened:** [UPDATE_IN_PLACE | REPLACEMENT | NO-OP | error]
- **CFN Events:** [paste relevant rows]
- **Matches Docs:** Yes / No
- **Workaround Needed:** Yes / No — Reasoning: ...
- **Code Changes:** [commit/PR link]
Update the code: implement or remove the workaround and add a comment citing this test.
Related Skills
cfn-template-compare— Compare deployed vs local templatesaws-cdk— General AWS CDK developmentterraform-validator— Similar testing for Terraform
Anti-Patterns
NEVER assume UPDATE_REQUIRES_REPLACEMENT from documentation without testing
- WHY: AWS documentation for resource property behavior is sometimes incorrect or lags behind API changes; only testing against an actual stack confirms actual replacement behavior.
- BAD: Trust the CloudFormation docs that say a property change is "No interruption" and skip testing.
- GOOD: Create a test stack and apply the change to observe actual behavior via stack events.
NEVER test behavior-changing updates on production stacks
- WHY: Replacement validation creates and deletes resources; testing on production risks unintended downtime or data loss.
- BAD: Test property change behavior directly on a prod stack to "save time".
- GOOD: Use a dedicated test stack in a non-production account with realistic (but non-sensitive) configuration.
NEVER ignore UPDATE_ROLLBACK_FAILED stack status
- WHY: A stack in this state cannot be updated or deleted without manual intervention; document the recovery procedure whenever behavior testing triggers a rollback.
- BAD: Treat
UPDATE_ROLLBACK_FAILEDas a transient error and retry. - GOOD: Use
continue-update-rollbackwith skipped resources, or manually resolve the failed resource before retrying.
NEVER compare template drift without accounting for CDK synthesizer metadata
- WHY: CDK-synthesized templates include
aws:cdk:pathmetadata and synthesizer version fields that differ between environments but are not functional differences; filter these before comparing. - BAD: Flag every metadata field difference as drift.
- GOOD: Normalize templates by stripping CDK-specific metadata keys before comparison.
References
| Script | Location | Purpose |
|---|---|---|
watch-cfn-events.sh | ./scripts/watch-cfn-events.sh | Stream CFN events in real-time during deployment |
compare-resources.sh | ./scripts/compare-resources.sh | Diff resource properties before and after deployment |
See EXAMPLES.md in this skill directory for a full walkthrough of an SNS email subscription endpoint change test.
What ships with it: 10 files
34.1 KB alongside SKILL.md, 2 of them executable
.tessl-plugin/
- plugin.json784 B
evals/
- scenario-01.md4.8 KB
- scenario-02.md3.6 KB
- scenario-03.md3.9 KB
- scenario-04.md4.0 KB
- scenario-05.md3.4 KB
references/
- sns-testing-guide.md7.6 KB
scripts/
- compare-resources.shruns3.4 KB
- watch-cfn-events.shruns2.2 KB
- CHANGELOG.md374 B