projen-pipelines 0.2.12 → 0.2.14

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.
Files changed (49) hide show
  1. package/.jsii +5703 -1380
  2. package/API.md +5813 -1492
  3. package/README.md +253 -0
  4. package/docs/drift-detection.md +264 -0
  5. package/lib/assign-approver/base.js +1 -1
  6. package/lib/assign-approver/github.js +1 -1
  7. package/lib/awscdk/base.d.ts +21 -0
  8. package/lib/awscdk/base.js +246 -2
  9. package/lib/awscdk/bash.js +1 -1
  10. package/lib/awscdk/github.js +1 -1
  11. package/lib/awscdk/gitlab.js +1 -1
  12. package/lib/drift/base.d.ts +64 -0
  13. package/lib/drift/base.js +18 -0
  14. package/lib/drift/bash.d.ts +15 -0
  15. package/lib/drift/bash.js +170 -0
  16. package/lib/drift/detect-drift.d.ts +54 -0
  17. package/lib/drift/detect-drift.js +259 -0
  18. package/lib/drift/github.d.ts +21 -0
  19. package/lib/drift/github.js +232 -0
  20. package/lib/drift/gitlab.d.ts +20 -0
  21. package/lib/drift/gitlab.js +138 -0
  22. package/lib/drift/index.d.ts +5 -0
  23. package/lib/drift/index.js +22 -0
  24. package/lib/drift/step.d.ts +14 -0
  25. package/lib/drift/step.js +48 -0
  26. package/lib/index.d.ts +2 -0
  27. package/lib/index.js +3 -1
  28. package/lib/steps/artifact-steps.js +2 -2
  29. package/lib/steps/aws-assume-role.step.js +1 -1
  30. package/lib/steps/registries.js +2 -2
  31. package/lib/steps/step.d.ts +6 -1
  32. package/lib/steps/step.js +14 -10
  33. package/lib/versioning/computation.d.ts +63 -0
  34. package/lib/versioning/computation.js +121 -0
  35. package/lib/versioning/config.d.ts +41 -0
  36. package/lib/versioning/config.js +91 -0
  37. package/lib/versioning/index.d.ts +7 -0
  38. package/lib/versioning/index.js +46 -0
  39. package/lib/versioning/outputs.d.ts +87 -0
  40. package/lib/versioning/outputs.js +166 -0
  41. package/lib/versioning/setup.d.ts +30 -0
  42. package/lib/versioning/setup.js +165 -0
  43. package/lib/versioning/strategy.d.ts +21 -0
  44. package/lib/versioning/strategy.js +51 -0
  45. package/lib/versioning/types.d.ts +183 -0
  46. package/lib/versioning/types.js +3 -0
  47. package/lib/versioning/version-info.d.ts +106 -0
  48. package/lib/versioning/version-info.js +269 -0
  49. package/package.json +2 -1
package/README.md CHANGED
@@ -16,6 +16,8 @@ specifically designed to work with the projen project configuration engine.
16
16
  * Allows easy switching between different CI/CD platforms without rewriting pipeline configurations
17
17
  * Handles complex deployment scenarios with less code
18
18
  * Manages AWS infrastructure more efficiently and straightforwardly
19
+ * Automated drift detection for CloudFormation/CDK stacks with scheduled checks and issue creation
20
+ * Automatic versioning with flexible strategies and multiple output targets
19
21
 
20
22
  ### Benefits
21
23
 
@@ -23,6 +25,7 @@ specifically designed to work with the projen project configuration engine.
23
25
  * Ensures consistency across projects by using proven defaults
24
26
  * Simplifies compliance management by integrating it directly into pipeline definitions
25
27
  * Facilitates platform migrations (e.g., from GitHub to GitLab) by abstracting pipeline definitions
28
+ * Provides automatic version tracking and exposure through CloudFormation and SSM Parameter Store
26
29
 
27
30
  ## Beyond AWS CDK: A Vision for Universal CI/CD Pipeline Generation
28
31
 
@@ -151,6 +154,29 @@ const app = new PipelineApp({
151
154
  app.synth();
152
155
  ```
153
156
 
157
+ ### Drift Detection
158
+
159
+ Projen Pipelines includes built-in support for automated drift detection of your CloudFormation/CDK stacks. This feature helps you identify when your deployed infrastructure has diverged from your code definitions.
160
+
161
+ ```typescript
162
+ import { GitHubDriftDetectionWorkflow } from 'projen-pipelines';
163
+
164
+ new GitHubDriftDetectionWorkflow(app, {
165
+ schedule: '0 0 * * *', // Daily at midnight
166
+ createIssues: true, // Automatically create GitHub issues
167
+ stages: [
168
+ {
169
+ name: 'production',
170
+ region: 'us-east-1',
171
+ roleArn: 'arn:aws:iam::123456789012:role/DriftDetectionRole',
172
+ failOnDrift: true,
173
+ },
174
+ ],
175
+ });
176
+ ```
177
+
178
+ See the [drift detection documentation](docs/drift-detection.md) for detailed configuration options and examples.
179
+
154
180
  ### Setting Up Trust Relationships Between Accounts
155
181
 
156
182
  When planning to manage multiple staging environments, you will need to establish trust relationships. This process centralizes deployment control, improving operational efficiency and security by consolidating deployment management through a singular, monitored channel. Here is a simplified diagram for the setup:
@@ -203,6 +229,233 @@ Here's a brief description of each one:
203
229
 
204
230
  Remember that these tasks are created and managed automatically by the `CDKPipeline` class. You can run these tasks using the `npx projen TASK_NAME` command.
205
231
 
232
+ ## Versioning
233
+
234
+ Projen Pipelines includes a comprehensive versioning system that automatically tracks and exposes deployment versions through various AWS services. This feature enables deployment traceability, automated rollback decisions, and comprehensive audit trails.
235
+
236
+ ### Basic Versioning Configuration
237
+
238
+ To enable versioning in your pipeline, add the `versioning` configuration:
239
+
240
+ ```typescript
241
+ import { awscdk } from 'projen';
242
+ import { GithubCDKPipeline, VersioningStrategy, VersioningOutputs } from 'projen-pipelines';
243
+
244
+ const app = new awscdk.AwsCdkTypeScriptApp({
245
+ // ... other config
246
+ });
247
+
248
+ new GithubCDKPipeline(app, {
249
+ // ... other pipeline config
250
+
251
+ versioning: {
252
+ enabled: true,
253
+ strategy: VersioningStrategy.commitCount(),
254
+ outputs: VersioningOutputs.standard()
255
+ }
256
+ });
257
+ ```
258
+
259
+ ### Versioning Strategies
260
+
261
+ Projen Pipelines provides several built-in versioning strategies:
262
+
263
+ #### Git Tag Strategy
264
+ Uses git tags as the version source, with optional prefix stripping:
265
+
266
+ ```typescript
267
+ // Basic git tag strategy
268
+ const strategy = VersioningStrategy.gitTag();
269
+
270
+ // With custom configuration
271
+ const strategy = VersioningStrategy.gitTag({
272
+ stripPrefix: 'v', // Strip 'v' from tags (v1.2.3 → 1.2.3)
273
+ annotatedOnly: true, // Only use annotated tags
274
+ includeSinceTag: true // Include commits since tag
275
+ });
276
+ ```
277
+
278
+ #### Package.json Strategy
279
+ Uses the version from your package.json file:
280
+
281
+ ```typescript
282
+ // Basic package.json strategy
283
+ const strategy = VersioningStrategy.packageJson();
284
+
285
+ // With custom configuration
286
+ const strategy = VersioningStrategy.packageJson({
287
+ path: './package.json',
288
+ includePrerelease: true,
289
+ appendCommitInfo: true
290
+ });
291
+ ```
292
+
293
+ #### Commit Count Strategy
294
+ Uses the number of commits as the version:
295
+
296
+ ```typescript
297
+ // Basic commit count strategy
298
+ const strategy = VersioningStrategy.commitCount();
299
+
300
+ // With custom configuration
301
+ const strategy = VersioningStrategy.commitCount({
302
+ countFrom: 'all', // 'all' | 'since-tag'
303
+ includeBranch: true, // Include branch name
304
+ padding: 5 // Zero-pad count (00001)
305
+ });
306
+ ```
307
+
308
+ #### Build Number Strategy
309
+ Creates a version from build metadata:
310
+
311
+ ```typescript
312
+ // Basic build number strategy
313
+ const strategy = VersioningStrategy.buildNumber();
314
+
315
+ // With custom configuration
316
+ const strategy = VersioningStrategy.buildNumber({
317
+ prefix: 'release',
318
+ commitCount: { countFrom: 'all', padding: 5 }
319
+ });
320
+ // Output: release-01234-3a4b5c6d
321
+ ```
322
+
323
+ #### Custom Composite Strategy
324
+ Create your own version format using template variables:
325
+
326
+ ```typescript
327
+ const strategy = VersioningStrategy.create(
328
+ '{git-tag}+{commit-count}-{commit-hash:8}',
329
+ {
330
+ gitTag: { stripPrefix: 'v' },
331
+ commitCount: { countFrom: 'since-tag' }
332
+ }
333
+ );
334
+ // Output: 1.2.3+45-3a4b5c6d
335
+ ```
336
+
337
+ ### Version Output Configurations
338
+
339
+ Control how and where version information is exposed:
340
+
341
+ #### CloudFormation Outputs
342
+ Export version information as CloudFormation stack outputs:
343
+
344
+ ```typescript
345
+ // Basic CloudFormation output
346
+ const outputs = VersioningOutputs.cloudFormationOnly();
347
+
348
+ // With custom configuration
349
+ const outputs = VersioningOutputs.cloudFormationOnly({
350
+ exportName: 'MyApp-{stage}-Version'
351
+ });
352
+ ```
353
+
354
+ #### SSM Parameter Store
355
+ Store version information in AWS Systems Manager Parameter Store:
356
+
357
+ ```typescript
358
+ // Basic parameter store
359
+ const outputs = VersioningOutputs.parameterStoreOnly('/myapp/{stage}/version');
360
+
361
+ // Hierarchical parameters
362
+ const outputs = VersioningOutputs.hierarchicalParameters('/myapp/{stage}/version', {
363
+ includeCloudFormation: true
364
+ });
365
+ ```
366
+
367
+ This creates parameters like:
368
+ - `/myapp/prod/version` → Full version JSON
369
+ - `/myapp/prod/version/commit` → Commit hash
370
+ - `/myapp/prod/version/tag` → Git tag
371
+ - `/myapp/prod/version/count` → Commit count
372
+
373
+ #### Standard Configuration
374
+ The recommended configuration that uses CloudFormation outputs with optional Parameter Store:
375
+
376
+ ```typescript
377
+ const outputs = VersioningOutputs.standard({
378
+ parameterName: '/myapp/{stage}/version',
379
+ });
380
+ ```
381
+
382
+ ### Output Formats
383
+
384
+ Version information can be output in two formats:
385
+
386
+ **Plain Format:** Simple string values in CloudFormation
387
+ ```yaml
388
+ Outputs:
389
+ AppVersion:
390
+ Value: "1.2.3+45-3a4b5c6d"
391
+ Description: "Application version"
392
+ AppCommitHash:
393
+ Value: "3a4b5c6def1234567890"
394
+ Description: "Git commit hash"
395
+ ```
396
+
397
+ **Structured Format:** JSON object with comprehensive metadata in SSM
398
+ ```json
399
+ {
400
+ "version": "1.2.3",
401
+ "commitHash": "3a4b5c6def1234567890",
402
+ "commitCount": 1234,
403
+ "commitsSinceTag": 45,
404
+ "branch": "main",
405
+ "tag": "v1.2.3",
406
+ "deployedAt": "2024-01-15T10:30:00Z",
407
+ "deployedBy": "github-actions",
408
+ "buildNumber": "456",
409
+ "environment": "production"
410
+ }
411
+ ```
412
+
413
+ ### Stage-Specific Overrides
414
+
415
+ Configure different versioning strategies for different stages:
416
+
417
+ ```typescript
418
+ new GithubCDKPipeline(app, {
419
+ versioning: {
420
+ enabled: true,
421
+ strategy: VersioningStrategy.gitTag(),
422
+ outputs: VersioningOutputs.standard(),
423
+ stageOverrides: {
424
+ dev: {
425
+ strategy: VersioningStrategy.commitCount(),
426
+ outputs: VersioningOutputs.minimal()
427
+ },
428
+ prod: {
429
+ validation: {
430
+ requireTag: true,
431
+ tagPattern: /^v\d+\.\d+\.\d+$/
432
+ }
433
+ }
434
+ }
435
+ }
436
+ });
437
+ ```
438
+
439
+ ### Template Variables
440
+
441
+ All strategies support these template variables:
442
+ - `{git-tag}` - Git tag (with optional prefix stripping)
443
+ - `{package-version}` - Version from package.json
444
+ - `{commit-count}` - Number of commits
445
+ - `{commit-hash}` - Full commit hash
446
+ - `{commit-hash:8}` - Short commit hash (8 characters)
447
+ - `{branch}` - Git branch name
448
+ - `{build-number}` - CI/CD build number
449
+
450
+ ### Benefits of Versioning
451
+
452
+ 1. **Deployment Traceability**: Always know exactly which code version is deployed
453
+ 2. **Automated Rollback**: Use version information for automated rollback decisions
454
+ 3. **Audit Trail**: Comprehensive deployment history with metadata
455
+ 4. **Multi-Stage Support**: Different versioning strategies per environment
456
+ 5. **Zero Configuration**: Works out-of-the-box with sensible defaults
457
+ 6. **CI/CD Integration**: Automatically detects version info from CI/CD environments
458
+
206
459
  ### Feature Branch Deployments
207
460
 
208
461
  Projen Pipelines supports automated feature branch deployments for GitHub Actions. This allows you to deploy and test your changes in isolated environments before merging to the main branch. Gitlab support is currently missing.
@@ -0,0 +1,264 @@
1
+ # Drift Detection for CloudFormation/CDK Stacks
2
+
3
+ The drift detection feature allows you to automatically check for configuration drift in your CloudFormation and CDK stacks. It supports both scheduled checks and integration into existing CI/CD pipelines.
4
+
5
+ ## Features
6
+
7
+ - **Automated Drift Detection**: Schedule regular drift checks for your stacks
8
+ - **Multi-Platform Support**: Works with GitHub Actions, GitLab CI/CD, and Bash scripts
9
+ - **External Script**: Drift detection logic in a separate TypeScript script for better maintainability
10
+ - **Custom Error Handling**: Define special cases for known drift issues
11
+ - **Flexible Configuration**: Check specific stacks or all stacks in a region
12
+ - **Issue Creation**: Automatically create GitHub issues when drift is detected
13
+ - **Pipeline Integration**: Add drift checks as steps in your deployment pipeline
14
+
15
+ ## Architecture
16
+
17
+ The drift detection feature is organized into separate components:
18
+
19
+ - **`detect-drift.ts`**: Standalone TypeScript script that performs the actual drift detection
20
+ - **Platform-specific workflows**: GitHub, GitLab, and Bash implementations
21
+ - **`DriftDetectionStep`**: Integration for existing pipelines
22
+
23
+ ## Usage
24
+
25
+ ### GitHub Actions Scheduled Workflow
26
+
27
+ Create a scheduled GitHub Actions workflow:
28
+
29
+ ```typescript
30
+ import { GitHubDriftDetectionWorkflow } from 'projen-pipelines';
31
+
32
+ new GitHubDriftDetectionWorkflow(project, {
33
+ name: 'drift-detection',
34
+ schedule: '0 0 * * *', // Daily at midnight
35
+ stages: [
36
+ {
37
+ name: 'production',
38
+ region: 'us-east-1',
39
+ roleArn: 'arn:aws:iam::123456789012:role/DriftDetectionRole',
40
+ stackNames: ['MyApp-Production-Stack'],
41
+ failOnDrift: true,
42
+ errorHandlers: {
43
+ 'Lambda.*': {
44
+ pattern: 'Lambda.*',
45
+ action: 'ignore',
46
+ message: 'Ignoring Lambda runtime updates',
47
+ },
48
+ },
49
+ },
50
+ {
51
+ name: 'staging',
52
+ region: 'us-east-1',
53
+ roleArn: 'arn:aws:iam::123456789012:role/DriftDetectionRole',
54
+ failOnDrift: false, // Just report, don't fail
55
+ },
56
+ ],
57
+ createIssues: true, // Create GitHub issues on drift
58
+ });
59
+ ```
60
+
61
+ ### GitLab CI Scheduled Pipeline
62
+
63
+ Create a scheduled GitLab CI pipeline:
64
+
65
+ ```typescript
66
+ import { GitLabDriftDetectionWorkflow } from 'projen-pipelines';
67
+
68
+ new GitLabDriftDetectionWorkflow(project, {
69
+ name: 'drift-detection',
70
+ schedule: '0 */6 * * *', // Every 6 hours
71
+ runnerTags: ['docker', 'aws'],
72
+ image: 'node:18-alpine',
73
+ stages: [
74
+ {
75
+ name: 'production',
76
+ region: 'us-east-1',
77
+ roleArn: 'arn:aws:iam::123456789012:role/DriftDetectionRole',
78
+ stackNames: ['MyApp-Production-Stack'],
79
+ failOnDrift: true,
80
+ },
81
+ ],
82
+ });
83
+ ```
84
+
85
+ ### Bash Script for Manual Runs
86
+
87
+ Generate a bash script for manual drift detection:
88
+
89
+ ```typescript
90
+ import { BashDriftDetectionWorkflow } from 'projen-pipelines';
91
+
92
+ new BashDriftDetectionWorkflow(project, {
93
+ scriptPath: 'scripts/check-drift.sh',
94
+ stages: [
95
+ {
96
+ name: 'production',
97
+ region: 'us-east-1',
98
+ roleArn: 'arn:aws:iam::123456789012:role/DriftDetectionRole',
99
+ stackNames: ['MyApp-Production-Stack'],
100
+ },
101
+ ],
102
+ });
103
+
104
+ // Run manually:
105
+ // ./scripts/check-drift.sh
106
+ // ./scripts/check-drift.sh --stage production
107
+ ```
108
+
109
+ ### Pipeline Integration
110
+
111
+ Add drift detection as a step in your CI/CD pipeline:
112
+
113
+ ```typescript
114
+ import { DriftDetectionStep } from 'projen-pipelines';
115
+
116
+ const driftCheck = new DriftDetectionStep(project, {
117
+ name: 'CheckDrift',
118
+ region: 'us-east-1',
119
+ roleArn: 'arn:aws:iam::123456789012:role/DriftDetectionRole',
120
+ stackNames: ['MyStack'],
121
+ failOnDrift: true,
122
+ timeout: 30, // 30 minutes
123
+ });
124
+
125
+ // Use in your pipeline
126
+ ```
127
+
128
+ ## Configuration Options
129
+
130
+ ### Common Options
131
+
132
+ All workflow types support these stage options:
133
+
134
+ | Option | Type | Description | Default |
135
+ |--------|------|-------------|---------|
136
+ | `name` | `string` | Stage name | Required |
137
+ | `region` | `string` | AWS region | Required |
138
+ | `roleArn` | `string` | IAM role for drift detection | - |
139
+ | `stackNames` | `string[]` | Specific stacks to check | All stacks |
140
+ | `failOnDrift` | `boolean` | Fail if drift detected | `true` |
141
+ | `errorHandlers` | `Record<string, DriftErrorHandler>` | Custom error handlers | - |
142
+ | `environment` | `Record<string, string>` | Environment variables | - |
143
+
144
+ ### GitHubDriftDetectionWorkflow Options
145
+
146
+ | Option | Type | Description | Default |
147
+ |--------|------|-------------|---------|
148
+ | `name` | `string` | Workflow name | `drift-detection` |
149
+ | `schedule` | `string` | Cron schedule | `0 0 * * *` |
150
+ | `permissions` | `Record<string, string>` | GitHub permissions | - |
151
+ | `createIssues` | `boolean` | Create issues on drift | `true` |
152
+
153
+ ### GitLabDriftDetectionWorkflow Options
154
+
155
+ | Option | Type | Description | Default |
156
+ |--------|------|-------------|---------|
157
+ | `name` | `string` | Pipeline name | `drift-detection` |
158
+ | `schedule` | `string` | Cron schedule | `0 0 * * *` |
159
+ | `runnerTags` | `string[]` | GitLab runner tags | `[]` |
160
+ | `image` | `string` | Docker image | `node:18` |
161
+
162
+ ### BashDriftDetectionWorkflow Options
163
+
164
+ | Option | Type | Description | Default |
165
+ |--------|------|-------------|---------|
166
+ | `name` | `string` | Script name | `drift-detection` |
167
+ | `scriptPath` | `string` | Output script path | `drift-detection.sh` |
168
+
169
+ ## Error Handling
170
+
171
+ Define custom error handlers with different actions:
172
+
173
+ ```typescript
174
+ errorHandlers: {
175
+ 'Lambda.*': {
176
+ pattern: 'Lambda.*',
177
+ action: 'ignore', // ignore | warn | fail
178
+ message: 'Lambda runtime drift is expected',
179
+ },
180
+ 'DynamoDB-.*': {
181
+ pattern: 'DynamoDB-.*',
182
+ action: 'warn',
183
+ message: 'DynamoDB drift detected but continuing',
184
+ },
185
+ }
186
+ ```
187
+
188
+ Actions:
189
+ - `ignore`: Skip checking this stack entirely
190
+ - `warn`: Check the stack but don't fail on drift
191
+ - `fail`: Normal behavior (fail on drift)
192
+
193
+ ## IAM Permissions
194
+
195
+ The drift detection role needs the following permissions:
196
+
197
+ ```json
198
+ {
199
+ "Version": "2012-10-17",
200
+ "Statement": [
201
+ {
202
+ "Effect": "Allow",
203
+ "Action": [
204
+ "cloudformation:DetectStackDrift",
205
+ "cloudformation:DescribeStackDriftDetectionStatus",
206
+ "cloudformation:DescribeStackResourceDrifts",
207
+ "cloudformation:ListStackResources",
208
+ "cloudformation:ListStacks"
209
+ ],
210
+ "Resource": "*"
211
+ }
212
+ ]
213
+ }
214
+ ```
215
+
216
+ ## GitHub Actions Integration
217
+
218
+ When drift is detected in a scheduled run, the workflow automatically creates a GitHub issue with:
219
+ - Drift detection summary
220
+ - Link to the workflow run
221
+ - Labels for tracking (`drift-detection`, stage name)
222
+
223
+ ## GitLab CI Integration
224
+
225
+ For GitLab, create a scheduled pipeline with the `DRIFT_DETECTION=true` variable:
226
+ 1. Go to CI/CD > Schedules
227
+ 2. Create a new schedule
228
+ 3. Add variable: `DRIFT_DETECTION=true`
229
+ 4. Set your desired cron schedule
230
+
231
+ ## Output
232
+
233
+ The drift detection provides detailed output including:
234
+ - Stack drift status (IN_SYNC, DRIFTED, etc.)
235
+ - List of drifted resources
236
+ - Resource drift details showing property differences
237
+ - Summary of all checked stacks
238
+
239
+ Example output:
240
+ ```
241
+ Checking drift for stack: MyApp-Production-Stack
242
+ Started drift detection with ID: 12345678-1234-1234-1234-123456789012
243
+ Drift detection status: DETECTION_COMPLETE (120s elapsed)
244
+ Stack drift status: DRIFTED
245
+
246
+ DRIFT DETECTED in stack MyApp-Production-Stack!
247
+ LogicalResourceId ResourceType DriftStatus
248
+ MyFunction AWS::Lambda::Function MODIFIED
249
+ MyTable AWS::DynamoDB::Table MODIFIED
250
+
251
+ Drift details for resource: MyFunction
252
+ [
253
+ {
254
+ "PropertyDifferences": [
255
+ {
256
+ "PropertyPath": "/Runtime",
257
+ "ExpectedValue": "nodejs16.x",
258
+ "ActualValue": "nodejs18.x",
259
+ "DifferenceType": "NOT_EQUAL"
260
+ }
261
+ ]
262
+ }
263
+ ]
264
+ ```
@@ -12,5 +12,5 @@ class AssignApprover extends projen_1.Component {
12
12
  }
13
13
  exports.AssignApprover = AssignApprover;
14
14
  _a = JSII_RTTI_SYMBOL_1;
15
- AssignApprover[_a] = { fqn: "projen-pipelines.AssignApprover", version: "0.2.12" };
15
+ AssignApprover[_a] = { fqn: "projen-pipelines.AssignApprover", version: "0.2.14" };
16
16
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb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ykge1xuICAgIHN1cGVyKHNjb3BlKTtcbiAgfVxuXG59Il19
@@ -81,5 +81,5 @@ if (filteredApprovers.length > 0) {
81
81
  }
82
82
  exports.GitHubAssignApprover = GitHubAssignApprover;
83
83
  _a = JSII_RTTI_SYMBOL_1;
84
- GitHubAssignApprover[_a] = { fqn: "projen-pipelines.GitHubAssignApprover", version: "0.2.12" };
84
+ GitHubAssignApprover[_a] = { fqn: "projen-pipelines.GitHubAssignApprover", version: "0.2.14" };
85
85
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2l0aHViLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2Fzc2lnbi1hcHByb3Zlci9naXRodWIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFDQSx1RUFBa0Y7QUFDbEYsaUNBQStEO0FBYS9ELE1BQWEsb0JBQXFCLFNBQVEscUJBQWM7SUFJdEQsWUFBWSxLQUFvQixFQUFFLE9BQW9DO1FBQ3BFLEtBQUssQ0FBQyxLQUFLLEVBQUUsT0FBTyxDQUFDLENBQUM7UUFDdEIsSUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUM7UUFFdkIsZ0RBQWdEO1FBQ2hELElBQUksQ0FBQyxRQUFRLEdBQUcsS0FBSyxDQUFDLE1BQU8sQ0FBQyxXQUFXLENBQUMsaUJBQWlCLENBQUMsQ0FBQztRQUM3RCxJQUFJLENBQUMsUUFBUSxDQUFDLEVBQUUsQ0FBQztZQUNmLGlCQUFpQixFQUFFO2dCQUNqQixLQUFLLEVBQUUsQ0FBQyxRQUFRLEVBQUUsa0JBQWtCLENBQUM7YUFDdEM7U0FDRixDQUFDLENBQUM7UUFFSCxJQUFJLENBQUMsYUFBYSxFQUFFLENBQUM7SUFDdkIsQ0FBQztJQUVEOztPQUVHO0lBQ0ksaUJBQWlCO1FBQ3RCLE9BQU87WUFDTCxZQUFZLE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UgcmV2aWV3ZXJzIGZvdW5kIGZvciB0aGlzIFBSIGF1dGhvcicpO1xufWA7XG4gIH1cbn1cbiJdfQ==
@@ -1,6 +1,7 @@
1
1
  import { Component, awscdk } from 'projen';
2
2
  import { PipelineEngine } from '../engine';
3
3
  import { PipelineStep } from '../steps';
4
+ import { VersioningConfig } from '../versioning';
4
5
  /**
5
6
  * The Environment interface is designed to hold AWS related information
6
7
  * for a specific deployment environment within your infrastructure.
@@ -138,6 +139,10 @@ export interface CDKPipelineOptions {
138
139
  readonly preInstallSteps?: PipelineStep[];
139
140
  readonly preSynthSteps?: PipelineStep[];
140
141
  readonly postSynthSteps?: PipelineStep[];
142
+ /**
143
+ * Versioning configuration
144
+ */
145
+ readonly versioning?: VersioningConfig;
141
146
  }
142
147
  /**
143
148
  * The CDKPipeline class extends the Component class and sets up the necessary configuration for deploying AWS CDK (Cloud Development Kit) applications across multiple stages.
@@ -189,4 +194,20 @@ export declare abstract class CDKPipeline extends Component {
189
194
  */
190
195
  protected createIndependentStage(stage: IndependentStage): void;
191
196
  protected getCliStackPattern(stage: string): string;
197
+ /**
198
+ * Create version:fetch:<stage> task to fetch version data from deployed stack
199
+ */
200
+ protected createVersionFetchTask(stage: NamedStageOptions): void;
201
+ /**
202
+ * Generate CDK application code for versioning
203
+ */
204
+ generateVersioningAppCode(config: VersioningConfig): string;
205
+ /**
206
+ * Generate versioning imports for CDK application
207
+ */
208
+ generateVersioningImports(): string;
209
+ /**
210
+ * Generate versioning utility functions for CDK application
211
+ */
212
+ generateVersioningUtilities(): string;
192
213
  }