specweave 0.21.1 → 0.21.3
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/CLAUDE.md +232 -5
- package/dist/plugins/specweave-github/lib/IssueStateManager.d.ts +98 -0
- package/dist/plugins/specweave-github/lib/IssueStateManager.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/IssueStateManager.js +146 -0
- package/dist/plugins/specweave-github/lib/IssueStateManager.js.map +1 -0
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.js +6 -0
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.js.map +1 -1
- package/dist/src/cli/commands/check-hooks.d.ts +11 -0
- package/dist/src/cli/commands/check-hooks.d.ts.map +1 -0
- package/dist/src/cli/commands/check-hooks.js +144 -0
- package/dist/src/cli/commands/check-hooks.js.map +1 -0
- package/dist/src/cli/commands/cicd-monitor.js +3 -3
- package/dist/src/cli/commands/cicd-monitor.js.map +1 -1
- package/dist/src/cli/commands/import-docs.js +2 -2
- package/dist/src/cli/commands/import-docs.js.map +1 -1
- package/dist/src/cli/commands/init-multiproject.js +4 -4
- package/dist/src/cli/commands/init-multiproject.js.map +1 -1
- package/dist/src/cli/commands/migrate-to-multiproject.js +3 -3
- package/dist/src/cli/commands/migrate-to-multiproject.js.map +1 -1
- package/dist/src/cli/commands/plan/agent-invoker.d.ts +79 -0
- package/dist/src/cli/commands/plan/agent-invoker.d.ts.map +1 -0
- package/dist/src/cli/commands/plan/agent-invoker.js +383 -0
- package/dist/src/cli/commands/plan/agent-invoker.js.map +1 -0
- package/dist/src/cli/commands/plan/increment-detector.d.ts +27 -0
- package/dist/src/cli/commands/plan/increment-detector.d.ts.map +1 -0
- package/dist/src/cli/commands/plan/increment-detector.js +159 -0
- package/dist/src/cli/commands/plan/increment-detector.js.map +1 -0
- package/dist/src/cli/commands/plan/plan-orchestrator.d.ts +45 -0
- package/dist/src/cli/commands/plan/plan-orchestrator.d.ts.map +1 -0
- package/dist/src/cli/commands/plan/plan-orchestrator.js +229 -0
- package/dist/src/cli/commands/plan/plan-orchestrator.js.map +1 -0
- package/dist/src/cli/commands/plan/plan-validator.d.ts +36 -0
- package/dist/src/cli/commands/plan/plan-validator.d.ts.map +1 -0
- package/dist/src/cli/commands/plan/plan-validator.js +174 -0
- package/dist/src/cli/commands/plan/plan-validator.js.map +1 -0
- package/dist/src/cli/commands/plan/types.d.ts +170 -0
- package/dist/src/cli/commands/plan/types.d.ts.map +1 -0
- package/dist/src/cli/commands/plan/types.js +42 -0
- package/dist/src/cli/commands/plan/types.js.map +1 -0
- package/dist/src/cli/commands/plan-command.d.ts +16 -0
- package/dist/src/cli/commands/plan-command.d.ts.map +1 -0
- package/dist/src/cli/commands/plan-command.js +127 -0
- package/dist/src/cli/commands/plan-command.js.map +1 -0
- package/dist/src/cli/commands/switch-project.js +3 -3
- package/dist/src/cli/commands/switch-project.js.map +1 -1
- package/dist/src/cli/commands/validate-parent-repo.js +1 -1
- package/dist/src/cli/commands/validate-parent-repo.js.map +1 -1
- package/dist/src/config/ConfigManager.d.ts +69 -0
- package/dist/src/config/ConfigManager.d.ts.map +1 -0
- package/dist/src/config/ConfigManager.js +130 -0
- package/dist/src/config/ConfigManager.js.map +1 -0
- package/dist/src/config/types.d.ts +1357 -0
- package/dist/src/config/types.d.ts.map +1 -0
- package/dist/src/config/types.js +67 -0
- package/dist/src/config/types.js.map +1 -0
- package/dist/src/core/brownfield/importer.d.ts +1 -1
- package/dist/src/core/brownfield/importer.d.ts.map +1 -1
- package/dist/src/core/brownfield/importer.js +3 -3
- package/dist/src/core/brownfield/importer.js.map +1 -1
- package/dist/src/core/cicd/config-loader.d.ts +1 -1
- package/dist/src/core/cicd/config-loader.d.ts.map +1 -1
- package/dist/src/core/cicd/index.d.ts +6 -6
- package/dist/src/core/cicd/index.d.ts.map +1 -1
- package/dist/src/core/cicd/index.js +6 -6
- package/dist/src/core/cicd/index.js.map +1 -1
- package/dist/src/core/cicd/monitor-service.d.ts +3 -3
- package/dist/src/core/cicd/monitor-service.d.ts.map +1 -1
- package/dist/src/core/cicd/monitor-service.js +3 -3
- package/dist/src/core/cicd/monitor-service.js.map +1 -1
- package/dist/src/core/cicd/notifier.d.ts +1 -1
- package/dist/src/core/cicd/notifier.d.ts.map +1 -1
- package/dist/src/core/cicd/state-manager.d.ts +1 -1
- package/dist/src/core/cicd/state-manager.d.ts.map +1 -1
- package/dist/src/core/cicd/state-manager.js +1 -1
- package/dist/src/core/cicd/state-manager.js.map +1 -1
- package/dist/src/core/cicd/workflow-monitor.d.ts +1 -1
- package/dist/src/core/cicd/workflow-monitor.d.ts.map +1 -1
- package/dist/src/core/cicd/workflow-monitor.js +1 -1
- package/dist/src/core/cicd/workflow-monitor.js.map +1 -1
- package/dist/src/core/cost-tracker.d.ts +2 -2
- package/dist/src/core/cost-tracker.d.ts.map +1 -1
- package/dist/src/core/cost-tracker.js +1 -1
- package/dist/src/core/cost-tracker.js.map +1 -1
- package/dist/src/core/hooks/HealthReporter.d.ts +55 -0
- package/dist/src/core/hooks/HealthReporter.d.ts.map +1 -0
- package/dist/src/core/hooks/HealthReporter.js +268 -0
- package/dist/src/core/hooks/HealthReporter.js.map +1 -0
- package/dist/src/core/hooks/HookAutoFixer.d.ts +41 -0
- package/dist/src/core/hooks/HookAutoFixer.d.ts.map +1 -0
- package/dist/src/core/hooks/HookAutoFixer.js +222 -0
- package/dist/src/core/hooks/HookAutoFixer.js.map +1 -0
- package/dist/src/core/hooks/HookExecutor.d.ts +57 -0
- package/dist/src/core/hooks/HookExecutor.d.ts.map +1 -0
- package/dist/src/core/hooks/HookExecutor.js +287 -0
- package/dist/src/core/hooks/HookExecutor.js.map +1 -0
- package/dist/src/core/hooks/HookHealthChecker.d.ts +51 -0
- package/dist/src/core/hooks/HookHealthChecker.d.ts.map +1 -0
- package/dist/src/core/hooks/HookHealthChecker.js +212 -0
- package/dist/src/core/hooks/HookHealthChecker.js.map +1 -0
- package/dist/src/core/hooks/HookScanner.d.ts +65 -0
- package/dist/src/core/hooks/HookScanner.d.ts.map +1 -0
- package/dist/src/core/hooks/HookScanner.js +214 -0
- package/dist/src/core/hooks/HookScanner.js.map +1 -0
- package/dist/src/core/hooks/types.d.ts +281 -0
- package/dist/src/core/hooks/types.d.ts.map +1 -0
- package/dist/src/core/hooks/types.js +10 -0
- package/dist/src/core/hooks/types.js.map +1 -0
- package/dist/src/core/iac/index.d.ts +10 -0
- package/dist/src/core/iac/index.d.ts.map +1 -0
- package/dist/src/core/iac/index.js +11 -0
- package/dist/src/core/iac/index.js.map +1 -0
- package/dist/src/core/iac/template-engine.d.ts +77 -0
- package/dist/src/core/iac/template-engine.d.ts.map +1 -0
- package/dist/src/core/iac/template-engine.js +182 -0
- package/dist/src/core/iac/template-engine.js.map +1 -0
- package/dist/src/core/increment/ac-status-manager.d.ts +115 -0
- package/dist/src/core/increment/ac-status-manager.d.ts.map +1 -0
- package/dist/src/core/increment/ac-status-manager.js +343 -0
- package/dist/src/core/increment/ac-status-manager.js.map +1 -0
- package/dist/src/core/increment/auto-transition-manager.d.ts +60 -0
- package/dist/src/core/increment/auto-transition-manager.d.ts.map +1 -0
- package/dist/src/core/increment/auto-transition-manager.js +192 -0
- package/dist/src/core/increment/auto-transition-manager.js.map +1 -0
- package/dist/src/core/increment/limits.d.ts +1 -1
- package/dist/src/core/increment/limits.d.ts.map +1 -1
- package/dist/src/core/increment/limits.js +2 -2
- package/dist/src/core/increment/limits.js.map +1 -1
- package/dist/src/core/increment/spec-sync-manager.d.ts +177 -0
- package/dist/src/core/increment/spec-sync-manager.d.ts.map +1 -0
- package/dist/src/core/increment/spec-sync-manager.js +496 -0
- package/dist/src/core/increment/spec-sync-manager.js.map +1 -0
- package/dist/src/core/increment/status-auto-transition.d.ts +46 -0
- package/dist/src/core/increment/status-auto-transition.d.ts.map +1 -0
- package/dist/src/core/increment/status-auto-transition.js +178 -0
- package/dist/src/core/increment/status-auto-transition.js.map +1 -0
- package/dist/src/core/increment/task-state-manager.d.ts +75 -0
- package/dist/src/core/increment/task-state-manager.d.ts.map +1 -0
- package/dist/src/core/increment/task-state-manager.js +117 -0
- package/dist/src/core/increment/task-state-manager.js.map +1 -0
- package/dist/src/core/living-docs/CodeValidator.d.ts +68 -0
- package/dist/src/core/living-docs/CodeValidator.d.ts.map +1 -0
- package/dist/src/core/living-docs/CodeValidator.js +160 -0
- package/dist/src/core/living-docs/CodeValidator.js.map +1 -0
- package/dist/src/core/living-docs/CompletionPropagator.d.ts +84 -0
- package/dist/src/core/living-docs/CompletionPropagator.d.ts.map +1 -0
- package/dist/src/core/living-docs/CompletionPropagator.js +205 -0
- package/dist/src/core/living-docs/CompletionPropagator.js.map +1 -0
- package/dist/src/core/living-docs/ProjectDetector.d.ts +29 -0
- package/dist/src/core/living-docs/ProjectDetector.d.ts.map +1 -0
- package/dist/src/core/living-docs/ProjectDetector.js +94 -0
- package/dist/src/core/living-docs/ProjectDetector.js.map +1 -0
- package/dist/src/core/living-docs/SpecDistributor.d.ts +55 -0
- package/dist/src/core/living-docs/SpecDistributor.d.ts.map +1 -0
- package/dist/src/core/living-docs/SpecDistributor.js +216 -0
- package/dist/src/core/living-docs/SpecDistributor.js.map +1 -0
- package/dist/src/core/living-docs/ThreeLayerSyncManager.d.ts +116 -0
- package/dist/src/core/living-docs/ThreeLayerSyncManager.d.ts.map +1 -0
- package/dist/src/core/living-docs/ThreeLayerSyncManager.js +356 -0
- package/dist/src/core/living-docs/ThreeLayerSyncManager.js.map +1 -0
- package/dist/src/core/living-docs/hierarchy-mapper.d.ts.map +1 -1
- package/dist/src/core/living-docs/hierarchy-mapper.js +2 -1
- package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -1
- package/dist/src/core/living-docs/index.d.ts +1 -1
- package/dist/src/core/living-docs/index.d.ts.map +1 -1
- package/dist/src/core/living-docs/index.js +5 -1
- package/dist/src/core/living-docs/index.js.map +1 -1
- package/dist/src/core/living-docs/types.d.ts +70 -300
- package/dist/src/core/living-docs/types.d.ts.map +1 -1
- package/dist/src/core/living-docs/types.js +2 -10
- package/dist/src/core/living-docs/types.js.map +1 -1
- package/dist/src/core/project-manager.d.ts +1 -1
- package/dist/src/core/project-manager.d.ts.map +1 -1
- package/dist/src/core/project-manager.js +2 -2
- package/dist/src/core/project-manager.js.map +1 -1
- package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
- package/dist/src/core/qa/quality-gate-decider.d.ts.map +1 -1
- package/dist/src/core/qa/risk-calculator.d.ts +1 -1
- package/dist/src/core/qa/risk-calculator.d.ts.map +1 -1
- package/dist/src/core/repo-structure/setup-summary.d.ts +1 -1
- package/dist/src/core/repo-structure/setup-summary.d.ts.map +1 -1
- package/dist/src/core/rfc-generator-v2.d.ts +1 -1
- package/dist/src/core/rfc-generator-v2.d.ts.map +1 -1
- package/dist/src/core/rfc-generator-v2.js +1 -1
- package/dist/src/core/rfc-generator-v2.js.map +1 -1
- package/dist/src/core/serverless/context-detector.d.ts +12 -0
- package/dist/src/core/serverless/context-detector.d.ts.map +1 -0
- package/dist/src/core/serverless/context-detector.js +213 -0
- package/dist/src/core/serverless/context-detector.js.map +1 -0
- package/dist/src/core/serverless/cost-comparison.d.ts +73 -0
- package/dist/src/core/serverless/cost-comparison.d.ts.map +1 -0
- package/dist/src/core/serverless/cost-comparison.js +198 -0
- package/dist/src/core/serverless/cost-comparison.js.map +1 -0
- package/dist/src/core/serverless/cost-estimator.d.ts +69 -0
- package/dist/src/core/serverless/cost-estimator.d.ts.map +1 -0
- package/dist/src/core/serverless/cost-estimator.js +127 -0
- package/dist/src/core/serverless/cost-estimator.js.map +1 -0
- package/dist/src/core/serverless/cost-optimizer.d.ts +57 -0
- package/dist/src/core/serverless/cost-optimizer.d.ts.map +1 -0
- package/dist/src/core/serverless/cost-optimizer.js +221 -0
- package/dist/src/core/serverless/cost-optimizer.js.map +1 -0
- package/dist/src/core/serverless/index.d.ts +20 -0
- package/dist/src/core/serverless/index.d.ts.map +1 -0
- package/dist/src/core/serverless/index.js +26 -0
- package/dist/src/core/serverless/index.js.map +1 -0
- package/dist/src/core/serverless/learning-path-recommender.d.ts +152 -0
- package/dist/src/core/serverless/learning-path-recommender.d.ts.map +1 -0
- package/dist/src/core/serverless/learning-path-recommender.js +389 -0
- package/dist/src/core/serverless/learning-path-recommender.js.map +1 -0
- package/dist/src/core/serverless/platform-data-loader.d.ts +22 -0
- package/dist/src/core/serverless/platform-data-loader.d.ts.map +1 -0
- package/dist/src/core/serverless/platform-data-loader.js +49 -0
- package/dist/src/core/serverless/platform-data-loader.js.map +1 -0
- package/dist/src/core/serverless/platform-selector.d.ts +20 -0
- package/dist/src/core/serverless/platform-selector.d.ts.map +1 -0
- package/dist/src/core/serverless/platform-selector.js +279 -0
- package/dist/src/core/serverless/platform-selector.js.map +1 -0
- package/dist/src/core/serverless/recommendation-formatter.d.ts +24 -0
- package/dist/src/core/serverless/recommendation-formatter.d.ts.map +1 -0
- package/dist/src/core/serverless/recommendation-formatter.js +70 -0
- package/dist/src/core/serverless/recommendation-formatter.js.map +1 -0
- package/dist/src/core/serverless/suitability-analyzer.d.ts +22 -0
- package/dist/src/core/serverless/suitability-analyzer.d.ts.map +1 -0
- package/dist/src/core/serverless/suitability-analyzer.js +262 -0
- package/dist/src/core/serverless/suitability-analyzer.js.map +1 -0
- package/dist/src/core/serverless/types.d.ts +96 -0
- package/dist/src/core/serverless/types.d.ts.map +1 -0
- package/dist/src/core/serverless/types.js +5 -0
- package/dist/src/core/serverless/types.js.map +1 -0
- package/dist/src/core/sync/bidirectional-engine.d.ts +1 -1
- package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -1
- package/dist/src/core/sync/enhanced-content-builder.d.ts +1 -1
- package/dist/src/core/sync/enhanced-content-builder.d.ts.map +1 -1
- package/dist/src/core/sync/profile-manager.d.ts +1 -1
- package/dist/src/core/sync/profile-manager.d.ts.map +1 -1
- package/dist/src/core/sync/profile-selector.d.ts +1 -1
- package/dist/src/core/sync/profile-selector.d.ts.map +1 -1
- package/dist/src/core/sync/profile-selector.js +1 -1
- package/dist/src/core/sync/profile-selector.js.map +1 -1
- package/dist/src/core/sync/project-context.d.ts +1 -1
- package/dist/src/core/sync/project-context.d.ts.map +1 -1
- package/dist/src/core/sync/rate-limiter.d.ts +1 -1
- package/dist/src/core/sync/rate-limiter.d.ts.map +1 -1
- package/dist/src/core/sync/status-sync-engine.d.ts +2 -2
- package/dist/src/core/sync/status-sync-engine.d.ts.map +1 -1
- package/dist/src/core/sync/status-sync-engine.js +2 -2
- package/dist/src/core/sync/status-sync-engine.js.map +1 -1
- package/dist/src/core/sync/time-range-selector.d.ts +1 -1
- package/dist/src/core/sync/time-range-selector.d.ts.map +1 -1
- package/dist/src/core/sync/time-range-selector.js +1 -1
- package/dist/src/core/sync/time-range-selector.js.map +1 -1
- package/dist/src/core/types/increment-metadata.d.ts +27 -0
- package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
- package/dist/src/core/types/increment-metadata.js +45 -1
- package/dist/src/core/types/increment-metadata.js.map +1 -1
- package/dist/src/core/types/sync-profile.d.ts +2 -0
- package/dist/src/core/types/sync-profile.d.ts.map +1 -1
- package/dist/src/core/types/sync-profile.js.map +1 -1
- package/dist/src/core/validation/increment-structure-validator.d.ts +47 -0
- package/dist/src/core/validation/increment-structure-validator.d.ts.map +1 -0
- package/dist/src/core/validation/increment-structure-validator.js +187 -0
- package/dist/src/core/validation/increment-structure-validator.js.map +1 -0
- package/dist/src/core/validation/three-file-validator.d.ts +82 -0
- package/dist/src/core/validation/three-file-validator.d.ts.map +1 -0
- package/dist/src/core/validation/three-file-validator.js +320 -0
- package/dist/src/core/validation/three-file-validator.js.map +1 -0
- package/dist/src/core/workflow/phase-detector.d.ts +103 -0
- package/dist/src/core/workflow/phase-detector.d.ts.map +1 -0
- package/dist/src/core/workflow/phase-detector.js +704 -0
- package/dist/src/core/workflow/phase-detector.js.map +1 -0
- package/dist/src/core/workflow/types.d.ts +153 -0
- package/dist/src/core/workflow/types.d.ts.map +1 -0
- package/dist/src/core/workflow/types.js +47 -0
- package/dist/src/core/workflow/types.js.map +1 -0
- package/dist/src/init/InitFlow.d.ts +37 -0
- package/dist/src/init/InitFlow.d.ts.map +1 -0
- package/dist/src/init/InitFlow.js +209 -0
- package/dist/src/init/InitFlow.js.map +1 -0
- package/dist/src/init/architecture/ArchitectureDecisionEngine.d.ts +107 -0
- package/dist/src/init/architecture/ArchitectureDecisionEngine.d.ts.map +1 -0
- package/dist/src/init/architecture/ArchitectureDecisionEngine.js +405 -0
- package/dist/src/init/architecture/ArchitectureDecisionEngine.js.map +1 -0
- package/dist/src/init/architecture/CloudCreditsDatabase.d.ts +11 -0
- package/dist/src/init/architecture/CloudCreditsDatabase.d.ts.map +1 -0
- package/dist/src/init/architecture/CloudCreditsDatabase.js +92 -0
- package/dist/src/init/architecture/CloudCreditsDatabase.js.map +1 -0
- package/dist/src/init/architecture/types.d.ts +251 -0
- package/dist/src/init/architecture/types.d.ts.map +1 -0
- package/dist/src/init/architecture/types.js +54 -0
- package/dist/src/init/architecture/types.js.map +1 -0
- package/dist/src/init/compliance/ComplianceDetector.d.ts +17 -0
- package/dist/src/init/compliance/ComplianceDetector.d.ts.map +1 -0
- package/dist/src/init/compliance/ComplianceDetector.js +64 -0
- package/dist/src/init/compliance/ComplianceDetector.js.map +1 -0
- package/dist/src/init/compliance/standards-database.d.ts +48 -0
- package/dist/src/init/compliance/standards-database.d.ts.map +1 -0
- package/dist/src/init/compliance/standards-database.js +506 -0
- package/dist/src/init/compliance/standards-database.js.map +1 -0
- package/dist/src/init/compliance/types.d.ts +91 -0
- package/dist/src/init/compliance/types.d.ts.map +1 -0
- package/dist/src/init/compliance/types.js +43 -0
- package/dist/src/init/compliance/types.js.map +1 -0
- package/dist/src/init/repo/GitHubAPIClient.d.ts +51 -0
- package/dist/src/init/repo/GitHubAPIClient.d.ts.map +1 -0
- package/dist/src/init/repo/GitHubAPIClient.js +144 -0
- package/dist/src/init/repo/GitHubAPIClient.js.map +1 -0
- package/dist/src/init/repo/RepositorySelector.d.ts +45 -0
- package/dist/src/init/repo/RepositorySelector.d.ts.map +1 -0
- package/dist/src/init/repo/RepositorySelector.js +106 -0
- package/dist/src/init/repo/RepositorySelector.js.map +1 -0
- package/dist/src/init/repo/types.d.ts +95 -0
- package/dist/src/init/repo/types.d.ts.map +1 -0
- package/dist/src/init/repo/types.js +25 -0
- package/dist/src/init/repo/types.js.map +1 -0
- package/dist/src/init/research/CompetitorAnalyzer.d.ts +79 -0
- package/dist/src/init/research/CompetitorAnalyzer.d.ts.map +1 -0
- package/dist/src/init/research/CompetitorAnalyzer.js +265 -0
- package/dist/src/init/research/CompetitorAnalyzer.js.map +1 -0
- package/dist/src/init/research/MarketDetector.d.ts +62 -0
- package/dist/src/init/research/MarketDetector.d.ts.map +1 -0
- package/dist/src/init/research/MarketDetector.js +247 -0
- package/dist/src/init/research/MarketDetector.js.map +1 -0
- package/dist/src/init/research/OpportunityScorer.d.ts +58 -0
- package/dist/src/init/research/OpportunityScorer.d.ts.map +1 -0
- package/dist/src/init/research/OpportunityScorer.js +194 -0
- package/dist/src/init/research/OpportunityScorer.js.map +1 -0
- package/dist/src/init/research/QuestionGenerator.d.ts +68 -0
- package/dist/src/init/research/QuestionGenerator.d.ts.map +1 -0
- package/dist/src/init/research/QuestionGenerator.js +244 -0
- package/dist/src/init/research/QuestionGenerator.js.map +1 -0
- package/dist/src/init/research/ReportGenerator.d.ts +36 -0
- package/dist/src/init/research/ReportGenerator.d.ts.map +1 -0
- package/dist/src/init/research/ReportGenerator.js +125 -0
- package/dist/src/init/research/ReportGenerator.js.map +1 -0
- package/dist/src/init/research/VisionAnalyzer.d.ts +129 -0
- package/dist/src/init/research/VisionAnalyzer.d.ts.map +1 -0
- package/dist/src/init/research/VisionAnalyzer.js +212 -0
- package/dist/src/init/research/VisionAnalyzer.js.map +1 -0
- package/dist/src/init/research/keyword-extractor.d.ts +78 -0
- package/dist/src/init/research/keyword-extractor.d.ts.map +1 -0
- package/dist/src/init/research/keyword-extractor.js +230 -0
- package/dist/src/init/research/keyword-extractor.js.map +1 -0
- package/dist/src/init/research/src/config/ConfigManager.d.ts +14 -0
- package/dist/src/init/research/src/config/ConfigManager.d.ts.map +1 -0
- package/dist/src/init/research/src/config/ConfigManager.js +45 -0
- package/dist/src/init/research/src/config/ConfigManager.js.map +1 -0
- package/dist/src/init/research/src/config/types.d.ts +102 -0
- package/dist/src/init/research/src/config/types.d.ts.map +1 -0
- package/dist/src/init/research/src/config/types.js +24 -0
- package/dist/src/init/research/src/config/types.js.map +1 -0
- package/dist/src/init/research/types.d.ts +183 -0
- package/dist/src/init/research/types.d.ts.map +1 -0
- package/dist/src/init/research/types.js +65 -0
- package/dist/src/init/research/types.js.map +1 -0
- package/dist/src/init/team/ServerlessSavingsCalculator.d.ts +136 -0
- package/dist/src/init/team/ServerlessSavingsCalculator.d.ts.map +1 -0
- package/dist/src/init/team/ServerlessSavingsCalculator.js +360 -0
- package/dist/src/init/team/ServerlessSavingsCalculator.js.map +1 -0
- package/dist/src/init/team/TeamRecommender.d.ts +122 -0
- package/dist/src/init/team/TeamRecommender.d.ts.map +1 -0
- package/dist/src/init/team/TeamRecommender.js +405 -0
- package/dist/src/init/team/TeamRecommender.js.map +1 -0
- package/dist/src/init/team/types.d.ts +95 -0
- package/dist/src/init/team/types.d.ts.map +1 -0
- package/dist/src/init/team/types.js +23 -0
- package/dist/src/init/team/types.js.map +1 -0
- package/dist/src/integrations/jira/jira-mapper.d.ts +1 -1
- package/dist/src/integrations/jira/jira-mapper.d.ts.map +1 -1
- package/dist/src/types/cost-tracking.d.ts +1 -1
- package/dist/src/types/cost-tracking.d.ts.map +1 -1
- package/dist/src/utils/cost-reporter.d.ts +2 -2
- package/dist/src/utils/cost-reporter.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/config-generator.d.ts +1 -1
- package/dist/src/utils/docs-preview/config-generator.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/config-generator.js +1 -1
- package/dist/src/utils/docs-preview/docusaurus-setup.d.ts +1 -1
- package/dist/src/utils/docs-preview/docusaurus-setup.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/docusaurus-setup.js +4 -4
- package/dist/src/utils/docs-preview/docusaurus-setup.js.map +1 -1
- package/dist/src/utils/docs-preview/index.d.ts +6 -6
- package/dist/src/utils/docs-preview/index.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/index.js +6 -6
- package/dist/src/utils/docs-preview/index.js.map +1 -1
- package/dist/src/utils/docs-preview/package-installer.d.ts +1 -1
- package/dist/src/utils/docs-preview/package-installer.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/package-installer.js +1 -1
- package/dist/src/utils/docs-preview/package-installer.js.map +1 -1
- package/dist/src/utils/docs-preview/server-manager.d.ts +1 -1
- package/dist/src/utils/docs-preview/server-manager.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/server-manager.js +1 -1
- package/dist/src/utils/docs-preview/server-manager.js.map +1 -1
- package/dist/src/utils/docs-preview/sidebar-builder.d.ts +1 -1
- package/dist/src/utils/docs-preview/sidebar-builder.d.ts.map +1 -1
- package/dist/src/utils/generate-skills-index.d.ts +1 -1
- package/dist/src/utils/generate-skills-index.js +1 -1
- package/dist/src/utils/project-detection.js +1 -1
- package/dist/src/utils/project-detection.js.map +1 -1
- package/package.json +9 -3
- package/plugins/specweave/agents/architect/AGENT.md +605 -0
- package/plugins/specweave/agents/infrastructure/AGENT.md +760 -0
- package/plugins/specweave/agents/pm/AGENT.md +14 -13
- package/plugins/specweave/commands/specweave-check-hooks.md +186 -0
- package/plugins/specweave/commands/specweave-plan.md +151 -0
- package/plugins/specweave/commands/specweave-sync-acs.md +342 -0
- package/plugins/specweave/commands/specweave-validate.md +60 -11
- package/plugins/specweave/hooks/lib/update-status-line.sh +8 -4
- package/plugins/specweave/hooks/post-increment-change.sh +4 -0
- package/plugins/specweave/hooks/post-increment-completion.sh +7 -1
- package/plugins/specweave/hooks/post-increment-planning.sh +4 -0
- package/plugins/specweave/hooks/post-increment-status-change.sh +4 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh +78 -0
- package/plugins/specweave/iac-templates/aws-lambda/README.md.hbs +280 -0
- package/plugins/specweave/iac-templates/aws-lambda/defaults.json +118 -0
- package/plugins/specweave/iac-templates/aws-lambda/environments/dev.defaults.json +46 -0
- package/plugins/specweave/iac-templates/aws-lambda/environments/prod.defaults.json +67 -0
- package/plugins/specweave/iac-templates/aws-lambda/environments/staging.defaults.json +47 -0
- package/plugins/specweave/iac-templates/aws-lambda/main.tf.hbs +241 -0
- package/plugins/specweave/iac-templates/aws-lambda/outputs.tf.hbs +61 -0
- package/plugins/specweave/iac-templates/aws-lambda/provider.tf.hbs +15 -0
- package/plugins/specweave/iac-templates/aws-lambda/variables.tf.hbs +88 -0
- package/plugins/specweave/iac-templates/azure-functions/README.md.hbs +315 -0
- package/plugins/specweave/iac-templates/azure-functions/defaults.json +65 -0
- package/plugins/specweave/iac-templates/azure-functions/environments/dev.defaults.json +30 -0
- package/plugins/specweave/iac-templates/azure-functions/environments/prod.defaults.json +34 -0
- package/plugins/specweave/iac-templates/azure-functions/environments/staging.defaults.json +31 -0
- package/plugins/specweave/iac-templates/azure-functions/iam.tf.hbs +34 -0
- package/plugins/specweave/iac-templates/azure-functions/main.tf.hbs +247 -0
- package/plugins/specweave/iac-templates/azure-functions/outputs.tf.hbs +72 -0
- package/plugins/specweave/iac-templates/azure-functions/provider.tf.hbs +14 -0
- package/plugins/specweave/iac-templates/azure-functions/variables.tf.hbs +64 -0
- package/plugins/specweave/iac-templates/firebase/README.md.hbs +487 -0
- package/plugins/specweave/iac-templates/firebase/defaults.json +55 -0
- package/plugins/specweave/iac-templates/firebase/environments/dev.defaults.json +44 -0
- package/plugins/specweave/iac-templates/firebase/environments/prod.defaults.json +52 -0
- package/plugins/specweave/iac-templates/firebase/environments/staging.defaults.json +43 -0
- package/plugins/specweave/iac-templates/firebase/iam.tf.hbs +75 -0
- package/plugins/specweave/iac-templates/firebase/main.tf.hbs +297 -0
- package/plugins/specweave/iac-templates/firebase/outputs.tf.hbs +67 -0
- package/plugins/specweave/iac-templates/firebase/provider.tf.hbs +26 -0
- package/plugins/specweave/iac-templates/firebase/variables.tf.hbs +68 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/README.md.hbs +330 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/defaults.json +69 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/environments/dev.defaults.json +33 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/environments/prod.defaults.json +40 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/environments/staging.defaults.json +33 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/iam.tf.hbs +54 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/main.tf.hbs +211 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/outputs.tf.hbs +44 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/provider.tf.hbs +14 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/variables.tf.hbs +82 -0
- package/plugins/specweave/iac-templates/supabase/README.md.hbs +534 -0
- package/plugins/specweave/iac-templates/supabase/defaults.json +69 -0
- package/plugins/specweave/iac-templates/supabase/environments/dev.defaults.json +55 -0
- package/plugins/specweave/iac-templates/supabase/environments/prod.defaults.json +75 -0
- package/plugins/specweave/iac-templates/supabase/environments/staging.defaults.json +54 -0
- package/plugins/specweave/iac-templates/supabase/iam.tf.hbs +146 -0
- package/plugins/specweave/iac-templates/supabase/main.tf.hbs +310 -0
- package/plugins/specweave/iac-templates/supabase/outputs.tf.hbs +74 -0
- package/plugins/specweave/iac-templates/supabase/provider.tf.hbs +19 -0
- package/plugins/specweave/iac-templates/supabase/variables.tf.hbs +78 -0
- package/plugins/specweave/knowledge-base/serverless/FRESHNESS.md +69 -0
- package/plugins/specweave/knowledge-base/serverless/learning-paths.json +865 -0
- package/plugins/specweave/knowledge-base/serverless/platforms/aws-lambda.json +41 -0
- package/plugins/specweave/knowledge-base/serverless/platforms/azure-functions.json +41 -0
- package/plugins/specweave/knowledge-base/serverless/platforms/firebase.json +46 -0
- package/plugins/specweave/knowledge-base/serverless/platforms/gcp-cloud-functions.json +41 -0
- package/plugins/specweave/knowledge-base/serverless/platforms/supabase.json +41 -0
- package/plugins/specweave/knowledge-base/serverless/schema.json +155 -0
- package/plugins/specweave/lib/hooks/auto-transition.js +50 -0
- package/plugins/specweave/lib/hooks/auto-transition.ts +84 -0
- package/plugins/specweave/lib/hooks/invoke-translator-skill.js +1 -1
- package/plugins/specweave/lib/hooks/invoke-translator-skill.ts +1 -1
- package/plugins/specweave/lib/hooks/sync-living-docs.js +4 -31
- package/plugins/specweave/lib/hooks/{sync-living-docs.ts → sync-living-docs.ts.DISABLED} +9 -48
- package/plugins/specweave/lib/hooks/translate-file.js +1 -1
- package/plugins/specweave/lib/hooks/translate-file.ts +1 -1
- package/plugins/specweave/lib/hooks/update-ac-status.js +24 -75
- package/plugins/specweave/lib/hooks/update-ac-status.ts +46 -135
- package/plugins/specweave/lib/hooks/update-tasks-md.js +115 -3
- package/plugins/specweave/lib/hooks/update-tasks-md.ts +182 -10
- package/plugins/specweave/lib/utils/validate-dev-setup.sh +133 -0
- package/plugins/specweave/skills/increment-planner/SKILL.md +25 -15
- package/plugins/specweave/skills/serverless-recommender/SKILL.md +368 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/iam.tf.hbs +137 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/main.tf.hbs +216 -0
- package/plugins/specweave-github/lib/IssueStateManager.js +117 -0
- package/plugins/specweave-github/lib/IssueStateManager.ts +231 -0
- package/plugins/specweave-github/lib/user-story-issue-builder.js +7 -0
- package/plugins/specweave-github/lib/user-story-issue-builder.ts +11 -0
- package/plugins/specweave-ui/.mcp.json +0 -10
- package/plugins/specweave-ui/README.md +26 -26
- package/plugins/specweave-ui/skills/browser-automation/SKILL.md +31 -18
- package/src/templates/tasks.md.template +51 -33
- package/dist/locales/de/.gitkeep +0 -0
- package/dist/locales/de/cli.json +0 -108
- package/dist/locales/en/cli.json +0 -287
- package/dist/locales/en/errors.json +0 -7
- package/dist/locales/en/templates.json +0 -6
- package/dist/locales/es/.gitkeep +0 -0
- package/dist/locales/es/cli.json +0 -41
- package/dist/locales/fr/.gitkeep +0 -0
- package/dist/locales/fr/cli.json +0 -108
- package/dist/locales/ja/.gitkeep +0 -0
- package/dist/locales/ja/cli.json +0 -108
- package/dist/locales/ko/.gitkeep +0 -0
- package/dist/locales/ko/cli.json +0 -108
- package/dist/locales/pt/.gitkeep +0 -0
- package/dist/locales/pt/cli.json +0 -108
- package/dist/locales/ru/.gitkeep +0 -0
- package/dist/locales/ru/cli.json +0 -269
- package/dist/locales/zh/.gitkeep +0 -0
- package/dist/locales/zh/cli.json +0 -108
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts +0 -89
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.js +0 -226
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts +0 -60
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.js +0 -201
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts +0 -42
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.js +0 -123
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.d.ts +0 -45
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.js +0 -132
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-parser.d.ts +0 -33
- package/dist/plugins/specweave/lib/hooks/reflection-parser.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-parser.js +0 -419
- package/dist/plugins/specweave/lib/hooks/reflection-parser.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts +0 -56
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.js +0 -239
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-storage.d.ts +0 -64
- package/dist/plugins/specweave/lib/hooks/reflection-storage.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-storage.js +0 -305
- package/dist/plugins/specweave/lib/hooks/reflection-storage.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.d.ts +0 -43
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.js +0 -203
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts +0 -32
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +0 -405
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/translate-file.d.ts +0 -59
- package/dist/plugins/specweave/lib/hooks/translate-file.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/translate-file.js +0 -350
- package/dist/plugins/specweave/lib/hooks/translate-file.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.d.ts +0 -13
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.js +0 -175
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.d.ts +0 -164
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.js +0 -73
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/update-ac-status.d.ts +0 -21
- package/dist/plugins/specweave/lib/hooks/update-ac-status.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/update-ac-status.js +0 -162
- package/dist/plugins/specweave/lib/hooks/update-ac-status.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.d.ts +0 -29
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.js +0 -203
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.js.map +0 -1
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.d.ts +0 -25
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.d.ts.map +0 -1
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -191
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.js.map +0 -1
- package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.d.ts +0 -57
- package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.d.ts.map +0 -1
- package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.js +0 -248
- package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.js.map +0 -1
- package/dist/plugins/specweave-kafka/lib/cli/types.d.ts +0 -82
- package/dist/plugins/specweave-kafka/lib/cli/types.d.ts.map +0 -1
- package/dist/plugins/specweave-kafka/lib/cli/types.js +0 -13
- package/dist/plugins/specweave-kafka/lib/cli/types.js.map +0 -1
- package/dist/plugins/specweave-kafka/lib/mcp/detector.d.ts +0 -49
- package/dist/plugins/specweave-kafka/lib/mcp/detector.d.ts.map +0 -1
- package/dist/plugins/specweave-kafka/lib/mcp/detector.js +0 -316
- package/dist/plugins/specweave-kafka/lib/mcp/detector.js.map +0 -1
- package/dist/plugins/specweave-kafka/lib/mcp/types.d.ts +0 -70
- package/dist/plugins/specweave-kafka/lib/mcp/types.d.ts.map +0 -1
- package/dist/plugins/specweave-kafka/lib/mcp/types.js +0 -23
- package/dist/plugins/specweave-kafka/lib/mcp/types.js.map +0 -1
- package/dist/plugins/specweave-kafka/lib/utils/partitioning.d.ts +0 -85
- package/dist/plugins/specweave-kafka/lib/utils/partitioning.d.ts.map +0 -1
- package/dist/plugins/specweave-kafka/lib/utils/partitioning.js +0 -281
- package/dist/plugins/specweave-kafka/lib/utils/partitioning.js.map +0 -1
- package/dist/plugins/specweave-kafka/lib/utils/sizing.d.ts +0 -75
- package/dist/plugins/specweave-kafka/lib/utils/sizing.d.ts.map +0 -1
- package/dist/plugins/specweave-kafka/lib/utils/sizing.js +0 -238
- package/dist/plugins/specweave-kafka/lib/utils/sizing.js.map +0 -1
- package/dist/spec-parser.js +0 -629
- package/dist/src/core/living-docs/spec-distributor.d.ts +0 -180
- package/dist/src/core/living-docs/spec-distributor.d.ts.map +0 -1
- package/dist/src/core/living-docs/spec-distributor.js +0 -1840
- package/dist/src/core/living-docs/spec-distributor.js.map +0 -1
- package/dist/src/core/sync/spec-content-sync.d.ts +0 -88
- package/dist/src/core/sync/spec-content-sync.d.ts.map +0 -1
- package/dist/src/core/sync/spec-content-sync.js +0 -5
- package/dist/src/core/sync/spec-content-sync.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# {{projectName}} - GCP Cloud Functions Infrastructure
|
|
2
|
+
|
|
3
|
+
🚀 Generated by **SpecWeave Serverless Intelligence**
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This Terraform configuration deploys a serverless application on GCP Cloud Functions Gen2 with the following components:
|
|
8
|
+
|
|
9
|
+
- **Cloud Function Gen2**: `{{functionName}}` ({{#if runtime}}{{runtime}}{{else}}Node.js 20{{/if}})
|
|
10
|
+
- **Service Account**: Least-privilege IAM permissions{{#if databaseName}}
|
|
11
|
+
- **Firestore**: Native NoSQL database with indexing{{/if}}
|
|
12
|
+
- **Cloud Storage**: Source code and logs storage
|
|
13
|
+
- **Cloud Logging**: Centralized logging and monitoring
|
|
14
|
+
|
|
15
|
+
## Architecture
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
{{#if databaseName}}
|
|
19
|
+
Internet → Cloud Function Gen2 → Firestore
|
|
20
|
+
↓
|
|
21
|
+
Cloud Logging
|
|
22
|
+
{{else}}
|
|
23
|
+
Internet → Cloud Function Gen2
|
|
24
|
+
↓
|
|
25
|
+
Cloud Logging
|
|
26
|
+
{{/if}}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Prerequisites
|
|
30
|
+
|
|
31
|
+
1. **GCP Account** with billing enabled
|
|
32
|
+
2. **gcloud CLI** installed and authenticated
|
|
33
|
+
3. **Terraform** >= 1.0 installed
|
|
34
|
+
4. **Function deployment package**: `{{functionName}}.zip` with your code
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
### 1. Authenticate with GCP
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
gcloud auth application-default login
|
|
42
|
+
gcloud config set project YOUR_PROJECT_ID
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 2. Enable Required APIs
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
gcloud services enable cloudfunctions.googleapis.com
|
|
49
|
+
gcloud services enable cloudbuild.googleapis.com
|
|
50
|
+
gcloud services enable cloudscheduler.googleapis.com
|
|
51
|
+
{{#if databaseName}}
|
|
52
|
+
gcloud services enable firestore.googleapis.com
|
|
53
|
+
{{/if}}
|
|
54
|
+
gcloud services enable logging.googleapis.com
|
|
55
|
+
gcloud services enable storage.googleapis.com
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 3. Initialize Terraform
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
terraform init
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 4. Review Plan
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
terraform plan -var="project_id=YOUR_PROJECT_ID"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 5. Deploy
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
terraform apply -var="project_id=YOUR_PROJECT_ID"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 6. Upload Function Code
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Get bucket name
|
|
80
|
+
BUCKET=$(terraform output -raw source_bucket_name)
|
|
81
|
+
|
|
82
|
+
# Upload function code
|
|
83
|
+
gcloud storage cp {{functionName}}.zip gs://$BUCKET/
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 7. Test Deployment
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Get function URL
|
|
90
|
+
FUNCTION_URL=$(terraform output -raw function_url)
|
|
91
|
+
|
|
92
|
+
# Test function
|
|
93
|
+
curl $FUNCTION_URL
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Configuration
|
|
97
|
+
|
|
98
|
+
### Variables
|
|
99
|
+
|
|
100
|
+
Edit `terraform.tfvars` to customize:
|
|
101
|
+
|
|
102
|
+
```hcl
|
|
103
|
+
project_id = "your-gcp-project-id"
|
|
104
|
+
project_name = "{{projectName}}"
|
|
105
|
+
environment = "{{environment}}"
|
|
106
|
+
function_name = "{{functionName}}"
|
|
107
|
+
region = "{{#if region}}{{region}}{{else}}us-central1{{/if}}"
|
|
108
|
+
runtime = "{{#if runtime}}{{runtime}}{{else}}nodejs20{{/if}}"
|
|
109
|
+
memory = "{{#if memory}}{{memory}}{{else}}256M{{/if}}"
|
|
110
|
+
timeout = {{#if timeout}}{{timeout}}{{else}}60{{/if}}
|
|
111
|
+
{{#if databaseName}}
|
|
112
|
+
database_name = "{{databaseName}}"
|
|
113
|
+
firestore_location = "us-central"
|
|
114
|
+
{{/if}}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Environment Variables
|
|
118
|
+
|
|
119
|
+
The Cloud Function has these environment variables:
|
|
120
|
+
|
|
121
|
+
- `ENVIRONMENT`: `{{environment}}`{{#if databaseName}}
|
|
122
|
+
- `FIRESTORE_PROJECT`: GCP project ID
|
|
123
|
+
- `FIRESTORE_DATABASE`: Firestore database name{{/if}}
|
|
124
|
+
|
|
125
|
+
## Outputs
|
|
126
|
+
|
|
127
|
+
After deployment, Terraform provides these outputs:
|
|
128
|
+
|
|
129
|
+
- `function_name`: Cloud Function name
|
|
130
|
+
- `function_url`: HTTPS endpoint
|
|
131
|
+
- `function_service_account_email`: Service account email{{#if databaseName}}
|
|
132
|
+
- `firestore_database_name`: Firestore database name{{/if}}
|
|
133
|
+
|
|
134
|
+
## Resource Details
|
|
135
|
+
|
|
136
|
+
### Cloud Function Gen2
|
|
137
|
+
|
|
138
|
+
- **Runtime**: {{#if runtime}}{{runtime}}{{else}}Node.js 20{{/if}}
|
|
139
|
+
- **Memory**: {{#if memory}}{{memory}}{{else}}256M{{/if}}
|
|
140
|
+
- **Timeout**: {{#if timeout}}{{timeout}}{{else}}60{{/if}} seconds
|
|
141
|
+
- **Entry Point**: {{#if entryPoint}}{{entryPoint}}{{else}}handler{{/if}}
|
|
142
|
+
- **Min Instances**: {{#if (eq environment "prod")}}1 (always warm){{else}}0 (cold starts){{/if}}
|
|
143
|
+
- **Max Instances**: {{#if (eq environment "prod")}}100{{else if (eq environment "staging")}}10{{else}}5{{/if}}
|
|
144
|
+
- **Ingress**: {{#if (eq environment "prod")}}Internal + Load Balancer{{else}}Allow all{{/if}}
|
|
145
|
+
|
|
146
|
+
{{#if databaseName}}
|
|
147
|
+
### Firestore
|
|
148
|
+
|
|
149
|
+
- **Name**: `{{databaseName}}-{{environment}}`
|
|
150
|
+
- **Type**: FIRESTORE_NATIVE
|
|
151
|
+
- **Location**: {{#if firestoreLocation}}{{firestoreLocation}}{{else}}us-central{{/if}}
|
|
152
|
+
- **Concurrency**: {{#if (eq environment "prod")}}Optimistic (higher throughput){{else}}Pessimistic (simpler){{/if}}
|
|
153
|
+
- **Point-in-Time Recovery**: {{#if (eq environment "prod")}}Enabled{{else}}Disabled{{/if}}
|
|
154
|
+
- **Delete Protection**: {{#if (eq environment "prod")}}Enabled{{else}}Disabled{{/if}}
|
|
155
|
+
|
|
156
|
+
**Cost Optimization**: Firestore has a generous free tier (50K reads, 20K writes, 1GB storage per day).
|
|
157
|
+
{{/if}}
|
|
158
|
+
|
|
159
|
+
### Cloud Storage
|
|
160
|
+
|
|
161
|
+
- **Source Bucket**: Stores function deployment packages
|
|
162
|
+
- **Logs Bucket**: Stores function logs
|
|
163
|
+
- **Versioning**: {{#if (eq environment "prod")}}Enabled (3 versions){{else}}Disabled{{/if}}
|
|
164
|
+
- **Lifecycle**: Logs deleted after {{#if (eq environment "prod")}}90{{else}}30{{/if}} days
|
|
165
|
+
|
|
166
|
+
## Security Best Practices
|
|
167
|
+
|
|
168
|
+
✅ **Implemented**:
|
|
169
|
+
- Dedicated service account (least privilege)
|
|
170
|
+
- Uniform bucket-level access
|
|
171
|
+
- HTTPS-only endpoints{{#if (eq environment "prod")}}
|
|
172
|
+
- Internal ingress (+ Load Balancer only)
|
|
173
|
+
- Point-in-time recovery for Firestore
|
|
174
|
+
- Delete protection for Firestore{{/if}}
|
|
175
|
+
|
|
176
|
+
⚠️ **TODO**:
|
|
177
|
+
- Add VPC Connector for private networking
|
|
178
|
+
- Enable Secret Manager for sensitive data
|
|
179
|
+
- Implement Cloud Armor for DDoS protection
|
|
180
|
+
- Add Cloud CDN for global distribution
|
|
181
|
+
- Enable Binary Authorization for container signing
|
|
182
|
+
|
|
183
|
+
## Cost Estimation
|
|
184
|
+
|
|
185
|
+
### Free Tier (Always Free)
|
|
186
|
+
|
|
187
|
+
GCP offers a generous always-free tier:
|
|
188
|
+
- **Cloud Functions**: 2M invocations/month, 400K GB-seconds, 200K GHz-seconds
|
|
189
|
+
- **Firestore**: 50K reads/day, 20K writes/day, 1GB storage, 10GB network egress/month
|
|
190
|
+
- **Cloud Storage**: 5 GB standard storage
|
|
191
|
+
- **Cloud Logging**: 50 GB logs/month
|
|
192
|
+
|
|
193
|
+
### Estimated Monthly Cost (After Free Tier)
|
|
194
|
+
|
|
195
|
+
**Development**:
|
|
196
|
+
- Cloud Functions (10K requests): $0.00 (within free tier)
|
|
197
|
+
- Firestore (minimal usage): $0.00 (within free tier)
|
|
198
|
+
- Cloud Storage: $0.10
|
|
199
|
+
- **Total**: ~$0.10/month
|
|
200
|
+
|
|
201
|
+
**Staging**:
|
|
202
|
+
- Cloud Functions (100K requests): ~$0.50
|
|
203
|
+
- Firestore (moderate usage): ~$1.00
|
|
204
|
+
- Cloud Storage: $0.20
|
|
205
|
+
- **Total**: ~$1.70/month
|
|
206
|
+
|
|
207
|
+
**Production**:
|
|
208
|
+
- Cloud Functions (1M requests + min instances): ~$15.00
|
|
209
|
+
- Firestore (high usage): ~$5.00
|
|
210
|
+
- Cloud Storage: $0.50
|
|
211
|
+
- **Total**: ~$20.50/month
|
|
212
|
+
|
|
213
|
+
💡 **Tip**: Use GCP Cost Management and set up budget alerts.
|
|
214
|
+
|
|
215
|
+
## Monitoring
|
|
216
|
+
|
|
217
|
+
### Cloud Logging Metrics
|
|
218
|
+
|
|
219
|
+
- **Invocation Count**: Total function executions
|
|
220
|
+
- **Execution Time**: P50, P95, P99 latency
|
|
221
|
+
- **Error Rate**: Function errors and exceptions
|
|
222
|
+
- **Instance Count**: Active instances{{#if databaseName}}
|
|
223
|
+
- **Firestore Operations**: Read/write counts{{/if}}
|
|
224
|
+
|
|
225
|
+
### Log Explorer
|
|
226
|
+
|
|
227
|
+
View logs in Cloud Console:
|
|
228
|
+
```
|
|
229
|
+
resource.type="cloud_function"
|
|
230
|
+
resource.labels.function_name="{{functionName}}-{{environment}}"
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Recommended Alerts
|
|
234
|
+
|
|
235
|
+
```hcl
|
|
236
|
+
# Add to your Terraform:
|
|
237
|
+
resource "google_monitoring_alert_policy" "function_errors" {
|
|
238
|
+
display_name = "{{functionName}} - High Error Rate"
|
|
239
|
+
combiner = "OR"
|
|
240
|
+
|
|
241
|
+
conditions {
|
|
242
|
+
display_name = "Error rate > 5%"
|
|
243
|
+
|
|
244
|
+
condition_threshold {
|
|
245
|
+
filter = "resource.type = \"cloud_function\" AND resource.labels.function_name = \"{{functionName}}-{{environment}}\" AND metric.type = \"cloudfunctions.googleapis.com/function/execution_count\" AND metric.labels.status = \"error\""
|
|
246
|
+
duration = "60s"
|
|
247
|
+
comparison = "COMPARISON_GT"
|
|
248
|
+
threshold_value = 5
|
|
249
|
+
aggregations {
|
|
250
|
+
alignment_period = "60s"
|
|
251
|
+
per_series_aligner = "ALIGN_RATE"
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
notification_channels = [google_monitoring_notification_channel.email.id]
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Deployment Workflow
|
|
261
|
+
|
|
262
|
+
### Development
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
terraform workspace new dev
|
|
266
|
+
terraform workspace select dev
|
|
267
|
+
terraform apply -var="environment=dev"
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Staging
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
terraform workspace new staging
|
|
274
|
+
terraform workspace select staging
|
|
275
|
+
terraform apply -var="environment=staging"
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Production
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
terraform workspace new prod
|
|
282
|
+
terraform workspace select prod
|
|
283
|
+
terraform apply -var="environment=prod"
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## Cleanup
|
|
287
|
+
|
|
288
|
+
To destroy all resources:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
terraform destroy
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
⚠️ **Warning**: This will permanently delete all data in Firestore!
|
|
295
|
+
|
|
296
|
+
## Troubleshooting
|
|
297
|
+
|
|
298
|
+
**Function deployment fails?**
|
|
299
|
+
1. Check Cloud Build logs in GCP Console
|
|
300
|
+
2. Verify source code is uploaded to bucket
|
|
301
|
+
3. Review IAM permissions
|
|
302
|
+
|
|
303
|
+
**Permission denied errors?**
|
|
304
|
+
1. Verify service account has required roles
|
|
305
|
+
2. Check project-level IAM bindings
|
|
306
|
+
3. Enable required APIs
|
|
307
|
+
|
|
308
|
+
**Firestore connection issues?**
|
|
309
|
+
1. Verify Firestore database is created
|
|
310
|
+
2. Check service account has `datastore.user` role
|
|
311
|
+
3. Review Firestore security rules
|
|
312
|
+
|
|
313
|
+
## Next Steps
|
|
314
|
+
|
|
315
|
+
1. **Add VPC Integration**: Secure private networking
|
|
316
|
+
2. **Enable Secret Manager**: Manage API keys and secrets
|
|
317
|
+
3. **Implement CI/CD**: Use Cloud Build or GitHub Actions
|
|
318
|
+
4. **Add Monitoring**: Set up alerts and dashboards
|
|
319
|
+
5. **Optimize Costs**: Review Cloud Functions instance settings
|
|
320
|
+
|
|
321
|
+
## Resources
|
|
322
|
+
|
|
323
|
+
- [Cloud Functions Documentation](https://cloud.google.com/functions/docs)
|
|
324
|
+
- [Firestore Documentation](https://cloud.google.com/firestore/docs)
|
|
325
|
+
- [Cloud Logging Documentation](https://cloud.google.com/logging/docs)
|
|
326
|
+
- [Terraform Google Provider](https://registry.terraform.io/providers/hashicorp/google/latest/docs)
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
**Generated by SpecWeave** | [Learn More](https://spec-weave.com)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"platform": "gcp-cloud-functions",
|
|
3
|
+
"region": "us-central1",
|
|
4
|
+
"firestoreLocation": "us-central",
|
|
5
|
+
"runtime": "nodejs20",
|
|
6
|
+
"memory": "256M",
|
|
7
|
+
"timeout": 60,
|
|
8
|
+
"instances": {
|
|
9
|
+
"dev": {
|
|
10
|
+
"min": 0,
|
|
11
|
+
"max": 5
|
|
12
|
+
},
|
|
13
|
+
"staging": {
|
|
14
|
+
"min": 0,
|
|
15
|
+
"max": 10
|
|
16
|
+
},
|
|
17
|
+
"prod": {
|
|
18
|
+
"min": 1,
|
|
19
|
+
"max": 100
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"ingress": {
|
|
23
|
+
"dev": "ALLOW_ALL",
|
|
24
|
+
"staging": "ALLOW_ALL",
|
|
25
|
+
"prod": "ALLOW_INTERNAL_AND_GCLB"
|
|
26
|
+
},
|
|
27
|
+
"storage": {
|
|
28
|
+
"versioning": {
|
|
29
|
+
"dev": false,
|
|
30
|
+
"staging": false,
|
|
31
|
+
"prod": true
|
|
32
|
+
},
|
|
33
|
+
"lifecycleDays": {
|
|
34
|
+
"dev": 30,
|
|
35
|
+
"staging": 30,
|
|
36
|
+
"prod": 90
|
|
37
|
+
},
|
|
38
|
+
"forceDestroy": {
|
|
39
|
+
"dev": true,
|
|
40
|
+
"staging": true,
|
|
41
|
+
"prod": false
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"firestore": {
|
|
45
|
+
"type": "FIRESTORE_NATIVE",
|
|
46
|
+
"concurrencyMode": {
|
|
47
|
+
"dev": "PESSIMISTIC",
|
|
48
|
+
"staging": "OPTIMISTIC",
|
|
49
|
+
"prod": "OPTIMISTIC"
|
|
50
|
+
},
|
|
51
|
+
"pointInTimeRecovery": {
|
|
52
|
+
"dev": false,
|
|
53
|
+
"staging": false,
|
|
54
|
+
"prod": true
|
|
55
|
+
},
|
|
56
|
+
"deleteProtection": {
|
|
57
|
+
"dev": false,
|
|
58
|
+
"staging": false,
|
|
59
|
+
"prod": true
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"iam": {
|
|
63
|
+
"publicInvoker": {
|
|
64
|
+
"dev": true,
|
|
65
|
+
"staging": true,
|
|
66
|
+
"prod": false
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"environment": "dev",
|
|
3
|
+
"region": "us-central1",
|
|
4
|
+
"firestoreLocation": "us-central",
|
|
5
|
+
"memory": "256M",
|
|
6
|
+
"timeout": 60,
|
|
7
|
+
"instances": {
|
|
8
|
+
"min": 0,
|
|
9
|
+
"max": 5
|
|
10
|
+
},
|
|
11
|
+
"ingress": "ALLOW_ALL",
|
|
12
|
+
"publicInvoker": true,
|
|
13
|
+
"storage": {
|
|
14
|
+
"versioning": false,
|
|
15
|
+
"lifecycleDays": 30,
|
|
16
|
+
"forceDestroy": true
|
|
17
|
+
},
|
|
18
|
+
"firestore": {
|
|
19
|
+
"concurrencyMode": "PESSIMISTIC",
|
|
20
|
+
"pointInTimeRecovery": false,
|
|
21
|
+
"deleteProtection": false
|
|
22
|
+
},
|
|
23
|
+
"costOptimization": {
|
|
24
|
+
"description": "Free tier optimized - 0 min instances, cold starts acceptable",
|
|
25
|
+
"estimatedMonthlyCost": "$0-1",
|
|
26
|
+
"freeTierEligible": true,
|
|
27
|
+
"notes": [
|
|
28
|
+
"2M invocations/month free",
|
|
29
|
+
"50K Firestore reads/day free",
|
|
30
|
+
"Cold starts expected (0 min instances)"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"environment": "prod",
|
|
3
|
+
"region": "us-central1",
|
|
4
|
+
"firestoreLocation": "us-central",
|
|
5
|
+
"memory": "512M",
|
|
6
|
+
"timeout": 120,
|
|
7
|
+
"instances": {
|
|
8
|
+
"min": 1,
|
|
9
|
+
"max": 100
|
|
10
|
+
},
|
|
11
|
+
"ingress": "ALLOW_INTERNAL_AND_GCLB",
|
|
12
|
+
"publicInvoker": false,
|
|
13
|
+
"storage": {
|
|
14
|
+
"versioning": true,
|
|
15
|
+
"versionRetention": 3,
|
|
16
|
+
"lifecycleDays": 90,
|
|
17
|
+
"forceDestroy": false
|
|
18
|
+
},
|
|
19
|
+
"firestore": {
|
|
20
|
+
"concurrencyMode": "OPTIMISTIC",
|
|
21
|
+
"pointInTimeRecovery": true,
|
|
22
|
+
"deleteProtection": true
|
|
23
|
+
},
|
|
24
|
+
"security": {
|
|
25
|
+
"vpcConnectorRequired": false,
|
|
26
|
+
"internalIngressOnly": true,
|
|
27
|
+
"serviceAccountMinimalPrivileges": true
|
|
28
|
+
},
|
|
29
|
+
"costOptimization": {
|
|
30
|
+
"description": "Production-ready - Always-on, restricted ingress, PITR enabled",
|
|
31
|
+
"estimatedMonthlyCost": "$20-50",
|
|
32
|
+
"freeTierEligible": false,
|
|
33
|
+
"notes": [
|
|
34
|
+
"1 min instance = always warm (no cold starts)",
|
|
35
|
+
"Point-in-time recovery for Firestore",
|
|
36
|
+
"Restricted ingress for security",
|
|
37
|
+
"Delete protection enabled"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
package/plugins/specweave/iac-templates/gcp-cloud-functions/environments/staging.defaults.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"environment": "staging",
|
|
3
|
+
"region": "us-central1",
|
|
4
|
+
"firestoreLocation": "us-central",
|
|
5
|
+
"memory": "512M",
|
|
6
|
+
"timeout": 120,
|
|
7
|
+
"instances": {
|
|
8
|
+
"min": 0,
|
|
9
|
+
"max": 10
|
|
10
|
+
},
|
|
11
|
+
"ingress": "ALLOW_ALL",
|
|
12
|
+
"publicInvoker": true,
|
|
13
|
+
"storage": {
|
|
14
|
+
"versioning": false,
|
|
15
|
+
"lifecycleDays": 30,
|
|
16
|
+
"forceDestroy": true
|
|
17
|
+
},
|
|
18
|
+
"firestore": {
|
|
19
|
+
"concurrencyMode": "OPTIMISTIC",
|
|
20
|
+
"pointInTimeRecovery": false,
|
|
21
|
+
"deleteProtection": false
|
|
22
|
+
},
|
|
23
|
+
"costOptimization": {
|
|
24
|
+
"description": "Cost-effective for testing - Higher memory, no min instances",
|
|
25
|
+
"estimatedMonthlyCost": "$1-5",
|
|
26
|
+
"freeTierEligible": false,
|
|
27
|
+
"notes": [
|
|
28
|
+
"512M memory for realistic testing",
|
|
29
|
+
"No always-on instances",
|
|
30
|
+
"Optimistic concurrency for performance"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# IAM Roles and Permissions for GCP Cloud Functions
|
|
2
|
+
# Project: {{projectName}}
|
|
3
|
+
|
|
4
|
+
###############################
|
|
5
|
+
# Service Account Permissions
|
|
6
|
+
###############################
|
|
7
|
+
|
|
8
|
+
{{#if databaseName}}
|
|
9
|
+
# Grant Cloud Function service account access to Firestore
|
|
10
|
+
resource "google_project_iam_member" "{{snakeCase functionName}}_firestore" {
|
|
11
|
+
project = var.project_id
|
|
12
|
+
role = "roles/datastore.user"
|
|
13
|
+
member = "serviceAccount:${google_service_account.{{snakeCase functionName}}.email}"
|
|
14
|
+
}
|
|
15
|
+
{{/if}}
|
|
16
|
+
|
|
17
|
+
# Grant Cloud Function service account access to Cloud Logging
|
|
18
|
+
resource "google_project_iam_member" "{{snakeCase functionName}}_logging" {
|
|
19
|
+
project = var.project_id
|
|
20
|
+
role = "roles/logging.logWriter"
|
|
21
|
+
member = "serviceAccount:${google_service_account.{{snakeCase functionName}}.email}"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
# Grant Cloud Function service account access to Cloud Monitoring
|
|
25
|
+
resource "google_project_iam_member" "{{snakeCase functionName}}_monitoring" {
|
|
26
|
+
project = var.project_id
|
|
27
|
+
role = "roles/monitoring.metricWriter"
|
|
28
|
+
member = "serviceAccount:${google_service_account.{{snakeCase functionName}}.email}"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
# Grant service account access to read from source bucket
|
|
32
|
+
resource "google_storage_bucket_iam_member" "{{snakeCase functionName}}_source_reader" {
|
|
33
|
+
bucket = google_storage_bucket.{{snakeCase functionName}}_source.name
|
|
34
|
+
role = "roles/storage.objectViewer"
|
|
35
|
+
member = "serviceAccount:${google_service_account.{{snakeCase functionName}}.email}"
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
###############################
|
|
39
|
+
# Additional IAM Bindings (Optional)
|
|
40
|
+
###############################
|
|
41
|
+
|
|
42
|
+
# For Secret Manager integration (uncomment if needed):
|
|
43
|
+
# resource "google_project_iam_member" "function_secret_accessor" {
|
|
44
|
+
# project = var.project_id
|
|
45
|
+
# role = "roles/secretmanager.secretAccessor"
|
|
46
|
+
# member = "serviceAccount:${google_service_account.{{snakeCase functionName}}.email}"
|
|
47
|
+
# }
|
|
48
|
+
|
|
49
|
+
# For Cloud Storage access (uncomment if needed):
|
|
50
|
+
# resource "google_project_iam_member" "function_storage_admin" {
|
|
51
|
+
# project = var.project_id
|
|
52
|
+
# role = "roles/storage.objectAdmin"
|
|
53
|
+
# member = "serviceAccount:${google_service_account.{{snakeCase functionName}}.email}"
|
|
54
|
+
# }
|