@caddis/cli 0.1.0 → 0.2.0
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/README.md +29 -16
- package/bundles/antigravity-plugin-extras/plugin.json +5 -0
- package/bundles/antigravity-plugin-extras/skills/_registry.md +154 -0
- package/bundles/antigravity-plugin-extras/skills/agent-md-refactor/SKILL.md +356 -0
- package/bundles/antigravity-plugin-extras/skills/agent-orchestration/SKILL.md +517 -0
- package/bundles/antigravity-plugin-extras/skills/algorithmic-art/SKILL.md +293 -0
- package/bundles/antigravity-plugin-extras/skills/anchor-review/SKILL.md +135 -0
- package/bundles/antigravity-plugin-extras/skills/api-client-patterns/SKILL.md +367 -0
- package/bundles/antigravity-plugin-extras/skills/architecture-design/SKILL.md +244 -0
- package/bundles/antigravity-plugin-extras/skills/architecture-diagram/SKILL.md +156 -0
- package/bundles/antigravity-plugin-extras/skills/architecture-document/SKILL.md +321 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/SKILL.md +74 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/scripts/init-artifact.sh +322 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/bundles/antigravity-plugin-extras/skills/ascii-art/SKILL.md +144 -0
- package/bundles/antigravity-plugin-extras/skills/asking-questions/SKILL.md +81 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/SKILL.md +118 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/cross-service/credential-management.md +450 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/browser/README.md +363 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/code-interpreter/README.md +232 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/README.md +100 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/deploy-template.sh +117 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/deployment-strategies.md +416 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/troubleshooting-guide.md +384 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/validate-deployment.sh +186 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/identity/README.md +186 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/memory/README.md +253 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/observability/README.md +517 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/runtime/README.md +215 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cdk-development/SKILL.md +279 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cdk-development/references/cdk-patterns.md +431 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cdk-development/scripts/validate-stack.sh +240 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cost-operations/SKILL.md +318 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cost-operations/references/cloudwatch-alarms.md +567 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cost-operations/references/operations-patterns.md +394 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/SKILL.md +758 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/deployment-best-practices.md +830 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/eda-patterns.md +1002 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/observability-best-practices.md +770 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/performance-optimization.md +671 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/security-best-practices.md +625 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/serverless-patterns.md +838 -0
- package/bundles/antigravity-plugin-extras/skills/backend-to-frontend-handoff/SKILL.md +139 -0
- package/bundles/antigravity-plugin-extras/skills/banner-design/SKILL.md +188 -0
- package/bundles/antigravity-plugin-extras/skills/brand-design/SKILL.md +298 -0
- package/bundles/antigravity-plugin-extras/skills/brand-guidelines/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/brand-guidelines/SKILL.md +118 -0
- package/bundles/antigravity-plugin-extras/skills/brand-voice/SKILL.md +93 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/SKILL.md +392 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/references/agent-patterns.md +461 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/references/examples.md +188 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/references/state-patterns.md +360 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/references/troubleshooting.md +362 -0
- package/bundles/antigravity-plugin-extras/skills/building-mcp-server-on-cloudflare/SKILL.md +266 -0
- package/bundles/antigravity-plugin-extras/skills/building-mcp-server-on-cloudflare/references/examples.md +115 -0
- package/bundles/antigravity-plugin-extras/skills/building-mcp-server-on-cloudflare/references/oauth-setup.md +338 -0
- package/bundles/antigravity-plugin-extras/skills/building-mcp-server-on-cloudflare/references/troubleshooting.md +317 -0
- package/bundles/antigravity-plugin-extras/skills/caching-patterns/SKILL.md +385 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/SKILL.md +91 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/changelog-generator/SKILL.md +105 -0
- package/bundles/antigravity-plugin-extras/skills/code-explainer/SKILL.md +91 -0
- package/bundles/antigravity-plugin-extras/skills/competitive-ads-extractor/SKILL.md +294 -0
- package/bundles/antigravity-plugin-extras/skills/component-testing/SKILL.md +310 -0
- package/bundles/antigravity-plugin-extras/skills/content-research-writer/SKILL.md +539 -0
- package/bundles/antigravity-plugin-extras/skills/cross-review/SKILL.md +51 -0
- package/bundles/antigravity-plugin-extras/skills/data-analysis/SKILL.md +111 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/README.md +248 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/SKILL.md +203 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/adapter.py.template +44 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/api-router.py.template +43 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/contract-test.py.template +384 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/display-dto.py.template +39 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/frontend-service.ts.template +46 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/frontend-types.ts.template +38 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/ingestion-model.py.template +42 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/mapping-doc.md.template +46 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/normalizer.py.template +48 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/prompts/extract_requirements.md +36 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/prompts/extract_ui_demand.md +35 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/prompts/reconcile_mapping.md +66 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/query-catalog.md.template +62 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/references/consumer-driven-contracts.md +131 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/references/drift-check-catalog.md +305 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/references/layer-responsibilities.md +333 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/discover_connections.py +170 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/discover_sources.py +161 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/drift_check.py +171 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/extract_schema.py +1363 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/generate_gap_report.py +81 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/generate_mapping_doc.py +294 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/ts_dto_compare.py +214 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/validate_lineage.py +51 -0
- package/bundles/antigravity-plugin-extras/skills/data-loader/SKILL.md +753 -0
- package/bundles/antigravity-plugin-extras/skills/data-validation/SKILL.md +220 -0
- package/bundles/antigravity-plugin-extras/skills/db-testing/SKILL.md +117 -0
- package/bundles/antigravity-plugin-extras/skills/deploy-local/SKILL.md +259 -0
- package/bundles/antigravity-plugin-extras/skills/design-md/SKILL.md +167 -0
- package/bundles/antigravity-plugin-extras/skills/design-system-tokens/SKILL.md +240 -0
- package/bundles/antigravity-plugin-extras/skills/design-system-tokens/references/DESIGN-SYSTEM-TEMPLATE.md +577 -0
- package/bundles/antigravity-plugin-extras/skills/developer-growth-analysis/SKILL.md +323 -0
- package/bundles/antigravity-plugin-extras/skills/doc-coauthoring/SKILL.md +378 -0
- package/bundles/antigravity-plugin-extras/skills/documentation-analyzer/SKILL.md +78 -0
- package/bundles/antigravity-plugin-extras/skills/domain-name-brainstormer/SKILL.md +213 -0
- package/bundles/antigravity-plugin-extras/skills/enterprise-dashboard-aesthetic-system/SKILL.md +120 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/SKILL.md +193 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/references/element-types.md +497 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/references/excalidraw-schema.md +356 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/references/reliable-diagrams.md +115 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/scripts/README.md +60 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/scripts/add-arrow.py +354 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/scripts/add-icon-to-diagram.py +412 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/scripts/split-excalidraw-library.py +183 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/business-flow-swimlane-template.excalidraw +334 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/class-diagram-template.excalidraw +558 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/data-flow-diagram-template.excalidraw +279 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/er-diagram-template.excalidraw +662 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/flowchart-template.excalidraw +179 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/mindmap-template.excalidraw +244 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/relationship-template.excalidraw +145 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/reliable-flowchart.excalidraw +1 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/sequence-diagram-template.excalidraw +509 -0
- package/bundles/antigravity-plugin-extras/skills/file-organizer/SKILL.md +434 -0
- package/bundles/antigravity-plugin-extras/skills/game-changing-features/README.md +221 -0
- package/bundles/antigravity-plugin-extras/skills/game-changing-features/SKILL.md +265 -0
- package/bundles/antigravity-plugin-extras/skills/github-issues/SKILL.md +359 -0
- package/bundles/antigravity-plugin-extras/skills/github-issues/references/templates.md +90 -0
- package/bundles/antigravity-plugin-extras/skills/golden-nuggets/SKILL.md +192 -0
- package/bundles/antigravity-plugin-extras/skills/humanizer/SKILL.md +194 -0
- package/bundles/antigravity-plugin-extras/skills/image-enhancer/SKILL.md +100 -0
- package/bundles/antigravity-plugin-extras/skills/intent-writer/SKILL.md +201 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/SKILL.md +124 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/examples/3p-updates.md +47 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/examples/company-newsletter.md +65 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/examples/faq-answers.md +30 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/examples/general-comms.md +16 -0
- package/bundles/antigravity-plugin-extras/skills/invoice-organizer/SKILL.md +447 -0
- package/bundles/antigravity-plugin-extras/skills/jira-issues/SKILL.md +182 -0
- package/bundles/antigravity-plugin-extras/skills/job-application/SKILL.md +188 -0
- package/bundles/antigravity-plugin-extras/skills/lead-research-assistant/SKILL.md +200 -0
- package/bundles/antigravity-plugin-extras/skills/llm-application-dev/SKILL.md +217 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/SKILL.md +100 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/references/evaluation.md +602 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/references/mcp_best_practices.md +915 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/references/node_mcp_server.md +916 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/references/python_mcp_server.md +752 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/scripts/connections.py +151 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/bundles/antigravity-plugin-extras/skills/meeting-insights-analyzer/SKILL.md +328 -0
- package/bundles/antigravity-plugin-extras/skills/monorepo/SKILL.md +267 -0
- package/bundles/antigravity-plugin-extras/skills/naming-analyzer/SKILL.md +376 -0
- package/bundles/antigravity-plugin-extras/skills/nextjs-app-router/SKILL.md +271 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/AUTHENTICATION.md +154 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/SKILL.md +270 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/references/api_reference.md +309 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/references/troubleshooting.md +376 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/references/usage_patterns.md +338 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/__init__.py +81 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/ask_question.py +256 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/auth_manager.py +358 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/browser_session.py +255 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/browser_utils.py +107 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/cleanup_manager.py +302 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/config.py +44 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/notebook_manager.py +410 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/run.py +102 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/setup_environment.py +204 -0
- package/bundles/antigravity-plugin-extras/skills/observability/SKILL.md +371 -0
- package/bundles/antigravity-plugin-extras/skills/onboard-project/SKILL.md +192 -0
- package/bundles/antigravity-plugin-extras/skills/performance-testing/SKILL.md +226 -0
- package/bundles/antigravity-plugin-extras/skills/pipeline-state/SKILL.md +208 -0
- package/bundles/antigravity-plugin-extras/skills/plantuml/SKILL.md +228 -0
- package/bundles/antigravity-plugin-extras/skills/popular-web-designs/SKILL.md +142 -0
- package/bundles/antigravity-plugin-extras/skills/popular-web-designs/templates/linear.app.md +196 -0
- package/bundles/antigravity-plugin-extras/skills/popular-web-designs/templates/stripe.md +214 -0
- package/bundles/antigravity-plugin-extras/skills/popular-web-designs/templates/vercel.md +218 -0
- package/bundles/antigravity-plugin-extras/skills/prd-to-code/SKILL.md +127 -0
- package/bundles/antigravity-plugin-extras/skills/raffle-winner-picker/SKILL.md +159 -0
- package/bundles/antigravity-plugin-extras/skills/react-useeffect/README.md +320 -0
- package/bundles/antigravity-plugin-extras/skills/react-useeffect/SKILL.md +53 -0
- package/bundles/antigravity-plugin-extras/skills/react-useeffect/alternatives.md +258 -0
- package/bundles/antigravity-plugin-extras/skills/react-useeffect/anti-patterns.md +290 -0
- package/bundles/antigravity-plugin-extras/skills/receiving-code-review/SKILL.md +213 -0
- package/bundles/antigravity-plugin-extras/skills/relay/SKILL.md +246 -0
- package/bundles/antigravity-plugin-extras/skills/requesting-code-review/SKILL.md +105 -0
- package/bundles/antigravity-plugin-extras/skills/requesting-code-review/code-reviewer.md +146 -0
- package/bundles/antigravity-plugin-extras/skills/responsive-mobile-native/SKILL.md +350 -0
- package/bundles/antigravity-plugin-extras/skills/responsive-mobile-native/references/pwa-checklist.md +226 -0
- package/bundles/antigravity-plugin-extras/skills/responsive-mobile-native/references/touch-and-interaction.md +265 -0
- package/bundles/antigravity-plugin-extras/skills/responsive-mobile-native/references/transformation-catalogue.md +326 -0
- package/bundles/antigravity-plugin-extras/skills/schema-migration/SKILL.md +275 -0
- package/bundles/antigravity-plugin-extras/skills/setup-project-ai/SKILL.md +120 -0
- package/bundles/antigravity-plugin-extras/skills/shadcn-radix/SKILL.md +330 -0
- package/bundles/antigravity-plugin-extras/skills/sketch/SKILL.md +104 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/SKILL.md +646 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/color_palettes.py +302 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/easing.py +230 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/frame_composer.py +469 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/gif_builder.py +246 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/typography.py +357 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/validators.py +264 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/visual_effects.py +494 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/requirements.txt +4 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/bounce.py +106 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/explode.py +331 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/fade.py +329 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/flip.py +291 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/kaleidoscope.py +211 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/morph.py +329 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/move.py +293 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/pulse.py +268 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/shake.py +127 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/slide.py +291 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/spin.py +269 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/wiggle.py +300 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/zoom.py +312 -0
- package/bundles/antigravity-plugin-extras/skills/slides/SKILL.md +38 -0
- package/bundles/antigravity-plugin-extras/skills/state-tracking/SKILL.md +131 -0
- package/bundles/antigravity-plugin-extras/skills/streamlit-dev/SKILL.md +268 -0
- package/bundles/antigravity-plugin-extras/skills/svg-create/SKILL.md +251 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/SKILL.md +59 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/theme-showcase.pdf +0 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/desert-rose.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/golden-hour.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/ui-styling-patterns/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/ui-styling-patterns/SKILL.md +320 -0
- package/bundles/antigravity-plugin-extras/skills/ui-testing/SKILL.md +660 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/SKILL.md +660 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/_sync_all.py +414 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/app-interface.csv +31 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/charts.csv +26 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/colors.csv +162 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/design.csv +1776 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/draft.csv +1779 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/google-fonts.csv +1924 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/icons.csv +106 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/landing.csv +35 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/products.csv +162 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/react-performance.csv +45 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/styles.csv +85 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/typography.csv +74 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/ui-reasoning.csv +162 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/ux-guidelines.csv +100 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/scripts/core.py +247 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/scripts/design_system.py +1067 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/scripts/search.py +114 -0
- package/bundles/antigravity-plugin-extras/skills/understand-anything/SKILL.md +140 -0
- package/bundles/antigravity-plugin-extras/skills/understand-anything/references/commands.md +252 -0
- package/bundles/antigravity-plugin-extras/skills/understand-anything/references/graph-schema.md +116 -0
- package/bundles/antigravity-plugin-extras/skills/understand-anything/references/pipeline.md +331 -0
- package/bundles/antigravity-plugin-extras/skills/update-readme/SKILL.md +74 -0
- package/bundles/antigravity-plugin-extras/skills/verification-loop/SKILL.md +209 -0
- package/bundles/antigravity-plugin-extras/skills/video-downloader/SKILL.md +107 -0
- package/bundles/antigravity-plugin-extras/skills/webapp-development/SKILL.md +288 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/SKILL.md +339 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/agents/agent-interface.md +175 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/html.md +384 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/nlp-keywords.md +127 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/palettes.md +149 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/python.md +249 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/react.md +427 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/shapes.md +135 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/stopwords.md +115 -0
- package/bundles/antigravity-plugin-extras/skills/youtube-transcript/SKILL.md +416 -0
- package/bundles/manifest.json +2 -1
- package/dist/cli.js +166 -37
- package/package.json +1 -1
|
@@ -0,0 +1,830 @@
|
|
|
1
|
+
# Serverless Deployment Best Practices
|
|
2
|
+
|
|
3
|
+
Deployment best practices for serverless applications including CI/CD, testing, and deployment strategies.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Software Release Process](#software-release-process)
|
|
8
|
+
- [Infrastructure as Code](#infrastructure-as-code)
|
|
9
|
+
- [CI/CD Pipeline Design](#cicd-pipeline-design)
|
|
10
|
+
- [Testing Strategies](#testing-strategies)
|
|
11
|
+
- [Deployment Strategies](#deployment-strategies)
|
|
12
|
+
- [Rollback and Safety](#rollback-and-safety)
|
|
13
|
+
|
|
14
|
+
## Software Release Process
|
|
15
|
+
|
|
16
|
+
### Four Stages of Release
|
|
17
|
+
|
|
18
|
+
**1. Source Phase**:
|
|
19
|
+
- Developers commit code changes
|
|
20
|
+
- Code review (peer review)
|
|
21
|
+
- Version control (Git)
|
|
22
|
+
|
|
23
|
+
**2. Build Phase**:
|
|
24
|
+
- Compile code
|
|
25
|
+
- Run unit tests
|
|
26
|
+
- Style checking and linting
|
|
27
|
+
- Create deployment packages
|
|
28
|
+
- Build container images
|
|
29
|
+
|
|
30
|
+
**3. Test Phase**:
|
|
31
|
+
- Integration tests with other systems
|
|
32
|
+
- Load testing
|
|
33
|
+
- UI testing
|
|
34
|
+
- Security testing (penetration testing)
|
|
35
|
+
- Acceptance testing
|
|
36
|
+
|
|
37
|
+
**4. Production Phase**:
|
|
38
|
+
- Deploy to production environment
|
|
39
|
+
- Monitor for errors
|
|
40
|
+
- Validate deployment success
|
|
41
|
+
- Rollback if needed
|
|
42
|
+
|
|
43
|
+
### CI/CD Maturity Levels
|
|
44
|
+
|
|
45
|
+
**Continuous Integration (CI)**:
|
|
46
|
+
- Automated build on code commit
|
|
47
|
+
- Automated unit testing
|
|
48
|
+
- Manual deployment to test/production
|
|
49
|
+
|
|
50
|
+
**Continuous Delivery (CD)**:
|
|
51
|
+
- Automated deployment to test environments
|
|
52
|
+
- Manual approval for production
|
|
53
|
+
- Automated testing in non-prod
|
|
54
|
+
|
|
55
|
+
**Continuous Deployment**:
|
|
56
|
+
- Fully automated pipeline
|
|
57
|
+
- Automated deployment to production
|
|
58
|
+
- No manual intervention after code commit
|
|
59
|
+
|
|
60
|
+
## Infrastructure as Code
|
|
61
|
+
|
|
62
|
+
### Framework Selection
|
|
63
|
+
|
|
64
|
+
**AWS SAM (Serverless Application Model)**:
|
|
65
|
+
|
|
66
|
+
```yaml
|
|
67
|
+
# template.yaml
|
|
68
|
+
AWSTemplateFormatVersion: '2010-09-09'
|
|
69
|
+
Transform: AWS::Serverless-2016-10-31
|
|
70
|
+
|
|
71
|
+
Resources:
|
|
72
|
+
OrderFunction:
|
|
73
|
+
Type: AWS::Serverless::Function
|
|
74
|
+
Properties:
|
|
75
|
+
Handler: app.handler
|
|
76
|
+
Runtime: nodejs20.x
|
|
77
|
+
CodeUri: src/
|
|
78
|
+
Events:
|
|
79
|
+
Api:
|
|
80
|
+
Type: Api
|
|
81
|
+
Properties:
|
|
82
|
+
Path: /orders
|
|
83
|
+
Method: post
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Benefits**:
|
|
87
|
+
- Simple, serverless-focused syntax
|
|
88
|
+
- Built-in best practices
|
|
89
|
+
- SAM CLI for local testing
|
|
90
|
+
- Integrates with CodeDeploy
|
|
91
|
+
|
|
92
|
+
**AWS CDK**:
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
new NodejsFunction(this, 'OrderFunction', {
|
|
96
|
+
entry: 'src/orders/handler.ts',
|
|
97
|
+
environment: {
|
|
98
|
+
TABLE_NAME: ordersTable.tableName,
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
ordersTable.grantReadWriteData(orderFunction);
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Benefits**:
|
|
106
|
+
- Type-safe, programmatic
|
|
107
|
+
- Reusable constructs
|
|
108
|
+
- Rich AWS service support
|
|
109
|
+
- Better for complex infrastructure
|
|
110
|
+
|
|
111
|
+
**When to use**:
|
|
112
|
+
- **SAM**: Serverless-only applications, simpler projects
|
|
113
|
+
- **CDK**: Complex infrastructure, multiple services, reusable patterns
|
|
114
|
+
|
|
115
|
+
### Environment Management
|
|
116
|
+
|
|
117
|
+
**Separate environments**:
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
// CDK App
|
|
121
|
+
const app = new cdk.App();
|
|
122
|
+
|
|
123
|
+
new ServerlessStack(app, 'DevStack', {
|
|
124
|
+
env: { account: '111111111111', region: 'us-east-1' },
|
|
125
|
+
environment: 'dev',
|
|
126
|
+
logLevel: 'DEBUG',
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
new ServerlessStack(app, 'ProdStack', {
|
|
130
|
+
env: { account: '222222222222', region: 'us-east-1' },
|
|
131
|
+
environment: 'prod',
|
|
132
|
+
logLevel: 'INFO',
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**SAM with parameters**:
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
Parameters:
|
|
140
|
+
Environment:
|
|
141
|
+
Type: String
|
|
142
|
+
Default: dev
|
|
143
|
+
AllowedValues:
|
|
144
|
+
- dev
|
|
145
|
+
- staging
|
|
146
|
+
- prod
|
|
147
|
+
|
|
148
|
+
Resources:
|
|
149
|
+
Function:
|
|
150
|
+
Type: AWS::Serverless::Function
|
|
151
|
+
Properties:
|
|
152
|
+
Environment:
|
|
153
|
+
Variables:
|
|
154
|
+
ENVIRONMENT: !Ref Environment
|
|
155
|
+
LOG_LEVEL: !If [IsProd, INFO, DEBUG]
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## CI/CD Pipeline Design
|
|
159
|
+
|
|
160
|
+
### AWS CodePipeline
|
|
161
|
+
|
|
162
|
+
**Comprehensive pipeline**:
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
import * as codepipeline from 'aws-cdk-lib/aws-codepipeline';
|
|
166
|
+
import * as codepipeline_actions from 'aws-cdk-lib/aws-codepipeline-actions';
|
|
167
|
+
|
|
168
|
+
const sourceOutput = new codepipeline.Artifact();
|
|
169
|
+
const buildOutput = new codepipeline.Artifact();
|
|
170
|
+
|
|
171
|
+
const pipeline = new codepipeline.Pipeline(this, 'Pipeline', {
|
|
172
|
+
pipelineName: 'serverless-pipeline',
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// Source stage
|
|
176
|
+
pipeline.addStage({
|
|
177
|
+
stageName: 'Source',
|
|
178
|
+
actions: [
|
|
179
|
+
new codepipeline_actions.CodeStarConnectionsSourceAction({
|
|
180
|
+
actionName: 'GitHub_Source',
|
|
181
|
+
owner: 'myorg',
|
|
182
|
+
repo: 'myrepo',
|
|
183
|
+
branch: 'main',
|
|
184
|
+
output: sourceOutput,
|
|
185
|
+
connectionArn: githubConnection.connectionArn,
|
|
186
|
+
}),
|
|
187
|
+
],
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
// Build stage
|
|
191
|
+
pipeline.addStage({
|
|
192
|
+
stageName: 'Build',
|
|
193
|
+
actions: [
|
|
194
|
+
new codepipeline_actions.CodeBuildAction({
|
|
195
|
+
actionName: 'Build',
|
|
196
|
+
project: buildProject,
|
|
197
|
+
input: sourceOutput,
|
|
198
|
+
outputs: [buildOutput],
|
|
199
|
+
}),
|
|
200
|
+
],
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
// Test stage
|
|
204
|
+
pipeline.addStage({
|
|
205
|
+
stageName: 'Test',
|
|
206
|
+
actions: [
|
|
207
|
+
new codepipeline_actions.CloudFormationCreateUpdateStackAction({
|
|
208
|
+
actionName: 'Deploy_Test',
|
|
209
|
+
templatePath: buildOutput.atPath('packaged.yaml'),
|
|
210
|
+
stackName: 'test-stack',
|
|
211
|
+
adminPermissions: true,
|
|
212
|
+
}),
|
|
213
|
+
new codepipeline_actions.CodeBuildAction({
|
|
214
|
+
actionName: 'Integration_Tests',
|
|
215
|
+
project: testProject,
|
|
216
|
+
input: buildOutput,
|
|
217
|
+
runOrder: 2,
|
|
218
|
+
}),
|
|
219
|
+
],
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// Production stage (with manual approval)
|
|
223
|
+
pipeline.addStage({
|
|
224
|
+
stageName: 'Production',
|
|
225
|
+
actions: [
|
|
226
|
+
new codepipeline_actions.ManualApprovalAction({
|
|
227
|
+
actionName: 'Approve',
|
|
228
|
+
}),
|
|
229
|
+
new codepipeline_actions.CloudFormationCreateUpdateStackAction({
|
|
230
|
+
actionName: 'Deploy_Prod',
|
|
231
|
+
templatePath: buildOutput.atPath('packaged.yaml'),
|
|
232
|
+
stackName: 'prod-stack',
|
|
233
|
+
adminPermissions: true,
|
|
234
|
+
runOrder: 2,
|
|
235
|
+
}),
|
|
236
|
+
],
|
|
237
|
+
});
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### GitHub Actions
|
|
241
|
+
|
|
242
|
+
**Serverless deployment workflow**:
|
|
243
|
+
|
|
244
|
+
```yaml
|
|
245
|
+
# .github/workflows/deploy.yml
|
|
246
|
+
name: Deploy Serverless Application
|
|
247
|
+
|
|
248
|
+
on:
|
|
249
|
+
push:
|
|
250
|
+
branches: [main]
|
|
251
|
+
|
|
252
|
+
jobs:
|
|
253
|
+
build-and-deploy:
|
|
254
|
+
runs-on: ubuntu-latest
|
|
255
|
+
steps:
|
|
256
|
+
- uses: actions/checkout@v3
|
|
257
|
+
|
|
258
|
+
- name: Setup Node.js
|
|
259
|
+
uses: actions/setup-node@v3
|
|
260
|
+
with:
|
|
261
|
+
node-version: '20'
|
|
262
|
+
|
|
263
|
+
- name: Install dependencies
|
|
264
|
+
run: npm ci
|
|
265
|
+
|
|
266
|
+
- name: Run tests
|
|
267
|
+
run: npm test
|
|
268
|
+
|
|
269
|
+
- name: Setup SAM CLI
|
|
270
|
+
uses: aws-actions/setup-sam@v2
|
|
271
|
+
|
|
272
|
+
- name: Build SAM application
|
|
273
|
+
run: sam build
|
|
274
|
+
|
|
275
|
+
- name: Deploy to Dev
|
|
276
|
+
if: github.ref != 'refs/heads/main'
|
|
277
|
+
run: |
|
|
278
|
+
sam deploy \
|
|
279
|
+
--no-confirm-changeset \
|
|
280
|
+
--no-fail-on-empty-changeset \
|
|
281
|
+
--stack-name dev-stack \
|
|
282
|
+
--parameter-overrides Environment=dev
|
|
283
|
+
|
|
284
|
+
- name: Run integration tests
|
|
285
|
+
run: npm run test:integration
|
|
286
|
+
|
|
287
|
+
- name: Deploy to Prod
|
|
288
|
+
if: github.ref == 'refs/heads/main'
|
|
289
|
+
run: |
|
|
290
|
+
sam deploy \
|
|
291
|
+
--no-confirm-changeset \
|
|
292
|
+
--no-fail-on-empty-changeset \
|
|
293
|
+
--stack-name prod-stack \
|
|
294
|
+
--parameter-overrides Environment=prod
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
## Testing Strategies
|
|
298
|
+
|
|
299
|
+
### Unit Testing
|
|
300
|
+
|
|
301
|
+
**Test business logic independently**:
|
|
302
|
+
|
|
303
|
+
```typescript
|
|
304
|
+
// handler.ts
|
|
305
|
+
export const processOrder = (order: Order): ProcessedOrder => {
|
|
306
|
+
// Pure business logic (easily testable)
|
|
307
|
+
validateOrder(order);
|
|
308
|
+
calculateTotal(order);
|
|
309
|
+
return transformOrder(order);
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export const handler = async (event: any) => {
|
|
313
|
+
const order = parseEvent(event);
|
|
314
|
+
const processed = processOrder(order); // Testable function
|
|
315
|
+
await saveToDatabase(processed);
|
|
316
|
+
return formatResponse(processed);
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
// handler.test.ts
|
|
320
|
+
import { processOrder } from './handler';
|
|
321
|
+
|
|
322
|
+
describe('processOrder', () => {
|
|
323
|
+
it('calculates total correctly', () => {
|
|
324
|
+
const order = {
|
|
325
|
+
items: [
|
|
326
|
+
{ price: 10, quantity: 2 },
|
|
327
|
+
{ price: 5, quantity: 3 },
|
|
328
|
+
],
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
const result = processOrder(order);
|
|
332
|
+
|
|
333
|
+
expect(result.total).toBe(35);
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
it('throws on invalid order', () => {
|
|
337
|
+
const invalid = { items: [] };
|
|
338
|
+
expect(() => processOrder(invalid)).toThrow();
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Integration Testing
|
|
344
|
+
|
|
345
|
+
**Test in actual AWS environment**:
|
|
346
|
+
|
|
347
|
+
```typescript
|
|
348
|
+
// integration.test.ts
|
|
349
|
+
import { LambdaClient, InvokeCommand } from '@aws-sdk/client-lambda';
|
|
350
|
+
import { DynamoDBClient, GetItemCommand } from '@aws-sdk/client-dynamodb';
|
|
351
|
+
|
|
352
|
+
describe('Order Processing Integration', () => {
|
|
353
|
+
const lambda = new LambdaClient({});
|
|
354
|
+
const dynamodb = new DynamoDBClient({});
|
|
355
|
+
|
|
356
|
+
it('processes order end-to-end', async () => {
|
|
357
|
+
// Invoke Lambda
|
|
358
|
+
const response = await lambda.send(new InvokeCommand({
|
|
359
|
+
FunctionName: process.env.FUNCTION_NAME,
|
|
360
|
+
Payload: JSON.stringify({
|
|
361
|
+
orderId: 'test-123',
|
|
362
|
+
items: [{ productId: 'prod-1', quantity: 2 }],
|
|
363
|
+
}),
|
|
364
|
+
}));
|
|
365
|
+
|
|
366
|
+
const result = JSON.parse(Buffer.from(response.Payload!).toString());
|
|
367
|
+
|
|
368
|
+
expect(result.statusCode).toBe(200);
|
|
369
|
+
|
|
370
|
+
// Verify database write
|
|
371
|
+
const dbResult = await dynamodb.send(new GetItemCommand({
|
|
372
|
+
TableName: process.env.TABLE_NAME,
|
|
373
|
+
Key: { orderId: { S: 'test-123' } },
|
|
374
|
+
}));
|
|
375
|
+
|
|
376
|
+
expect(dbResult.Item).toBeDefined();
|
|
377
|
+
expect(dbResult.Item?.status.S).toBe('PROCESSED');
|
|
378
|
+
});
|
|
379
|
+
});
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Local Testing with SAM
|
|
383
|
+
|
|
384
|
+
**Test locally before deployment**:
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
# Start local API
|
|
388
|
+
sam local start-api
|
|
389
|
+
|
|
390
|
+
# Invoke function locally
|
|
391
|
+
sam local invoke OrderFunction -e events/create-order.json
|
|
392
|
+
|
|
393
|
+
# Generate sample events
|
|
394
|
+
sam local generate-event apigateway aws-proxy > event.json
|
|
395
|
+
|
|
396
|
+
# Debug locally
|
|
397
|
+
sam local invoke OrderFunction -d 5858
|
|
398
|
+
|
|
399
|
+
# Test with Docker
|
|
400
|
+
sam local start-api --docker-network my-network
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Load Testing
|
|
404
|
+
|
|
405
|
+
**Test under production load**:
|
|
406
|
+
|
|
407
|
+
```bash
|
|
408
|
+
# Install Artillery
|
|
409
|
+
npm install -g artillery
|
|
410
|
+
|
|
411
|
+
# Create load test
|
|
412
|
+
cat > load-test.yml <<EOF
|
|
413
|
+
config:
|
|
414
|
+
target: https://api.example.com
|
|
415
|
+
phases:
|
|
416
|
+
- duration: 300 # 5 minutes
|
|
417
|
+
arrivalRate: 50 # 50 requests/second
|
|
418
|
+
rampTo: 200 # Ramp to 200 req/sec
|
|
419
|
+
scenarios:
|
|
420
|
+
- flow:
|
|
421
|
+
- post:
|
|
422
|
+
url: /orders
|
|
423
|
+
json:
|
|
424
|
+
orderId: "{{ $randomString() }}"
|
|
425
|
+
EOF
|
|
426
|
+
|
|
427
|
+
# Run load test
|
|
428
|
+
artillery run load-test.yml --output report.json
|
|
429
|
+
|
|
430
|
+
# Generate HTML report
|
|
431
|
+
artillery report report.json
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
## Deployment Strategies
|
|
435
|
+
|
|
436
|
+
### All-at-Once Deployment
|
|
437
|
+
|
|
438
|
+
**Simple, fast, risky**:
|
|
439
|
+
|
|
440
|
+
```yaml
|
|
441
|
+
# SAM template
|
|
442
|
+
Resources:
|
|
443
|
+
OrderFunction:
|
|
444
|
+
Type: AWS::Serverless::Function
|
|
445
|
+
Properties:
|
|
446
|
+
DeploymentPreference:
|
|
447
|
+
Type: AllAtOnce # Deploy immediately
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
**Use for**:
|
|
451
|
+
- Development environments
|
|
452
|
+
- Non-critical applications
|
|
453
|
+
- Quick hotfixes (with caution)
|
|
454
|
+
|
|
455
|
+
### Blue/Green Deployment
|
|
456
|
+
|
|
457
|
+
**Zero-downtime deployment**:
|
|
458
|
+
|
|
459
|
+
```yaml
|
|
460
|
+
Resources:
|
|
461
|
+
OrderFunction:
|
|
462
|
+
Type: AWS::Serverless::Function
|
|
463
|
+
Properties:
|
|
464
|
+
AutoPublishAlias: live
|
|
465
|
+
DeploymentPreference:
|
|
466
|
+
Type: Linear10PercentEvery1Minute
|
|
467
|
+
Alarms:
|
|
468
|
+
- !Ref ErrorAlarm
|
|
469
|
+
- !Ref LatencyAlarm
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
**Deployment types**:
|
|
473
|
+
- **Linear10PercentEvery1Minute**: 10% traffic shift every minute
|
|
474
|
+
- **Linear10PercentEvery2Minutes**: Slower, more conservative
|
|
475
|
+
- **Linear10PercentEvery3Minutes**: Even slower
|
|
476
|
+
- **Linear10PercentEvery10Minutes**: Very gradual
|
|
477
|
+
- **Canary10Percent5Minutes**: 10% for 5 min, then 100%
|
|
478
|
+
- **Canary10Percent10Minutes**: 10% for 10 min, then 100%
|
|
479
|
+
- **Canary10Percent30Minutes**: 10% for 30 min, then 100%
|
|
480
|
+
|
|
481
|
+
### Canary Deployment
|
|
482
|
+
|
|
483
|
+
**Test with subset of traffic**:
|
|
484
|
+
|
|
485
|
+
```yaml
|
|
486
|
+
Resources:
|
|
487
|
+
OrderFunction:
|
|
488
|
+
Type: AWS::Serverless::Function
|
|
489
|
+
Properties:
|
|
490
|
+
AutoPublishAlias: live
|
|
491
|
+
DeploymentPreference:
|
|
492
|
+
Type: Canary10Percent10Minutes
|
|
493
|
+
Alarms:
|
|
494
|
+
- !Ref ErrorAlarm
|
|
495
|
+
- !Ref LatencyAlarm
|
|
496
|
+
Hooks:
|
|
497
|
+
PreTraffic: !Ref PreTrafficHook
|
|
498
|
+
PostTraffic: !Ref PostTrafficHook
|
|
499
|
+
|
|
500
|
+
PreTrafficHook:
|
|
501
|
+
Type: AWS::Serverless::Function
|
|
502
|
+
Properties:
|
|
503
|
+
Handler: hooks.pre_traffic
|
|
504
|
+
Runtime: python3.12
|
|
505
|
+
# Runs before traffic shift
|
|
506
|
+
# Validates new version
|
|
507
|
+
|
|
508
|
+
PostTrafficHook:
|
|
509
|
+
Type: AWS::Serverless::Function
|
|
510
|
+
Properties:
|
|
511
|
+
Handler: hooks.post_traffic
|
|
512
|
+
Runtime: python3.12
|
|
513
|
+
# Runs after traffic shift
|
|
514
|
+
# Validates deployment success
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
**CDK with CodeDeploy**:
|
|
518
|
+
|
|
519
|
+
```typescript
|
|
520
|
+
import * as codedeploy from 'aws-cdk-lib/aws-codedeploy';
|
|
521
|
+
|
|
522
|
+
const alias = fn.currentVersion.addAlias('live');
|
|
523
|
+
|
|
524
|
+
new codedeploy.LambdaDeploymentGroup(this, 'DeploymentGroup', {
|
|
525
|
+
alias,
|
|
526
|
+
deploymentConfig: codedeploy.LambdaDeploymentConfig.CANARY_10PERCENT_10MINUTES,
|
|
527
|
+
alarms: [errorAlarm, latencyAlarm],
|
|
528
|
+
autoRollback: {
|
|
529
|
+
failedDeployment: true,
|
|
530
|
+
stoppedDeployment: true,
|
|
531
|
+
deploymentInAlarm: true,
|
|
532
|
+
},
|
|
533
|
+
});
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
### Deployment Hooks
|
|
537
|
+
|
|
538
|
+
**Pre-traffic hook (validation)**:
|
|
539
|
+
|
|
540
|
+
```python
|
|
541
|
+
# hooks.py
|
|
542
|
+
import boto3
|
|
543
|
+
|
|
544
|
+
lambda_client = boto3.client('lambda')
|
|
545
|
+
codedeploy = boto3.client('codedeploy')
|
|
546
|
+
|
|
547
|
+
def pre_traffic(event, context):
|
|
548
|
+
"""
|
|
549
|
+
Validate new version before traffic shift
|
|
550
|
+
"""
|
|
551
|
+
function_name = event['DeploymentId']
|
|
552
|
+
version = event['NewVersion']
|
|
553
|
+
|
|
554
|
+
try:
|
|
555
|
+
# Invoke new version with test payload
|
|
556
|
+
response = lambda_client.invoke(
|
|
557
|
+
FunctionName=f"{function_name}:{version}",
|
|
558
|
+
InvocationType='RequestResponse',
|
|
559
|
+
Payload=json.dumps({'test': True})
|
|
560
|
+
)
|
|
561
|
+
|
|
562
|
+
# Validate response
|
|
563
|
+
if response['StatusCode'] == 200:
|
|
564
|
+
codedeploy.put_lifecycle_event_hook_execution_status(
|
|
565
|
+
deploymentId=event['DeploymentId'],
|
|
566
|
+
lifecycleEventHookExecutionId=event['LifecycleEventHookExecutionId'],
|
|
567
|
+
status='Succeeded'
|
|
568
|
+
)
|
|
569
|
+
else:
|
|
570
|
+
raise Exception('Validation failed')
|
|
571
|
+
|
|
572
|
+
except Exception as e:
|
|
573
|
+
print(f'Pre-traffic validation failed: {e}')
|
|
574
|
+
codedeploy.put_lifecycle_event_hook_execution_status(
|
|
575
|
+
deploymentId=event['DeploymentId'],
|
|
576
|
+
lifecycleEventHookExecutionId=event['LifecycleEventHookExecutionId'],
|
|
577
|
+
status='Failed'
|
|
578
|
+
)
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
**Post-traffic hook (verification)**:
|
|
582
|
+
|
|
583
|
+
```python
|
|
584
|
+
def post_traffic(event, context):
|
|
585
|
+
"""
|
|
586
|
+
Verify deployment success after traffic shift
|
|
587
|
+
"""
|
|
588
|
+
try:
|
|
589
|
+
# Check CloudWatch metrics
|
|
590
|
+
cloudwatch = boto3.client('cloudwatch')
|
|
591
|
+
|
|
592
|
+
metrics = cloudwatch.get_metric_statistics(
|
|
593
|
+
Namespace='AWS/Lambda',
|
|
594
|
+
MetricName='Errors',
|
|
595
|
+
Dimensions=[{'Name': 'FunctionName', 'Value': function_name}],
|
|
596
|
+
StartTime=deployment_start_time,
|
|
597
|
+
EndTime=datetime.utcnow(),
|
|
598
|
+
Period=300,
|
|
599
|
+
Statistics=['Sum']
|
|
600
|
+
)
|
|
601
|
+
|
|
602
|
+
# Validate no errors
|
|
603
|
+
total_errors = sum(point['Sum'] for point in metrics['Datapoints'])
|
|
604
|
+
|
|
605
|
+
if total_errors == 0:
|
|
606
|
+
codedeploy.put_lifecycle_event_hook_execution_status(
|
|
607
|
+
deploymentId=event['DeploymentId'],
|
|
608
|
+
lifecycleEventHookExecutionId=event['LifecycleEventHookExecutionId'],
|
|
609
|
+
status='Succeeded'
|
|
610
|
+
)
|
|
611
|
+
else:
|
|
612
|
+
raise Exception(f'{total_errors} errors detected')
|
|
613
|
+
|
|
614
|
+
except Exception as e:
|
|
615
|
+
print(f'Post-traffic verification failed: {e}')
|
|
616
|
+
codedeploy.put_lifecycle_event_hook_execution_status(
|
|
617
|
+
deploymentId=event['DeploymentId'],
|
|
618
|
+
lifecycleEventHookExecutionId=event['LifecycleEventHookExecutionId'],
|
|
619
|
+
status='Failed'
|
|
620
|
+
)
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
## Rollback and Safety
|
|
624
|
+
|
|
625
|
+
### Automatic Rollback
|
|
626
|
+
|
|
627
|
+
**Configure rollback triggers**:
|
|
628
|
+
|
|
629
|
+
```yaml
|
|
630
|
+
DeploymentPreference:
|
|
631
|
+
Type: Canary10Percent10Minutes
|
|
632
|
+
Alarms:
|
|
633
|
+
- !Ref ErrorAlarm
|
|
634
|
+
- !Ref LatencyAlarm
|
|
635
|
+
# Automatically rolls back if alarms trigger
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
**Rollback scenarios**:
|
|
639
|
+
- CloudWatch alarm triggers during deployment
|
|
640
|
+
- Pre-traffic hook fails
|
|
641
|
+
- Post-traffic hook fails
|
|
642
|
+
- Deployment manually stopped
|
|
643
|
+
|
|
644
|
+
### CloudWatch Alarms for Deployment
|
|
645
|
+
|
|
646
|
+
**Critical alarms during deployment**:
|
|
647
|
+
|
|
648
|
+
```typescript
|
|
649
|
+
// Error rate alarm
|
|
650
|
+
const errorAlarm = new cloudwatch.Alarm(this, 'ErrorAlarm', {
|
|
651
|
+
metric: fn.metricErrors({
|
|
652
|
+
statistic: 'Sum',
|
|
653
|
+
period: Duration.minutes(1),
|
|
654
|
+
}),
|
|
655
|
+
threshold: 5,
|
|
656
|
+
evaluationPeriods: 2,
|
|
657
|
+
treatMissingData: cloudwatch.TreatMissingData.NOT_BREACHING,
|
|
658
|
+
});
|
|
659
|
+
|
|
660
|
+
// Duration alarm (regression)
|
|
661
|
+
const durationAlarm = new cloudwatch.Alarm(this, 'DurationAlarm', {
|
|
662
|
+
metric: fn.metricDuration({
|
|
663
|
+
statistic: 'Average',
|
|
664
|
+
period: Duration.minutes(1),
|
|
665
|
+
}),
|
|
666
|
+
threshold: previousAvgDuration * 1.2, // 20% increase
|
|
667
|
+
evaluationPeriods: 2,
|
|
668
|
+
comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD,
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
// Throttle alarm
|
|
672
|
+
const throttleAlarm = new cloudwatch.Alarm(this, 'ThrottleAlarm', {
|
|
673
|
+
metric: fn.metricThrottles({
|
|
674
|
+
statistic: 'Sum',
|
|
675
|
+
period: Duration.minutes(1),
|
|
676
|
+
}),
|
|
677
|
+
threshold: 1,
|
|
678
|
+
evaluationPeriods: 1,
|
|
679
|
+
});
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
### Version Management
|
|
683
|
+
|
|
684
|
+
**Use Lambda versions and aliases**:
|
|
685
|
+
|
|
686
|
+
```typescript
|
|
687
|
+
const version = fn.currentVersion;
|
|
688
|
+
|
|
689
|
+
const prodAlias = version.addAlias('prod');
|
|
690
|
+
const devAlias = version.addAlias('dev');
|
|
691
|
+
|
|
692
|
+
// Gradual rollout with weighted aliases
|
|
693
|
+
new lambda.Alias(this, 'LiveAlias', {
|
|
694
|
+
aliasName: 'live',
|
|
695
|
+
version: newVersion,
|
|
696
|
+
additionalVersions: [
|
|
697
|
+
{ version: oldVersion, weight: 0.9 }, // 90% old
|
|
698
|
+
// 10% automatically goes to main version (new)
|
|
699
|
+
],
|
|
700
|
+
});
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
## Best Practices Checklist
|
|
704
|
+
|
|
705
|
+
### Pre-Deployment
|
|
706
|
+
|
|
707
|
+
- [ ] Code review completed
|
|
708
|
+
- [ ] Unit tests passing
|
|
709
|
+
- [ ] Integration tests passing
|
|
710
|
+
- [ ] Security scan completed
|
|
711
|
+
- [ ] Dependencies updated
|
|
712
|
+
- [ ] Infrastructure validated (CDK synth, SAM validate)
|
|
713
|
+
- [ ] Environment variables configured
|
|
714
|
+
|
|
715
|
+
### Deployment
|
|
716
|
+
|
|
717
|
+
- [ ] Use IaC (SAM, CDK, Terraform)
|
|
718
|
+
- [ ] Separate environments (dev, staging, prod)
|
|
719
|
+
- [ ] Automate deployments via CI/CD
|
|
720
|
+
- [ ] Use gradual deployment (canary or linear)
|
|
721
|
+
- [ ] Configure CloudWatch alarms
|
|
722
|
+
- [ ] Enable automatic rollback
|
|
723
|
+
- [ ] Use deployment hooks for validation
|
|
724
|
+
|
|
725
|
+
### Post-Deployment
|
|
726
|
+
|
|
727
|
+
- [ ] Monitor CloudWatch metrics
|
|
728
|
+
- [ ] Check CloudWatch Logs for errors
|
|
729
|
+
- [ ] Verify X-Ray traces
|
|
730
|
+
- [ ] Validate business metrics
|
|
731
|
+
- [ ] Check alarm status
|
|
732
|
+
- [ ] Review deployment logs
|
|
733
|
+
- [ ] Document any issues
|
|
734
|
+
|
|
735
|
+
### Rollback Preparation
|
|
736
|
+
|
|
737
|
+
- [ ] Keep previous version available
|
|
738
|
+
- [ ] Document rollback procedure
|
|
739
|
+
- [ ] Test rollback in non-prod
|
|
740
|
+
- [ ] Configure automatic rollback
|
|
741
|
+
- [ ] Monitor during rollback
|
|
742
|
+
- [ ] Communication plan for rollback
|
|
743
|
+
|
|
744
|
+
## Deployment Patterns
|
|
745
|
+
|
|
746
|
+
### Multi-Region Deployment
|
|
747
|
+
|
|
748
|
+
**Active-Passive**:
|
|
749
|
+
|
|
750
|
+
```typescript
|
|
751
|
+
// Primary region
|
|
752
|
+
new ServerlessStack(app, 'PrimaryStack', {
|
|
753
|
+
env: { region: 'us-east-1' },
|
|
754
|
+
isPrimary: true,
|
|
755
|
+
});
|
|
756
|
+
|
|
757
|
+
// Secondary region (standby)
|
|
758
|
+
new ServerlessStack(app, 'SecondaryStack', {
|
|
759
|
+
env: { region: 'us-west-2' },
|
|
760
|
+
isPrimary: false,
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
// Route 53 health check and failover
|
|
764
|
+
const healthCheck = new route53.CfnHealthCheck(this, 'HealthCheck', {
|
|
765
|
+
type: 'HTTPS',
|
|
766
|
+
resourcePath: '/health',
|
|
767
|
+
fullyQualifiedDomainName: 'api.example.com',
|
|
768
|
+
});
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
**Active-Active**:
|
|
772
|
+
|
|
773
|
+
```typescript
|
|
774
|
+
// Deploy to multiple regions
|
|
775
|
+
const regions = ['us-east-1', 'us-west-2', 'eu-west-1'];
|
|
776
|
+
|
|
777
|
+
for (const region of regions) {
|
|
778
|
+
new ServerlessStack(app, `Stack-${region}`, {
|
|
779
|
+
env: { region },
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
// Route 53 geolocation routing
|
|
784
|
+
new route53.ARecord(this, 'GeoRecord', {
|
|
785
|
+
zone: hostedZone,
|
|
786
|
+
recordName: 'api',
|
|
787
|
+
target: route53.RecordTarget.fromAlias(
|
|
788
|
+
new targets.ApiGatewayDomain(domain)
|
|
789
|
+
),
|
|
790
|
+
geoLocation: route53.GeoLocation.country('US'),
|
|
791
|
+
});
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
### Feature Flags with AppConfig
|
|
795
|
+
|
|
796
|
+
**Safe feature rollout**:
|
|
797
|
+
|
|
798
|
+
```typescript
|
|
799
|
+
import { AppConfigData } from '@aws-sdk/client-appconfigdata';
|
|
800
|
+
|
|
801
|
+
const appconfig = new AppConfigData({});
|
|
802
|
+
|
|
803
|
+
export const handler = async (event: any) => {
|
|
804
|
+
// Fetch feature flags
|
|
805
|
+
const config = await appconfig.getLatestConfiguration({
|
|
806
|
+
ConfigurationToken: token,
|
|
807
|
+
});
|
|
808
|
+
|
|
809
|
+
const features = JSON.parse(config.Configuration.toString());
|
|
810
|
+
|
|
811
|
+
if (features.newFeatureEnabled) {
|
|
812
|
+
return newFeatureHandler(event);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
return legacyHandler(event);
|
|
816
|
+
};
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
## Summary
|
|
820
|
+
|
|
821
|
+
- **IaC**: Use SAM or CDK for all deployments
|
|
822
|
+
- **Environments**: Separate dev, staging, production
|
|
823
|
+
- **CI/CD**: Automate build, test, and deployment
|
|
824
|
+
- **Testing**: Unit, integration, and load testing
|
|
825
|
+
- **Gradual Deployment**: Use canary or linear for production
|
|
826
|
+
- **Alarms**: Configure and monitor during deployment
|
|
827
|
+
- **Rollback**: Enable automatic rollback on failures
|
|
828
|
+
- **Hooks**: Validate before and after traffic shifts
|
|
829
|
+
- **Versioning**: Use Lambda versions and aliases
|
|
830
|
+
- **Multi-Region**: Plan for disaster recovery
|