vybekiit 0.7.25 → 0.7.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +3891 -1301
- package/dist/global-skills/aws-cdk/SKILL.md +19 -5
- package/dist/global-skills/aws-cdk/references/fast-deployments.md +191 -0
- package/dist/global-skills/aws-cdk/references/troubleshooting-deployment.md +16 -0
- package/dist/global-skills/aws-cloudformation/SKILL.md +16 -26
- package/dist/global-skills/aws-cloudformation/references/check-cloudformation-template-compliance.script.md +7 -3
- package/dist/global-skills/aws-cloudformation/references/cloudformation-language-server.md +177 -0
- package/dist/global-skills/aws-cloudformation/references/cloudformation-pre-deploy-validation.script.md +8 -2
- package/dist/global-skills/aws-cloudformation/references/persist-template-context.script.md +5 -8
- package/dist/global-skills/aws-cloudformation/references/retrieve-template-context.script.md +1 -1
- package/dist/global-skills/aws-cloudformation/references/security-considerations.md +51 -0
- package/dist/global-skills/aws-cloudformation/references/troubleshoot-failed-stack.script.md +138 -0
- package/dist/global-skills/aws-cloudformation/references/{validate-cloudformation-template.script.md → validate-with-cfn-lint.script.md} +15 -27
- package/dist/global-skills/aws-cloudformation/references/validate-with-cloudformation-validate.script.md +181 -0
- package/dist/global-skills/aws-cloudformation/references/validation-tool-selection.md +44 -0
- package/dist/global-skills/aws-serverless/SKILL.md +9 -1
- package/dist/global-skills/aws-serverless/references/architecture.md +3 -1
- package/dist/global-skills/aws-serverless/references/lambda.md +3 -1
- package/dist/global-skills/aws-serverless/references/orchestration.md +1 -0
- package/dist/global-skills/better-auth-best-practices/SKILL.md +18 -8
- package/dist/global-skills/eas-app-stores/SKILL.md +31 -15
- package/dist/global-skills/eas-app-stores/agents/openai.yaml +2 -2
- package/dist/global-skills/eas-app-stores/references/ios-app-store.md +37 -32
- package/dist/global-skills/eas-app-stores/references/native-ios.md +167 -0
- package/dist/global-skills/eas-app-stores/references/play-store.md +3 -7
- package/dist/global-skills/eas-app-stores/references/testflight.md +39 -35
- package/dist/global-skills/eas-simulator/SKILL.md +48 -26
- package/dist/global-skills/eas-simulator/references/controllers.md +32 -3
- package/dist/global-skills/eas-simulator/references/run-your-app.md +34 -4
- package/dist/global-skills/eas-simulator/references/troubleshooting.md +8 -4
- package/dist/global-skills/eas-update/SKILL.md +146 -0
- package/dist/global-skills/eas-update/agents/openai.yaml +4 -0
- package/dist/global-skills/expo-animation/RECIPES.md +2 -2
- package/dist/global-skills/expo-animation/SKILL.md +9 -2
- package/dist/global-skills/expo-brownfield/SKILL.md +18 -11
- package/dist/global-skills/expo-brownfield/agents/openai.yaml +2 -2
- package/dist/global-skills/expo-brownfield/references/brownfield-integrated.md +94 -69
- package/dist/global-skills/expo-brownfield/references/brownfield-isolated.md +40 -42
- package/dist/global-skills/expo-brownfield/references/comparison.md +5 -5
- package/dist/global-skills/expo-brownfield/references/feature-integration.md +163 -0
- package/dist/global-skills/expo-brownfield/references/troubleshooting.md +17 -17
- package/dist/global-skills/expo-brownfield/references/version-compatibility.md +40 -0
- package/dist/global-skills/expo-data-fetching/SKILL.md +27 -6
- package/dist/global-skills/expo-design-system/SKILL.md +27 -7
- package/dist/global-skills/expo-design-system/references/audit.md +7 -2
- package/dist/global-skills/expo-design-system/references/native-slop.md +74 -0
- package/dist/global-skills/expo-examples/SKILL.md +0 -1
- package/dist/global-skills/expo-examples/references/catalog.md +1 -1
- package/dist/global-skills/expo-migrate-module/SKILL.md +21 -10
- package/dist/global-skills/expo-migrate-module/references/compatibility.md +80 -23
- package/dist/global-skills/expo-migrate-module/references/migration-map.md +162 -11
- package/dist/global-skills/expo-native-ui/SKILL.md +25 -16
- package/dist/global-skills/expo-native-ui/agents/openai.yaml +2 -2
- package/dist/global-skills/expo-native-ui/references/controls.md +5 -46
- package/dist/global-skills/expo-native-ui/references/icons.md +21 -2
- package/dist/global-skills/expo-native-ui/references/media.md +15 -20
- package/dist/global-skills/expo-native-ui/references/visual-effects.md +12 -11
- package/dist/global-skills/expo-overview/SKILL.md +17 -12
- package/dist/global-skills/expo-router/SKILL.md +5 -3
- package/dist/global-skills/expo-router/references/tabs.md +5 -5
- package/dist/global-skills/expo-skill-eval/scripts/check-static.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/clean-fixture.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/latest-sdk.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/make-fixture.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/make-workspace.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/snapshot-android.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/snapshot-ios.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/snapshot-web.sh +0 -0
- package/dist/global-skills/expo-upgrade/SKILL.md +3 -1
- package/dist/global-skills/expo-web-to-native/references/false-friends.md +2 -2
- package/dist/global-skills/expo-web-to-native/references/native-patterns.md +1 -1
- package/dist/global-skills/firebase-ai-logic-basics/SKILL.md +13 -16
- package/dist/global-skills/firebase-ai-logic-basics/references/ios_setup.md +4 -5
- package/dist/global-skills/firebase-ai-logic-basics/references/usage_patterns_android.md +4 -4
- package/dist/global-skills/firebase-ai-logic-basics/references/usage_patterns_web.md +3 -3
- package/dist/global-skills/firebase-auth-basics/SKILL.md +11 -6
- package/dist/global-skills/firebase-auth-basics/references/client_sdk_android.md +4 -5
- package/dist/global-skills/firebase-auth-basics/references/client_sdk_web.md +3 -3
- package/dist/global-skills/firebase-auth-basics/references/flutter_setup.md +24 -25
- package/dist/global-skills/firebase-auth-basics/references/security_rules.md +4 -2
- package/dist/global-skills/firebase-crashlytics/references/android_setup.md +7 -4
- package/dist/global-skills/firebase-crashlytics/references/ios_setup.md +2 -3
- package/dist/global-skills/firebase-data-connect/SKILL.md +2 -1
- package/dist/global-skills/firebase-data-connect/examples.md +4 -4
- package/dist/global-skills/firebase-data-connect/reference/config.md +5 -4
- package/dist/global-skills/firebase-data-connect/reference/realtime.md +1 -2
- package/dist/global-skills/firebase-data-connect/reference/sdk_flutter.md +2 -2
- package/dist/global-skills/firebase-data-connect/reference/sdk_ios.md +2 -2
- package/dist/global-skills/firebase-data-connect/reference/sdk_web.md +17 -6
- package/dist/global-skills/firebase-data-connect/reference/security.md +5 -5
- package/dist/global-skills/firebase-data-connect/templates.md +2 -1
- package/dist/global-skills/firebase-firestore/SKILL.md +20 -8
- package/dist/global-skills/firebase-firestore/references/enterprise/android_sdk_usage.md +5 -4
- package/dist/global-skills/firebase-firestore/references/enterprise/data_model.md +12 -3
- package/dist/global-skills/firebase-firestore/references/enterprise/indexes.md +16 -18
- package/dist/global-skills/firebase-firestore/references/enterprise/provisioning.md +1 -1
- package/dist/global-skills/firebase-firestore/references/enterprise/python_sdk_usage.md +5 -1
- package/dist/global-skills/firebase-firestore/references/enterprise/web_sdk_usage.md +7 -7
- package/dist/global-skills/firebase-firestore/references/standard/android_sdk_usage.md +5 -5
- package/dist/global-skills/firebase-firestore/references/standard/flutter_setup.md +4 -4
- package/dist/global-skills/firebase-firestore/references/standard/indexes.md +16 -18
- package/dist/global-skills/firebase-firestore/references/standard/provisioning.md +1 -1
- package/dist/global-skills/firebase-remote-config-basics/SKILL.md +0 -5
- package/dist/global-skills/firebase-remote-config-basics/references/android_setup.md +36 -8
- package/dist/global-skills/firebase-remote-config-basics/references/ios_setup.md +1 -7
- package/dist/global-skills/firebase-security-rules-auditor/SKILL.md +17 -6
- package/dist/global-skills/{firebase-firestore/references/standard/security_rules.md → firestore-rules-creation/SKILL.md} +24 -13
- package/dist/global-skills/grow-my-customers/SKILL.md +23 -0
- package/dist/global-skills/instrument-feature-flags/SKILL.md +25 -25
- package/dist/global-skills/instrument-feature-flags/references/adding-feature-flag-code.md +141 -285
- package/dist/global-skills/instrument-feature-flags/references/android.md +6 -15
- package/dist/global-skills/instrument-feature-flags/references/api.md +4 -11
- package/dist/global-skills/instrument-feature-flags/references/best-practices.md +1 -13
- package/dist/global-skills/instrument-feature-flags/references/django.md +14 -27
- package/dist/global-skills/instrument-feature-flags/references/dotnet.md +20 -79
- package/dist/global-skills/instrument-feature-flags/references/elixir.md +1 -9
- package/dist/global-skills/instrument-feature-flags/references/flask.md +13 -13
- package/dist/global-skills/instrument-feature-flags/references/flutter.md +3 -24
- package/dist/global-skills/instrument-feature-flags/references/go.md +3 -15
- package/dist/global-skills/instrument-feature-flags/references/ios.md +4 -17
- package/dist/global-skills/instrument-feature-flags/references/java.md +5 -13
- package/dist/global-skills/instrument-feature-flags/references/laravel.md +13 -17
- package/dist/global-skills/instrument-feature-flags/references/next-js.md +25 -32
- package/dist/global-skills/instrument-feature-flags/references/nodejs.md +8 -15
- package/dist/global-skills/instrument-feature-flags/references/php.md +1 -15
- package/dist/global-skills/instrument-feature-flags/references/python.md +2 -15
- package/dist/global-skills/instrument-feature-flags/references/react-native.md +13 -15
- package/dist/global-skills/instrument-feature-flags/references/react.md +17 -21
- package/dist/global-skills/instrument-feature-flags/references/ruby-on-rails.md +37 -83
- package/dist/global-skills/instrument-feature-flags/references/ruby.md +2 -15
- package/dist/global-skills/instrument-feature-flags/references/rust.md +13 -25
- package/dist/global-skills/instrument-feature-flags/references/usage.md +14 -63
- package/dist/global-skills/instrument-feature-flags/references/web.md +9 -14
- package/dist/global-skills/instrument-product-analytics/SKILL.md +29 -29
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-hybrid.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-ssr.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-static.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-view-transitions.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-ruby-on-rails.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/android.md +72 -107
- package/dist/global-skills/instrument-product-analytics/references/angular.md +26 -28
- package/dist/global-skills/instrument-product-analytics/references/astro.md +13 -24
- package/dist/global-skills/instrument-product-analytics/references/configuration.md +45 -63
- package/dist/global-skills/instrument-product-analytics/references/django.md +14 -27
- package/dist/global-skills/instrument-product-analytics/references/dotnet.md +20 -79
- package/dist/global-skills/instrument-product-analytics/references/elixir.md +47 -49
- package/dist/global-skills/instrument-product-analytics/references/flask.md +13 -13
- package/dist/global-skills/instrument-product-analytics/references/flutter.md +60 -90
- package/dist/global-skills/instrument-product-analytics/references/go.md +17 -56
- package/dist/global-skills/instrument-product-analytics/references/identify-users.md +15 -15
- package/dist/global-skills/instrument-product-analytics/references/ios.md +11 -15
- package/dist/global-skills/instrument-product-analytics/references/laravel.md +13 -17
- package/dist/global-skills/instrument-product-analytics/references/next-js.md +25 -32
- package/dist/global-skills/instrument-product-analytics/references/nuxt-js-3-6.md +13 -27
- package/dist/global-skills/instrument-product-analytics/references/nuxt-js.md +14 -28
- package/dist/global-skills/instrument-product-analytics/references/php.md +33 -84
- package/dist/global-skills/instrument-product-analytics/references/posthog-python.md +229 -9
- package/dist/global-skills/instrument-product-analytics/references/python.md +415 -106
- package/dist/global-skills/instrument-product-analytics/references/react-native.md +161 -155
- package/dist/global-skills/instrument-product-analytics/references/react-router-v6.md +12 -33
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-data-mode.md +15 -33
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-declarative-mode.md +12 -33
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-framework-mode.md +26 -41
- package/dist/global-skills/instrument-product-analytics/references/ruby-on-rails.md +37 -83
- package/dist/global-skills/instrument-product-analytics/references/ruby.md +48 -108
- package/dist/global-skills/instrument-product-analytics/references/svelte.md +18 -24
- package/dist/global-skills/instrument-product-analytics/references/tanstack-start.md +17 -19
- package/dist/global-skills/instrument-product-analytics/references/usage.md +14 -63
- package/dist/global-skills/instrument-product-analytics/references/vue-js.md +29 -28
- package/dist/global-skills/manifest.json +8 -2
- package/dist/global-skills/mongodb-search-and-ai/SKILL.md +28 -37
- package/dist/global-skills/mongodb-search-and-ai/references/automated-embedding.md +438 -0
- package/dist/global-skills/mongodb-search-and-ai/references/hybrid-search.md +60 -4
- package/dist/global-skills/mongodb-search-and-ai/references/vector-search.md +46 -108
- package/dist/global-skills/neon/SKILL.md +207 -213
- package/dist/global-skills/neon/references/auth.md +12 -0
- package/dist/global-skills/neon/references/claimable-neon.md +10 -14
- package/dist/global-skills/neon/references/function-triggers.md +53 -0
- package/dist/global-skills/neon/references/logs-loki.md +61 -0
- package/dist/global-skills/neon/references/parse-env.md +32 -0
- package/dist/global-skills/neon/references/sdk.md +7 -0
- package/dist/global-skills/neon-ai-gateway/SKILL.md +14 -16
- package/dist/global-skills/neon-auth/SKILL.md +155 -0
- package/dist/global-skills/neon-auth/references/managed-auth.md +173 -0
- package/dist/global-skills/neon-auth/references/self-managed.md +25 -0
- package/dist/global-skills/neon-functions/SKILL.md +159 -84
- package/dist/global-skills/neon-functions/references/ai-sdk.md +4 -6
- package/dist/global-skills/neon-functions/references/function-triggers.md +249 -0
- package/dist/global-skills/neon-functions/references/mastra-studio.md +3 -3
- package/dist/global-skills/neon-functions/references/mcp.md +1 -1
- package/dist/global-skills/neon-functions/references/production-hardening.md +340 -0
- package/dist/global-skills/neon-functions/references/sse.md +8 -5
- package/dist/global-skills/neon-object-storage/SKILL.md +10 -11
- package/dist/global-skills/neon-postgres/SKILL.md +120 -17
- package/dist/global-skills/neon-postgres/references/full-text-search.md +99 -0
- package/dist/global-skills/neon-postgres/references/hybrid-search.md +90 -0
- package/dist/global-skills/neon-postgres/references/lakebase-search-drizzle.md +172 -0
- package/dist/global-skills/neon-postgres/references/vector-search.md +137 -0
- package/dist/global-skills/neon-postgres-branches/SKILL.md +3 -3
- package/dist/global-skills/neon-postgres-egress-optimizer/SKILL.md +1 -1
- package/dist/global-skills/onboarding/SKILL.md +8 -6
- package/dist/global-skills/resend/SKILL.md +4 -2
- package/dist/global-skills/resend/references/broadcasts.md +6 -1
- package/dist/global-skills/resend/references/receiving.md +29 -10
- package/dist/global-skills/resend/references/sending/email-management.md +14 -4
- package/dist/global-skills/resend/references/topics.md +9 -6
- package/dist/global-skills/resend/references/usage.md +117 -0
- package/dist/global-skills/resend/references/webhooks.md +59 -2
- package/dist/global-skills/stripe-best-practices/SKILL.md +35 -29
- package/dist/global-skills/stripe-best-practices/references/billing.md +9 -2
- package/dist/global-skills/stripe-best-practices/references/payments.md +4 -2
- package/dist/global-skills/stripe-best-practices/references/security.md +3 -1
- package/dist/global-skills/stripe-best-practices/references/tax.md +39 -20
- package/dist/global-skills/supabase/SKILL.md +6 -0
- package/dist/global-skills/use-railway/SKILL.md +42 -22
- package/dist/global-skills/use-railway/references/analyze-db.md +7 -6
- package/dist/global-skills/use-railway/references/cloud-agents.md +70 -0
- package/dist/global-skills/use-railway/references/configure.md +17 -2
- package/dist/global-skills/use-railway/references/databases.md +107 -0
- package/dist/global-skills/use-railway/references/deploy.md +5 -5
- package/dist/global-skills/use-railway/references/feature-flags.md +25 -13
- package/dist/global-skills/use-railway/references/iac.md +66 -77
- package/dist/global-skills/use-railway/references/operate.md +26 -3
- package/dist/global-skills/use-railway/references/request.md +31 -23
- package/dist/global-skills/use-railway/references/setup.md +16 -5
- package/dist/global-skills/use-railway/references/tracing.md +261 -0
- package/dist/global-skills/use-railway/references/usage.md +52 -0
- package/dist/global-skills/use-railway/scripts/analyze-mongo.py +0 -0
- package/dist/global-skills/use-railway/scripts/analyze-mysql.py +0 -0
- package/dist/global-skills/use-railway/scripts/analyze-postgres.py +0 -0
- package/dist/global-skills/use-railway/scripts/analyze-redis.py +0 -0
- package/dist/global-skills/use-railway/scripts/enable-pg-stats.py +0 -0
- package/dist/global-skills/use-railway/scripts/pg-extensions.py +0 -0
- package/dist/global-skills/use-railway/scripts/railway-api.sh +0 -0
- package/dist/global-skills/validate-my-idea/SKILL.md +54 -0
- package/dist/global-skills/{feedback → vybekiit-feedback}/SKILL.md +16 -12
- package/dist/global-skills/watch-my-app/SKILL.md +53 -0
- package/dist/global-skills/workers-best-practices/SKILL.md +36 -103
- package/dist/global-skills/workers-best-practices/references/configuration.md +139 -0
- package/dist/global-skills/workers-best-practices/references/platform-apis.md +51 -0
- package/dist/global-skills/workers-best-practices/references/{rules.md → runtime-patterns.md} +13 -137
- package/dist/global-skills/wrangler/SKILL.md +48 -901
- package/dist/global-skills/xcode-project-setup/scripts/xcode_spm_setup/Sources/main.swift +19 -15
- package/package.json +22 -22
- package/dist/global-skills/expo-native-ui/references/animations.md +0 -220
- package/dist/global-skills/firebase-firestore/references/enterprise/security_rules.md +0 -577
- package/dist/global-skills/workers-best-practices/references/review.md +0 -174
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: aws-cdk
|
|
3
|
-
description: Authors, deploys, and troubleshoots AWS infrastructure using CDK with TypeScript or Python. Covers best practices, stack architecture, and construct patterns.
|
|
3
|
+
description: Authors, deploys, and troubleshoots AWS infrastructure using CDK with TypeScript or Python. Covers best practices, stack architecture, and construct patterns. Applies when writing CDK constructs, bootstrapping environments, running cdk deploy/synth/diff, fixing CDK or CloudFormation errors, planning stack structure, importing existing resources, resolving drift, or refactoring stacks without resource replacement.
|
|
4
4
|
metadata:
|
|
5
|
-
version: "
|
|
5
|
+
version: "2"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# AWS CDK
|
|
@@ -19,7 +19,9 @@ Domain expertise for CDK construct authoring, deployment workflows, compliance,
|
|
|
19
19
|
|
|
20
20
|
**Construct ID changes cause replacement**: Renaming/moving a construct changes its logical ID → CloudFormation replaces the resource (data loss for stateful resources). Always `cdk diff` before deploy. See [refactor-and-prevent-replacement](references/refactor-and-prevent-replacement.md).
|
|
21
21
|
|
|
22
|
-
**UPDATE_ROLLBACK_FAILED**: Stack is stuck. Fix with `cdk rollback $STACK` or `cdk rollback $STACK --orphan <LogicalId>`. See [troubleshooting-deployment](references/troubleshooting-deployment.md).
|
|
22
|
+
**UPDATE_ROLLBACK_FAILED**: Stack is stuck. Fix with `cdk rollback $STACK` or `cdk rollback $STACK --orphan <LogicalId>`. Express mode stacks are the exception — they cannot be rolled back at all. See [troubleshooting-deployment](references/troubleshooting-deployment.md).
|
|
23
|
+
|
|
24
|
+
**Hotswap and express mode are development-only**: `--hotswap` / `--hotswap-fallback` bypass CloudFormation and create drift on purpose; `--express` reports success before resources stabilize and disables automatic rollback. You MUST NOT use either in production. A failed `--express` deployment cannot be rolled back — recover by rolling forward with another `--express` deploy. See [fast-deployments](references/fast-deployments.md).
|
|
23
25
|
|
|
24
26
|
**Non-empty S3 buckets persist after destroy**: You MUST set both `removalPolicy: DESTROY` and `autoDeleteObjects: true`. Versioned buckets are worse — delete markers persist even after apparent deletion.
|
|
25
27
|
|
|
@@ -30,12 +32,21 @@ Domain expertise for CDK construct authoring, deployment workflows, compliance,
|
|
|
30
32
|
| Bootstrap | `cdk bootstrap aws://$ACCOUNT/$REGION` | [bootstrap-and-project-setup](references/bootstrap-and-project-setup.md) |
|
|
31
33
|
| New TS project | `cdk init app --language typescript` — use `tsx`, `eslint-plugin-awscdk` | [bootstrap-and-project-setup](references/bootstrap-and-project-setup.md) |
|
|
32
34
|
| New Python project | `cdk init app --language python` — pin deps, use virtualenv | [bootstrap-and-project-setup](references/bootstrap-and-project-setup.md) |
|
|
33
|
-
| Deploy | `cdk synth --strict` → `cdk diff` → `cdk deploy` | Always diff before deploy to
|
|
35
|
+
| Deploy | `cdk synth --strict` → `cdk diff` → `cdk deploy` | Always diff before deploy to production |
|
|
36
|
+
| Fast dev iteration | `cdk deploy --hotswap-fallback`, `cdk watch`, or `cdk deploy --express` — dev only, never production | [fast-deployments](references/fast-deployments.md) |
|
|
34
37
|
| cdk-nag | `Aspects.of(app).add(new AwsSolutionsChecks())` | [compliance-and-drift](references/compliance-and-drift.md) |
|
|
35
38
|
| Drift | `cdk drift $STACK` (use `--fail` in CI) | [compliance-and-drift](references/compliance-and-drift.md) |
|
|
36
39
|
| Import resource | `cdk import` (interactive or `--resource-mapping` for CI), `cdk deploy --import-existing-resources` | [import-and-migrate](references/import-and-migrate.md) |
|
|
37
40
|
| Refactor safely | `cdk refactor --unstable=refactor` — no property changes in same deploy | [refactor-and-prevent-replacement](references/refactor-and-prevent-replacement.md) |
|
|
38
41
|
|
|
42
|
+
## Fast Deployments — Hotswap vs Express (dev only)
|
|
43
|
+
|
|
44
|
+
Both trade safety for speed and you MUST NOT use either in production.
|
|
45
|
+
|
|
46
|
+
**Choosing between them:** Use `--hotswap` / `--hotswap-fallback` for the fastest loop when you work mostly with hotswappable resources and drift does not matter. Use `--express` when drift is unacceptable, or your resources are not hotswappable.
|
|
47
|
+
|
|
48
|
+
Recovery workflows (hotswap drift via `--revert-drift`, rolling a failed `--express` deploy forward), the hotswappable-resource rules, and IAM/monitoring enforcement of the prod prohibition are all in the full guide: [fast-deployments](references/fast-deployments.md).
|
|
49
|
+
|
|
39
50
|
## Troubleshooting
|
|
40
51
|
|
|
41
52
|
| Error | Cause → Fix |
|
|
@@ -52,8 +63,11 @@ Domain expertise for CDK construct authoring, deployment workflows, compliance,
|
|
|
52
63
|
| **NoStacksMatched** | CDK uses logical ID (2nd constructor arg), not CFN name. `cdk list` to find IDs. [Details](references/troubleshooting-synth.md) |
|
|
53
64
|
| **Cannot find module** (synth time) | Run `npx tsc --noEmit`, check `cdk.json` app path matches `tsconfig.json` `outDir`, delete stale `.js` files. Python: activate venv. [Details](references/troubleshooting-synth.md) |
|
|
54
65
|
| **V1 import paths / duplicate aws-cdk-lib** | V1 `@aws-cdk/*` imports, wrong `Construct` import, duplicate lib copies in monorepos. [Details](references/v1-to-v2-migration.md) |
|
|
55
|
-
| **Lambda Cannot find module** (runtime) | Wrong handler value, missing SDK v3 migration, Python deps not bundled. [Details](references/troubleshooting-deployment.md) |
|
|
66
|
+
| **Lambda Cannot find module** (runtime) | Wrong handler value, missing AWS SDK v3 migration, Python deps not bundled. [Details](references/troubleshooting-deployment.md) |
|
|
56
67
|
| **API Gateway multi-stage conflicts** | Set `deploy: false` on `RestApi`, create `Deployment` and `Stage` explicitly. [Details](references/troubleshooting-deployment.md) |
|
|
68
|
+
| **Change didn't deploy under `--hotswap`** | Changes to non-hotswappable resources are silently ignored and only logged — the command still reports success. Read the output; use `--hotswap-fallback` to force a CloudFormation deployment instead. [Details](references/fast-deployments.md) |
|
|
69
|
+
| **Failed `--express` deploy / can't roll back** | Express mode cannot use the Rollback Stack API, and a standard deploy MUST NOT be used to recover it. Roll forward: fix the cause, then `cdk deploy $STACK --express`. [Details](references/fast-deployments.md) |
|
|
70
|
+
| **Unexpected drift on a dev stack** | Hotswap and `cdk watch` create drift by design. Until reverted, the live resources — not CloudFormation's records — are authoritative. Reconcile with `cdk deploy $STACK --revert-drift`, which uses Drift Aware Changesets to bring live resources in line with the template (updates reality to match desired state; does NOT rewrite CF records to match drifted resources). [Details](references/fast-deployments.md) |
|
|
57
71
|
|
|
58
72
|
## Construct Patterns
|
|
59
73
|
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Fast Deployments: Hotswap and Express Mode
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
- [Overview](#overview)
|
|
6
|
+
- [Choosing a Deployment Mode](#choosing-a-deployment-mode)
|
|
7
|
+
- [Hotswap](#hotswap)
|
|
8
|
+
- [`--hotswap` vs `--hotswap-fallback`](#--hotswap-vs---hotswap-fallback)
|
|
9
|
+
- [Hotswappable Resource Types](#hotswappable-resource-types)
|
|
10
|
+
- [cdk watch Defaults to Hotswap](#cdk-watch-defaults-to-hotswap)
|
|
11
|
+
- [Hotswap Drift and Recovery](#hotswap-drift-and-recovery)
|
|
12
|
+
- [Express Mode](#express-mode)
|
|
13
|
+
- [Supported Commands](#supported-commands)
|
|
14
|
+
- [Rollback Behavior](#rollback-behavior)
|
|
15
|
+
- [Recovering a Failed Express Deployment](#recovering-a-failed-express-deployment)
|
|
16
|
+
- [Production Prohibition](#production-prohibition)
|
|
17
|
+
- [Security Considerations](#security-considerations)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
|
|
23
|
+
A standard `cdk deploy` with no extra flags runs a full CloudFormation deployment and waits for every resource to stabilize. Two options trade safety for speed:
|
|
24
|
+
|
|
25
|
+
- **Hotswap** (`--hotswap`, `--hotswap-fallback`) — bypasses CloudFormation entirely and updates supported resources directly through AWS SDK or Cloud Control API calls.
|
|
26
|
+
- **Express mode** (`--express`) — still a CloudFormation deployment, but it does not wait for resources to stabilize.
|
|
27
|
+
|
|
28
|
+
Hotswap and express mode are **independent mechanisms**. When a `--hotswap-fallback` deployment falls back to CloudFormation, it performs a *standard* CloudFormation deployment, NOT an express-mode one.
|
|
29
|
+
|
|
30
|
+
You MUST NOT use either mode for production deployments. See [Production Prohibition](#production-prohibition).
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Choosing a Deployment Mode
|
|
35
|
+
|
|
36
|
+
| Situation | Mode |
|
|
37
|
+
|---|---|
|
|
38
|
+
| Any production deployment | Standard `cdk deploy` (no speed flags) |
|
|
39
|
+
| Iterating on mostly hotswappable resources, want the fastest possible deploy, drift does not matter | `cdk deploy --hotswap` |
|
|
40
|
+
| Same, but the deployment MUST still succeed when it touches a non-hotswappable resource | `cdk deploy --hotswap-fallback` |
|
|
41
|
+
| You want to avoid CloudFormation drift, or the resources are not hotswappable | `cdk deploy --express` |
|
|
42
|
+
|
|
43
|
+
Express mode is the right dev-loop choice when drift is unacceptable, because it remains a real CloudFormation deployment. Hotswap is faster but deliberately desynchronizes CloudFormation from reality.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Hotswap
|
|
48
|
+
|
|
49
|
+
Hotswap updates resources directly via AWS SDK or Cloud Control API calls instead of submitting a CloudFormation change set. This is why it is fast, and also why it **creates drift on purpose**: the live state of the resource no longer matches the state CloudFormation believes it is in.
|
|
50
|
+
|
|
51
|
+
Hotswap is for development use cases ONLY.
|
|
52
|
+
|
|
53
|
+
The first hotswap deployment diffs your local changes against the last successful CloudFormation deployment. For back-to-back hotswap deployments, the template synthesized by the *previous hotswap deployment* is used as the basis for the current deployment's diff.
|
|
54
|
+
|
|
55
|
+
### `--hotswap` vs `--hotswap-fallback`
|
|
56
|
+
|
|
57
|
+
These two flags behave very differently when a deployment touches a resource that cannot be hotswapped. You MUST pick deliberately.
|
|
58
|
+
|
|
59
|
+
**`cdk deploy --hotswap`** — deploys only the changes to hotswappable resources. When a deployment involves both hotswappable and non-hotswappable resources, the changes to non-hotswappable resources are **silently ignored** and merely logged in the command output.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cdk deploy $STACK_NAME --hotswap
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
You MUST read the command output when using `--hotswap`. A change to a non-hotswappable resource will not be deployed even though the command reports success. If a code change appears to have no effect, check the output for ignored non-hotswappable changes before debugging further.
|
|
66
|
+
|
|
67
|
+
**`cdk deploy --hotswap-fallback`** — if the deployment involves only hotswappable changes, a hotswap deployment is performed. If it involves any non-hotswappable change, hotswap is not attempted at all and a standard CloudFormation deployment is performed instead.
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cdk deploy $STACK_NAME --hotswap-fallback
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The decision is all-or-nothing: either every changed resource is hotswappable and a hotswap deployment happens, or at least one is not and the whole deployment goes through CloudFormation. `--hotswap-fallback` SHOULD be preferred over `--hotswap` when you cannot afford a silently dropped change.
|
|
74
|
+
|
|
75
|
+
### Hotswappable Resource Types
|
|
76
|
+
|
|
77
|
+
Hotswap supports a specific set of resource types and change kinds that varies by CDK CLI version, so you MUST NOT answer from an enumerated list — including one recalled from training data.
|
|
78
|
+
|
|
79
|
+
The authoritative list lives in the `--hotswap` option of the [`cdk deploy` CLI reference](https://docs.aws.amazon.com/cdk/v2/guide/ref-cli-cmd-deploy.html#ref-cli-cmd-deploy-options-hotswap), in the section listing the supported hotswap changes. Read it before concluding a change is or is not hotswappable. For types not yet documented there, check the [aws-cdk-cli release notes](https://github.com/aws/aws-cdk-cli/releases). That page also documents which CloudFormation intrinsic functions resolve during a hotswap deployment, which constrains what a hotswappable resource's properties can reference. That set also changes across CDK CLI releases, so read it from the CLI reference or the release notes rather than assuming it.
|
|
80
|
+
|
|
81
|
+
Any change outside the current list is non-hotswappable and is subject to the `--hotswap` / `--hotswap-fallback` behavior above. The empirical check is the deployment itself: `--hotswap` logs every change it skipped as non-hotswappable, and `--hotswap-fallback` falls through to CloudFormation when it finds one.
|
|
82
|
+
|
|
83
|
+
### cdk watch Defaults to Hotswap
|
|
84
|
+
|
|
85
|
+
`cdk watch` (equivalently `cdk deploy --watch`) continuously observes CDK project files and automatically deploys the specified stacks when it detects a change.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
cdk watch $STACK_NAME
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
By default `cdk watch` deploys using `--hotswap`. It therefore inherits both hotswap consequences: it creates drift, and it silently ignores changes to non-hotswappable resources. You MUST NOT run `cdk watch` against a production stack.
|
|
92
|
+
|
|
93
|
+
### Hotswap Drift and Recovery
|
|
94
|
+
|
|
95
|
+
Because hotswap writes directly to resources, CloudFormation's record of the stack becomes stale: the stored template still describes the pre-hotswap state, while the live resources hold the hotswapped state.
|
|
96
|
+
|
|
97
|
+
**Until you revert the drift, you MUST NOT treat CloudFormation's recorded state as authoritative.** After a hotswap deployment the live resources — not CloudFormation's records — are the source of truth for what is actually deployed. Anything that reads the stored template instead of the live resources (a drift-unaware audit, another engineer's `cdk diff`, compliance tooling that trusts CloudFormation) will report the stale pre-hotswap configuration, not what is running.
|
|
98
|
+
|
|
99
|
+
To reconcile CloudFormation's records with the live resources, deploy with the revert-drift flag:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
cdk deploy $STACK_NAME --revert-drift
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
This performs a CloudFormation deployment using **Drift Aware Changesets**. A Drift Aware Changeset treats the *template being deployed* as the source of truth and, resource by resource, checks whether the live resource is already in the state the template specifies:
|
|
106
|
+
|
|
107
|
+
- If a resource is already in the expected state, it is left alone.
|
|
108
|
+
- If a resource is not in the expected state, it is updated so the live resource matches the template.
|
|
109
|
+
|
|
110
|
+
Note the direction of reconciliation: `--revert-drift` makes the **live resources** conform to the **template** (your desired state). It does NOT rewrite CloudFormation's records to match whatever the resources currently happen to be — the template is authoritative, not the drifted live state. This is the best way to recover from hotswap drift, because the template you deploy after a run of hotswap deployments describes the state you actually want your resources in, and the drift-aware changeset skips the resources hotswap already brought to that state instead of needlessly re-updating them.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Express Mode
|
|
115
|
+
|
|
116
|
+
Express mode is a CloudFormation deployment option for faster deployments, enabled in CDK with `--express`. It is primarily for development use cases.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
cdk deploy $STACK_NAME --express
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Express mode is faster than a standard CloudFormation deployment because it **skips waiting for resources to stabilize**. It returns as soon as the create, update, or delete API call for each resource returns, reporting whether that call succeeded or failed, without waiting for the resource to reach a stable state. Consequently, resources MAY NOT be fully operational when the deployment reports completion.
|
|
123
|
+
|
|
124
|
+
Express mode still respects the resource dependencies declared in your template. When one resource references another, CloudFormation confirms the referenced resource's configuration is applied before starting the dependent resource. If a dependent resource fails because a referenced resource was not ready, CloudFormation retries the operation.
|
|
125
|
+
|
|
126
|
+
Express mode propagates automatically to nested stacks when an operation on the parent stack uses it.
|
|
127
|
+
|
|
128
|
+
Unlike hotswap, express mode does not bypass CloudFormation, so it does not create drift.
|
|
129
|
+
|
|
130
|
+
### Supported Commands
|
|
131
|
+
|
|
132
|
+
Express mode is available as an option on:
|
|
133
|
+
|
|
134
|
+
- `cdk deploy --express`
|
|
135
|
+
- `cdk bootstrap --express`
|
|
136
|
+
- `cdk destroy --express`
|
|
137
|
+
|
|
138
|
+
### Rollback Behavior
|
|
139
|
+
|
|
140
|
+
Express mode does NOT perform rollback automatically. When an operation fails, CloudFormation does not attempt to roll the change back and reports the stack as failed.
|
|
141
|
+
|
|
142
|
+
Automatic rollback can be enabled explicitly:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
cdk deploy $STACK_NAME --express --rollback
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
This is NOT the preferred way to deploy with express mode.
|
|
149
|
+
|
|
150
|
+
Note the narrow scope of `--rollback`: when a deployment fails *during* `cdk deploy --express --rollback`, that stack will be rolled back. Express mode does not perform rollback in any other instance.
|
|
151
|
+
|
|
152
|
+
### Recovering a Failed Express Deployment
|
|
153
|
+
|
|
154
|
+
This is the highest-risk difference between express mode and a standard CloudFormation deployment, and standard recovery guidance does NOT apply.
|
|
155
|
+
|
|
156
|
+
- Express mode deployments MUST NOT be expected to use the CloudFormation Rollback Stack API — they cannot.
|
|
157
|
+
- Standard CloudFormation deployments MUST NOT be used to recover a failed express mode deployment.
|
|
158
|
+
- Running `cdk deploy --express` or `cdk deploy --express --rollback` against an already-failed stack will not attempt to use the Rollback Stack API to recover it, unlike `cdk deploy` without express mode. The changes are applied to the failed stack without first attempting a rollback.
|
|
159
|
+
|
|
160
|
+
You MUST recover by rolling **forward** with another express mode deployment that resolves the failure — either revert the resource to its last successful state in code, or make some other change that fixes the underlying cause — then:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
cdk deploy $STACK_NAME --express
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Production Prohibition
|
|
169
|
+
|
|
170
|
+
You MUST NOT use hotswap in production deployments. Hotswap deployments create drift on purpose; the actual state of your resources may not match the state CloudFormation thinks they are in.
|
|
171
|
+
|
|
172
|
+
You MUST NOT use express mode in production deployments, because:
|
|
173
|
+
|
|
174
|
+
- An operation may quietly fail after express mode has already reported success, since it does not wait for resources to stabilize.
|
|
175
|
+
- Express mode disables automatic rollback by default, so stacks can end up in states that are difficult to recover from.
|
|
176
|
+
|
|
177
|
+
For production, deploy with a standard `cdk deploy` and no speed flags.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Security Considerations
|
|
182
|
+
|
|
183
|
+
Both modes carry security consequences beyond the operational ones above.
|
|
184
|
+
|
|
185
|
+
**Hotswap drift can desynchronize security-critical configuration.** Hotswap writes directly to resources, so security groups, IAM policies, encryption settings, and resource policies can end up in states that diverge from what CloudFormation records. Any control that reads the CloudFormation template rather than live resource state will report the intended configuration, not the deployed one. You MUST NOT treat CloudFormation state as authoritative for an audit of a stack that has been hotswapped; reconcile first with `cdk deploy $STACK_NAME --revert-drift`.
|
|
186
|
+
|
|
187
|
+
**A failed express deployment can leave resources partially configured.** Because express mode does not wait for stabilization and does not roll back by default, a deployment that fails midway can leave a resource created but without its intended encryption, access controls, or policy attachments. You MUST NOT assume a failed `--express` deployment left nothing behind; inspect the stack's resources before reusing the environment.
|
|
188
|
+
|
|
189
|
+
**Enforce the production prohibition with IAM rather than developer discipline.** Hotswap performs its API calls with your current AWS credentials — it deliberately does not assume the bootstrap stack's deploy roles, because those roles do not have permission to update resources directly outside CloudFormation. A production account can therefore block hotswap outright: grant direct resource-mutation permissions only to the CloudFormation deployment role, and use an SCP or IAM permissions boundary to deny those mutations to developer principals. Hotswap then fails on the API call instead of silently drifting production. Because hotswap mutates resources directly under the developer's own identity, developers performing hotswap deployments SHOULD authenticate with short-lived credentials from IAM Identity Center (AWS SSO) rather than long-lived IAM user access keys, so that a compromised credential has a bounded lifetime and a smaller blast radius.
|
|
190
|
+
|
|
191
|
+
**Detect hotswap through drift.** Hotswap introduces CloudFormation drift by design, so drift detection is the signal that matches it most directly: run `cdk drift $STACK --fail` on production stacks in CI.
|
|
@@ -177,6 +177,22 @@ cdk deploy -e $PRODUCER_STACK # then producer, removing the export
|
|
|
177
177
|
|
|
178
178
|
A stack enters `UPDATE_ROLLBACK_FAILED` when CloudFormation cannot roll back a failed update. The stack is wedged and MUST be recovered before any further operations.
|
|
179
179
|
|
|
180
|
+
### First: was the failed deployment an express mode deployment?
|
|
181
|
+
|
|
182
|
+
If the failed operation was run with `--express`, the rollback-based recovery below does NOT apply. Express mode deployments cannot use the CloudFormation Rollback Stack API, and a standard CloudFormation deployment MUST NOT be used to recover a failed express mode deployment.
|
|
183
|
+
|
|
184
|
+
Recover by rolling **forward** instead — make another express mode deployment that resolves the failure, either by reverting the resource to its last successful state in code or by making another change that fixes the cause:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
cdk deploy $STACK --express
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Security note:** A failed express deployment may have left resources partially configured — potentially without intended encryption, access controls, or policy attachments. Inspect the stack's resources (`aws cloudformation list-stack-resources`) before reusing the environment.
|
|
191
|
+
|
|
192
|
+
**Audit note:** Check CloudTrail logs for the failed deployment's API calls to determine which resources were created or modified and in what state they were left. This is the most reliable way to reconstruct exactly which create/update/delete operations succeeded or failed, since express mode reports the stack as failed without recording per-resource stabilization.
|
|
193
|
+
|
|
194
|
+
Running `cdk deploy --express` or `cdk deploy --express --rollback` against an already-failed stack applies the changes without first attempting a rollback, unlike `cdk deploy` without express mode. See [fast-deployments](fast-deployments.md).
|
|
195
|
+
|
|
180
196
|
### Root causes
|
|
181
197
|
|
|
182
198
|
- Resource deleted out-of-band (e.g., manually deleted in the console).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: aws-cloudformation
|
|
3
|
-
description: Authors, validates, and troubleshoots AWS CloudFormation templates. Covers template authoring with secure defaults,
|
|
3
|
+
description: Authors, validates, and troubleshoots AWS CloudFormation templates. Covers template authoring with secure defaults, local validation with either cfn-lint or cloudformation-validate, cfn-guard security and compliance checks as a recommended default, account-aware CloudFormation service pre-deployment validation, CloudFormation Express mode for faster deployments, and root-cause diagnosis of failed stacks using CloudFormation events and CloudTrail correlation. Also covers author-time template intelligence with the CloudFormation Language Server and published cloudformation-validate libraries.
|
|
4
4
|
metadata:
|
|
5
|
-
version: "
|
|
5
|
+
version: "3"
|
|
6
6
|
---
|
|
7
7
|
# CloudFormation
|
|
8
8
|
|
|
@@ -42,6 +42,13 @@ fetch or write customer data through `retrieve_skill`.
|
|
|
42
42
|
tool) is recommended for sandboxed execution and audit logging, but not required
|
|
43
43
|
— every step also works with the AWS CLI.
|
|
44
44
|
|
|
45
|
+
### Configure author-time template intelligence
|
|
46
|
+
|
|
47
|
+
Use the [CloudFormation Language Server guide](references/cloudformation-language-server.md) for completion,
|
|
48
|
+
diagnostics, hover documentation, navigation, refactoring, and code actions in editors and AI clients. Follow the
|
|
49
|
+
AWS Toolkit or standalone installation documentation for the selected client rather than relying on runtime,
|
|
50
|
+
build, package, or release-asset details copied into this skill.
|
|
51
|
+
|
|
45
52
|
### Understand, explain, or document a template
|
|
46
53
|
|
|
47
54
|
To answer exploratory questions about an existing template or stack — "what does
|
|
@@ -97,25 +104,14 @@ PII into Metadata.
|
|
|
97
104
|
**Attribution marker.** On any template you create or modify, ensure a top-level
|
|
98
105
|
`Metadata.AWSToolsMetrics.AWSAgentToolkit` marker whose value is
|
|
99
106
|
`aws-cloudformation@<version>`, taking `<version>` from this skill's frontmatter
|
|
100
|
-
`version` field (for example `aws-cloudformation@
|
|
107
|
+
`version` field (for example `aws-cloudformation@3`). The marker is idempotent:
|
|
101
108
|
do not duplicate it, and preserve any other keys already under `AWSToolsMetrics`
|
|
102
109
|
(for example another tool's `IaC_Generator`). Add it regardless of which context
|
|
103
110
|
convention the template uses.
|
|
104
111
|
|
|
105
112
|
### Validate a template before deployment
|
|
106
113
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
1. **Syntax and schema** — [validate-cloudformation-template SOP](references/validate-cloudformation-template.script.md) (cfn-lint)
|
|
110
|
-
2. **Security and compliance** — [check-cloudformation-template-compliance SOP](references/check-cloudformation-template-compliance.script.md) (cfn-guard)
|
|
111
|
-
3. **Pre-deployment** — [cloudformation-pre-deploy-validation SOP](references/cloudformation-pre-deploy-validation.script.md) (`describe-events` API)
|
|
112
|
-
|
|
113
|
-
**Critical:** Pre-deployment validation is enabled by default on Create Stack,
|
|
114
|
-
Update Stack, and change set creation. A `FAIL`-mode finding halts the operation
|
|
115
|
-
before any resource is provisioned. Retrieve results via `aws cloudformation
|
|
116
|
-
describe-events` (see
|
|
117
|
-
[SOP](references/cloudformation-pre-deploy-validation.script.md) for scoping
|
|
118
|
-
options). Do NOT use `describe-stack-events`.
|
|
114
|
+
Use the [CloudFormation validation workflow guide](references/validation-tool-selection.md) to choose and sequence local validation, cfn-guard security and compliance checks, and account-aware CloudFormation service pre-deployment validation. The guide covers tool selection, skip and approval conditions, in-process validation, audit logging, and result retrieval.
|
|
119
115
|
|
|
120
116
|
### Deploy faster with Express mode
|
|
121
117
|
|
|
@@ -135,24 +131,18 @@ Key points:
|
|
|
135
131
|
|
|
136
132
|
### Troubleshoot a failed deployment
|
|
137
133
|
|
|
138
|
-
When a stack
|
|
139
|
-
|
|
140
|
-
Key points:
|
|
141
|
-
|
|
142
|
-
- Use `aws cloudformation describe-events --stack-name <name> --filters FailedEvents=true --region <region>` to get only failure events. Do NOT use `describe-stack-events` — that API does not support the `--filters` parameter. Do NOT use `--query` JMESPath filters as a substitute — use the `--filters` parameter directly.
|
|
143
|
-
- Examine EVERY failed event's `ResourceStatusReason`. If a failure has a specific error message (e.g., "not authorized to perform", "already exists"), it is a real failure. If a failure says "Resource creation cancelled" with no specific error, it is a cascade caused by rollback — it does not tell you what would have gone wrong.
|
|
144
|
-
- When multiple resources have their own specific errors, they are parallel failures from a shared root cause (e.g., an IAM role missing permissions for multiple services). Enumerate ALL the specific permission gaps, not just the first one, so the developer can fix everything in one pass.
|
|
145
|
-
- Cancelled resources may have their own issues that only surface on the next deployment attempt. Warn the developer that additional failures may appear after fixing the visible ones.
|
|
146
|
-
- Classify the fix as **template-level** (change the template) or **environment-level** (fix IAM, quotas, resource state) — do not propose template changes for environment issues
|
|
134
|
+
When a stack enters a failed state, use the [troubleshoot failed stack SOP](references/troubleshoot-failed-stack.script.md) to classify all actionable failures, rollback cascades, and template-level versus environment-level fixes. Use the broader [troubleshoot deployment SOP](references/troubleshoot-deployment.script.md) when deeper CloudTrail correlation or recovery guidance is needed.
|
|
147
135
|
|
|
148
136
|
## Decision Guide
|
|
149
137
|
|
|
150
138
|
| User intent | Action |
|
|
151
139
|
|-------------|--------|
|
|
140
|
+
| Configure author-time template intelligence in an editor or AI client | CloudFormation Language Server guide |
|
|
152
141
|
| Write or modify a template | Author task + best-practices checklist |
|
|
153
|
-
| Check a template before deploying |
|
|
142
|
+
| Check a template before deploying | CloudFormation validation workflow guide |
|
|
143
|
+
| Run validation in code or in process | Use a published cloudformation-validate library for the application language |
|
|
154
144
|
| Deploy faster during development | Deploy-with-express-mode SOP |
|
|
155
|
-
| Stack failed or is stuck | Troubleshoot-
|
|
145
|
+
| Stack failed or is stuck | Troubleshoot-failed-stack SOP |
|
|
156
146
|
| Unsure about a resource property | Resource property lookup SOP |
|
|
157
147
|
| Explain or understand what a template does (and why) | Retrieve-template-context SOP |
|
|
158
148
|
| Document design decisions in a template | Persist-template-context SOP |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
Deterministic procedure for validating a CloudFormation template against security and compliance rules using cfn-guard. Works via the `cfn-guard` CLI or the Python `guardpycfn`
|
|
5
|
+
Deterministic procedure for validating a CloudFormation template against security and compliance rules using cfn-guard. Works via the `cfn-guard` CLI or the Python `guardpycfn` library.
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
@@ -30,7 +30,7 @@ Check which compliance mechanism is available.
|
|
|
30
30
|
1. `cfn-guard` CLI available on the user's system (verify with `which cfn-guard` or `cfn-guard --version`)
|
|
31
31
|
2. Python `guardpycfn` library (verify by attempting `import guardpycfn` in a throwaway Python command)
|
|
32
32
|
- If cfn-guard is not installed, You MUST ask the user: "I can install `cfn-guard` (see https://docs.aws.amazon.com/cfn-guard/latest/ug/setting-up.html for install options). Do you want me to install it, or would you prefer to install it manually?"
|
|
33
|
-
- You
|
|
33
|
+
- You SHOULD run the compliance check by default when a supported mechanism is available; You MUST NOT run an install command without the user's explicit approval because installation changes the user's environment
|
|
34
34
|
- If no mechanism is available and the user declines installation, You MUST ask whether to abort or proceed anyway (knowing the SOP cannot complete)
|
|
35
35
|
- You MUST respect the user's decision to proceed, install, or abort
|
|
36
36
|
|
|
@@ -44,7 +44,7 @@ Obtain the CloudFormation template from the user.
|
|
|
44
44
|
- You MUST read the template content from the provided source (file path, direct input, or URL)
|
|
45
45
|
- You MUST confirm the template is non-empty and parseable as YAML or JSON before proceeding
|
|
46
46
|
- If the template cannot be read or parsed, You MUST inform the user with the specific error and stop
|
|
47
|
-
- You SHOULD recommend running the
|
|
47
|
+
- You SHOULD recommend running the project-selected local validation SOP first if the user has not already done so: either the [cfn-lint SOP](validate-with-cfn-lint.script.md) or the [cloudformation-validate SOP](validate-with-cloudformation-validate.script.md), never both by default, because compliance checks assume a syntactically valid template
|
|
48
48
|
|
|
49
49
|
### 3. Acquire Rules File (if needed)
|
|
50
50
|
|
|
@@ -97,6 +97,10 @@ Guide the user after compliance results.
|
|
|
97
97
|
- After fixes are applied, You SHOULD recommend re-running this SOP to confirm all violations are resolved
|
|
98
98
|
- Once compliance passes, You SHOULD recommend the `cloudformation-pre-deploy-validation` SOP for final pre-deployment readiness
|
|
99
99
|
|
|
100
|
+
## Security Considerations
|
|
101
|
+
|
|
102
|
+
Follow the [shared security guidance](security-considerations.md) when handling templates, outputs, secrets, tools, and installation artifacts.
|
|
103
|
+
|
|
100
104
|
## Examples
|
|
101
105
|
|
|
102
106
|
### Example Input
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# CloudFormation Language Server
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- [Purpose](#purpose)
|
|
6
|
+
- [Choose the installation path](#choose-the-installation-path)
|
|
7
|
+
- [Configure the server](#configure-the-server)
|
|
8
|
+
- [Kiro CLI configuration](#kiro-cli-configuration)
|
|
9
|
+
- [Generic LSP clients](#generic-lsp-clients)
|
|
10
|
+
- [Validation workflow](#validation-workflow)
|
|
11
|
+
- [Security Considerations](#security-considerations)
|
|
12
|
+
- [Troubleshooting](#troubleshooting)
|
|
13
|
+
- [Authoritative references](#authoritative-references)
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Use the CloudFormation Language Server for author-time template intelligence in JSON and YAML templates. It provides completion,
|
|
18
|
+
diagnostics, hover documentation, navigation, refactoring, and code actions through the Language Server Protocol (LSP).
|
|
19
|
+
|
|
20
|
+
The language server improves the edit loop but is not a final deployment gate. After editing, run one local validation
|
|
21
|
+
tool: `cfn-lint` or `cloudformation-validate` through its `cfn-validate` CLI, not both by default. Then run the cfn-guard security and compliance check unless the
|
|
22
|
+
user explicitly skips it or confirms that an equivalent project check already passed.
|
|
23
|
+
|
|
24
|
+
## Choose the installation path
|
|
25
|
+
|
|
26
|
+
### Visual Studio Code or JetBrains
|
|
27
|
+
|
|
28
|
+
Follow the AWS Toolkit documentation for the editor. Use the Toolkit's documented CloudFormation integration
|
|
29
|
+
rather than separately configuring a standalone server unless the Toolkit instructions require it.
|
|
30
|
+
|
|
31
|
+
### Other editors and AI clients
|
|
32
|
+
|
|
33
|
+
A client that supports a custom stdio LSP server can use the standalone distribution. Before installation, read the
|
|
34
|
+
[standalone installation guide](https://github.com/aws-cloudformation/cloudformation-languageserver/blob/main/INSTALLATION.md)
|
|
35
|
+
and the selected [release notes](https://github.com/aws-cloudformation/cloudformation-languageserver/releases/latest).
|
|
36
|
+
Choose the supported download and prerequisites documented for the user's platform at that time.
|
|
37
|
+
|
|
38
|
+
You MUST NOT copy runtime versions, build labels, asset filenames, or asset-name patterns into this guide because release
|
|
39
|
+
packaging changes independently of the skill. You MUST also avoid inferring an installation method from a package
|
|
40
|
+
manifest or third-party registry; use the official installation guide. Ask the user before downloading, extracting, or
|
|
41
|
+
installing anything because those actions change the local environment.
|
|
42
|
+
|
|
43
|
+
A client without LSP support cannot gain code intelligence merely by launching the server. Use local validation for
|
|
44
|
+
deterministic checks in that environment.
|
|
45
|
+
|
|
46
|
+
## Configure the server
|
|
47
|
+
|
|
48
|
+
Use the server command, entry point, arguments, and prerequisites from the installation guide. Configure stdio
|
|
49
|
+
transport and use absolute paths where the client requires them. Do not guess a runtime executable or bundle filename
|
|
50
|
+
from an older release.
|
|
51
|
+
|
|
52
|
+
Route only intended CloudFormation JSON and YAML files to the server. Avoid attaching it indiscriminately to every JSON
|
|
53
|
+
or YAML document when the client supports project or file-pattern scoping.
|
|
54
|
+
|
|
55
|
+
Preserve the nested `aws` initialization data even if the client calls the outer field `init_options`,
|
|
56
|
+
`initializationOptions`, or `initialization_options`:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"initializationOptions": {
|
|
61
|
+
"aws": {
|
|
62
|
+
"clientInfo": {
|
|
63
|
+
"extension": {
|
|
64
|
+
"name": "<client-name>",
|
|
65
|
+
"version": "<client-version>"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"telemetryEnabled": true
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Keep telemetry enabled in generated configuration. Before generating configuration, tell the user that the server
|
|
75
|
+
collects anonymous usage and performance metrics, not CloudFormation template contents or values, and link the
|
|
76
|
+
[telemetry documentation](https://github.com/aws-cloudformation/cloudformation-languageserver/blob/main/src/telemetry/README.md).
|
|
77
|
+
If the user explicitly asks to disable it, honor that preference. Resolve client identity and version from the installed
|
|
78
|
+
client instead of hardcoding them.
|
|
79
|
+
|
|
80
|
+
## Kiro CLI configuration
|
|
81
|
+
|
|
82
|
+
Initialize code intelligence in the project root:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
/code init
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Then add the server to `.kiro/settings/lsp.json`. Replace the command and argument placeholders with the exact stdio
|
|
89
|
+
invocation from the standalone installation guide:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"languages": {
|
|
94
|
+
"cfn-lsp": {
|
|
95
|
+
"name": "cloudformation-languageserver",
|
|
96
|
+
"command": "<server-command>",
|
|
97
|
+
"args": ["<server-arguments>"],
|
|
98
|
+
"file_extensions": ["json", "yaml", "yml", "cfn", "template"],
|
|
99
|
+
"project_patterns": [],
|
|
100
|
+
"exclude_patterns": [],
|
|
101
|
+
"multi_workspace": false,
|
|
102
|
+
"initialization_options": {
|
|
103
|
+
"aws": {
|
|
104
|
+
"clientInfo": {
|
|
105
|
+
"extension": {
|
|
106
|
+
"name": "kiro-cli",
|
|
107
|
+
"version": "<installed-client-version>"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"telemetryEnabled": true
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
If the documented invocation needs multiple arguments, represent each as a separate `args` entry. Adjust file extensions
|
|
119
|
+
and project patterns to the repository rather than treating the example as a universal selector.
|
|
120
|
+
|
|
121
|
+
Restart Kiro CLI after changing the file, or force code-intelligence reinitialization:
|
|
122
|
+
|
|
123
|
+
```text
|
|
124
|
+
/code init -f
|
|
125
|
+
/code status
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`/code status` should show `cfn-lsp` as initialized. Use code-intelligence tools for symbol navigation, hover,
|
|
129
|
+
completion, diagnostics, and code actions rather than simulating those features with text search.
|
|
130
|
+
|
|
131
|
+
## Generic LSP clients
|
|
132
|
+
|
|
133
|
+
For another LSP-capable editor, translate the standalone stdio command and the initialization options above into
|
|
134
|
+
the client's configuration format. Follow the editor's documentation for root detection, workspace folders, file
|
|
135
|
+
selectors, and argument arrays. The standalone installation guide contains the maintained client examples.
|
|
136
|
+
|
|
137
|
+
## Validation workflow
|
|
138
|
+
|
|
139
|
+
1. Confirm the LSP process is initialized and attached to the intended template.
|
|
140
|
+
2. Read all published diagnostics.
|
|
141
|
+
3. Use hover, completion, and code actions to understand and fix the template; inspect each proposed edit before
|
|
142
|
+
applying it.
|
|
143
|
+
4. Save the file and wait for diagnostics to refresh.
|
|
144
|
+
5. Run exactly one local validation procedure against the saved file: the
|
|
145
|
+
[cfn-lint SOP](validate-with-cfn-lint.script.md) or the
|
|
146
|
+
[cloudformation-validate SOP](validate-with-cloudformation-validate.script.md). LSP diagnostics may reflect an editor
|
|
147
|
+
buffer while deployment tooling reads the file on disk.
|
|
148
|
+
6. Run the
|
|
149
|
+
[cfn-guard security and compliance SOP](check-cloudformation-template-compliance.script.md) by default. Skip it only
|
|
150
|
+
when the user explicitly requests that or confirms an equivalent project security and compliance check already
|
|
151
|
+
passed.
|
|
152
|
+
7. Use [CloudFormation service pre-deployment validation](cloudformation-pre-deploy-validation.script.md) when
|
|
153
|
+
account-aware checks are needed before deployment.
|
|
154
|
+
|
|
155
|
+
Do not claim that an empty editor diagnostics panel proves the saved template is valid, compliant, or deployable.
|
|
156
|
+
|
|
157
|
+
## Security Considerations
|
|
158
|
+
|
|
159
|
+
Follow the [shared security guidance](security-considerations.md) when handling templates, outputs, secrets, tools, and installation artifacts.
|
|
160
|
+
|
|
161
|
+
## Troubleshooting
|
|
162
|
+
|
|
163
|
+
| Symptom | Check |
|
|
164
|
+
|---------|-------|
|
|
165
|
+
| Server does not initialize | Re-read the selected release's prerequisites and confirm the installed artifact matches the platform |
|
|
166
|
+
| Client reports an immediate process exit | Compare the configured command and argument array with the installation guide |
|
|
167
|
+
| No diagnostics or completion | Confirm the file selector routes this file to the server and the document is recognized as CloudFormation |
|
|
168
|
+
| Kiro CLI cannot see the server | Run `/code status`, inspect `.kiro/settings/lsp.json`, then restart or run `/code init -f` |
|
|
169
|
+
|
|
170
|
+
## Authoritative references
|
|
171
|
+
|
|
172
|
+
- [CloudFormation Language Server](https://github.com/aws-cloudformation/cloudformation-languageserver)
|
|
173
|
+
- [Standalone installation guide](https://github.com/aws-cloudformation/cloudformation-languageserver/blob/main/INSTALLATION.md)
|
|
174
|
+
- [CloudFormation Language Server releases](https://github.com/aws-cloudformation/cloudformation-languageserver/releases/latest)
|
|
175
|
+
- [CloudFormation Language Server telemetry](https://github.com/aws-cloudformation/cloudformation-languageserver/blob/main/src/telemetry/README.md)
|
|
176
|
+
- [AWS Toolkit for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.aws-toolkit-vscode)
|
|
177
|
+
- [AWS Toolkit for JetBrains](https://plugins.jetbrains.com/plugin/11349-aws-toolkit)
|
|
@@ -70,8 +70,8 @@ Catch issues locally before consuming CloudFormation API quota.
|
|
|
70
70
|
|
|
71
71
|
**Constraints:**
|
|
72
72
|
|
|
73
|
-
- You SHOULD recommend running the
|
|
74
|
-
- You SHOULD recommend running the `check-cloudformation-template-compliance` SOP to catch security violations locally
|
|
73
|
+
- You SHOULD recommend running the project-selected local validation SOP first: either the [cloudformation-validate SOP](validate-with-cloudformation-validate.script.md) or the [cfn-lint SOP](validate-with-cfn-lint.script.md), never both by default
|
|
74
|
+
- You SHOULD recommend running the `check-cloudformation-template-compliance` SOP by default to catch security violations locally
|
|
75
75
|
- If the user has already run these checks or explicitly skips them, You MUST proceed to the next step
|
|
76
76
|
|
|
77
77
|
### 3. Upload Template (if needed)
|
|
@@ -198,6 +198,12 @@ When the user is deploying with the AWS CDK rather than raw CloudFormation, pre-
|
|
|
198
198
|
- You SHOULD inform the user that both `cdk deploy` and `cdk validate` surface pre-deployment validation results in a unified report with construct-level tracing, mapping each result back to the originating CDK construct
|
|
199
199
|
- You SHOULD prefer `cdk validate` when the user wants to validate without deploying
|
|
200
200
|
- You MUST treat the structured CDK validation report the same way as `describe-events` results: enumerate every `FAIL` result before recommending a deploy, and surface `WARN` results for the user to evaluate
|
|
201
|
+
- You MUST distinguish CDK's local `CloudFormationValidatePlugin` integration from CloudFormation service pre-deployment validation
|
|
202
|
+
- See [validate-with-cloudformation-validate.script.md](validate-with-cloudformation-validate.script.md) for library APIs, custom rules, and CDK integration guidance
|
|
203
|
+
|
|
204
|
+
## Security Considerations
|
|
205
|
+
|
|
206
|
+
Follow the [shared security guidance](security-considerations.md) when handling templates, outputs, secrets, tools, and installation artifacts.
|
|
201
207
|
|
|
202
208
|
## Examples
|
|
203
209
|
|