@aws-mdaa/devops 1.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/SCHEMA.md +981 -0
- package/bin/devops.d.ts +6 -0
- package/bin/devops.js +10 -0
- package/cdk.json +7 -0
- package/lib/config-schema.json +431 -0
- package/lib/devops.d.ts +210 -0
- package/lib/devops.js +392 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +24 -0
- package/mdaa.config.json +3 -0
- package/package.json +57 -0
package/lib/devops.d.ts
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { MdaaAppConfigParser, MdaaAppConfigParserProps, MdaaBaseConfigContents, MdaaCdkApp } from '@aws-mdaa/app';
|
|
6
|
+
import { MdaaL3Construct, MdaaL3ConstructProps } from '@aws-mdaa/l3-construct';
|
|
7
|
+
import { IMdaaResourceNaming } from '@aws-mdaa/naming';
|
|
8
|
+
import { AppProps, Stack } from 'aws-cdk-lib';
|
|
9
|
+
import { IRepository } from 'aws-cdk-lib/aws-codecommit';
|
|
10
|
+
import { Pipeline, PipelineProps } from 'aws-cdk-lib/aws-codepipeline';
|
|
11
|
+
import { IRole } from 'aws-cdk-lib/aws-iam';
|
|
12
|
+
import { IKey } from 'aws-cdk-lib/aws-kms';
|
|
13
|
+
import { Construct } from 'constructs';
|
|
14
|
+
/**
|
|
15
|
+
* Q-ENHANCED-INTERFACE
|
|
16
|
+
* Validation stage command configuration interface for CodeBuild validation projects that execute infrastructure testing and compliance verification during MDAA deployment pipelines. Defines install dependencies and validation commands that run in CodeBuild environments to verify deployed infrastructure meets requirements before pipeline progression.
|
|
17
|
+
*
|
|
18
|
+
* Use cases: Infrastructure smoke testing; Compliance verification; Deployment validation; Quality gate enforcement; Post-deployment verification
|
|
19
|
+
*
|
|
20
|
+
* AWS: AWS CodeBuild validation project commands with install dependencies and validation script execution for pipeline quality gates
|
|
21
|
+
*
|
|
22
|
+
* Validation: install commands must be valid package manager commands; commands must be executable shell scripts that return appropriate exit codes for pipeline success/failure
|
|
23
|
+
*/
|
|
24
|
+
export interface ValidateStageCommands {
|
|
25
|
+
/**
|
|
26
|
+
* Q-ENHANCED-PROPERTY
|
|
27
|
+
* Optional array of package installation commands for CodeBuild validation environment setup enabling testing tool installation and dependency management. Defines commands that will be executed during the install phase to install required testing frameworks, validation tools, and dependencies needed for infrastructure validation operations.
|
|
28
|
+
*
|
|
29
|
+
* Use cases: Testing tool installation; Validation dependency setup; Testing framework installation; Environment preparation; Validation tool setup
|
|
30
|
+
*
|
|
31
|
+
* AWS: AWS CodeBuild validation install phase commands for testing tool installation and validation environment setup
|
|
32
|
+
*
|
|
33
|
+
* Validation: Must be array of valid shell commands if provided; commands execute in CodeBuild Linux environment; optional for validation install phase
|
|
34
|
+
**/
|
|
35
|
+
readonly install?: string[];
|
|
36
|
+
/**
|
|
37
|
+
* Q-ENHANCED-PROPERTY
|
|
38
|
+
* Optional array of validation commands for infrastructure testing and compliance verification enabling quality gate enforcement. Defines commands that will be executed to validate deployed infrastructure, perform smoke tests, and verify compliance requirements before pipeline progression.
|
|
39
|
+
*
|
|
40
|
+
* Use cases: Infrastructure smoke testing; Compliance verification; Quality gate enforcement; Post-deployment validation; Infrastructure testing
|
|
41
|
+
*
|
|
42
|
+
* AWS: AWS CodeBuild validation commands for infrastructure testing and compliance verification with quality gate enforcement
|
|
43
|
+
*
|
|
44
|
+
* Validation: Must be array of valid shell commands if provided; commands must return appropriate exit codes for pipeline success/failure; optional for validation execution
|
|
45
|
+
**/
|
|
46
|
+
readonly commands?: string[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Q-ENHANCED-INTERFACE
|
|
50
|
+
* Deployment stage command configuration interface for CodeBuild projects that execute custom scripts during MDAA deployment pipeline stages. Defines install dependencies, pre-deployment preparation commands, and post-deployment cleanup commands that run in CodeBuild environments to customize deployment behavior and perform environment-specific operations.
|
|
51
|
+
*
|
|
52
|
+
* Use cases: Environment preparation; Custom deployment scripts; Post-deployment cleanup; Infrastructure customization; Environment-specific configuration
|
|
53
|
+
*
|
|
54
|
+
* AWS: AWS CodeBuild project commands with install, pre-execution, and post-execution hooks for deployment stage customization
|
|
55
|
+
*
|
|
56
|
+
* Validation: install commands must be valid package manager commands; pre/post commands must be executable shell scripts; commands execute in CodeBuild Linux environment
|
|
57
|
+
*/
|
|
58
|
+
export interface StageCommands {
|
|
59
|
+
/**
|
|
60
|
+
* Q-ENHANCED-PROPERTY
|
|
61
|
+
* Optional array of package installation commands for CodeBuild environment setup enabling dependency management and tool installation. Defines commands that will be executed during the install phase to install required packages, dependencies, and tools needed for deployment operations.
|
|
62
|
+
*
|
|
63
|
+
* Use cases: Dependency installation; Tool setup; Package management; Environment preparation; Build tool installation
|
|
64
|
+
*
|
|
65
|
+
* AWS: AWS CodeBuild install phase commands for dependency installation and environment setup
|
|
66
|
+
*
|
|
67
|
+
* Validation: Must be array of valid shell commands if provided; commands execute in CodeBuild Linux environment; optional for install phase
|
|
68
|
+
**/
|
|
69
|
+
readonly install?: string[];
|
|
70
|
+
/**
|
|
71
|
+
* Q-ENHANCED-PROPERTY
|
|
72
|
+
* Optional array of pre-execution commands for deployment stage preparation enabling custom setup and validation before main deployment operations. Defines commands that will be executed before the main deployment stage to perform environment preparation, validation, and custom setup tasks.
|
|
73
|
+
*
|
|
74
|
+
* Use cases: Environment preparation; Pre-deployment validation; Custom setup; Configuration verification; Prerequisite checks
|
|
75
|
+
*
|
|
76
|
+
* AWS: AWS CodeBuild pre-execution commands for deployment stage preparation and validation
|
|
77
|
+
*
|
|
78
|
+
* Validation: Must be array of valid shell commands if provided; commands execute in CodeBuild Linux environment; optional for pre-execution phase
|
|
79
|
+
**/
|
|
80
|
+
readonly pre?: string[];
|
|
81
|
+
/**
|
|
82
|
+
* Q-ENHANCED-PROPERTY
|
|
83
|
+
* Optional array of post-execution commands for deployment stage cleanup and finalization enabling custom cleanup and post-deployment operations. Defines commands that will be executed after the main deployment stage to perform cleanup, notification, validation, and finalization tasks.
|
|
84
|
+
*
|
|
85
|
+
* Use cases: Post-deployment cleanup; Notification sending; Validation checks; Resource cleanup; Finalization tasks
|
|
86
|
+
*
|
|
87
|
+
* AWS: AWS CodeBuild post-execution commands for deployment stage cleanup and finalization
|
|
88
|
+
*
|
|
89
|
+
* Validation: Must be array of valid shell commands if provided; commands execute in CodeBuild Linux environment; optional for post-execution phase
|
|
90
|
+
**/
|
|
91
|
+
readonly post?: string[];
|
|
92
|
+
}
|
|
93
|
+
export interface Commands extends StageCommands {
|
|
94
|
+
readonly preDeploy?: StageCommands;
|
|
95
|
+
readonly preDeployValidate?: ValidateStageCommands;
|
|
96
|
+
readonly deploy?: StageCommands;
|
|
97
|
+
readonly postDeployValidate?: ValidateStageCommands;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Q-ENHANCED-INTERFACE
|
|
101
|
+
* MDAA DevOps configuration interface for CI/CD pipeline orchestration with CodeCommit repository integration and multi-environment deployment management. Defines the complete DevOps infrastructure including source repositories, deployment pipelines, and CDK bootstrap configuration for automated MDAA infrastructure deployment across multiple environments with approval gates and validation stages.
|
|
102
|
+
*
|
|
103
|
+
* Use cases: Multi-environment CI/CD pipelines; Automated MDAA deployments; Configuration repository management; Infrastructure change management; DevOps automation
|
|
104
|
+
*
|
|
105
|
+
* AWS: AWS CodePipeline with CodeCommit source repositories, CodeBuild projects for MDAA CLI execution, and CDK bootstrap integration for infrastructure deployment
|
|
106
|
+
*
|
|
107
|
+
* Validation: mdaaCodeCommitRepo and configsCodeCommitRepo must be valid CodeCommit repository names; pipelines must contain valid PipelineConfig objects; cdkBootstrapContext must be valid CDK qualifier
|
|
108
|
+
*/
|
|
109
|
+
export interface DevOpsConfigContents extends MdaaBaseConfigContents, Commands {
|
|
110
|
+
readonly mdaaCodeCommitRepo: string;
|
|
111
|
+
readonly mdaaBranch?: string;
|
|
112
|
+
readonly configsCodeCommitRepo: string;
|
|
113
|
+
readonly configsBranch?: string;
|
|
114
|
+
readonly pipelines?: {
|
|
115
|
+
[pipelineName: string]: PipelineConfig;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Q-ENHANCED-PROPERTY
|
|
119
|
+
* CDK bootstrap context qualifier for identifying CDK bootstrap resources in the target environment. Defines the CDK bootstrap qualifier used to locate CDK deployment roles, buckets, and other bootstrap resources for MDAA infrastructure deployment through CI/CD pipelines.
|
|
120
|
+
*
|
|
121
|
+
* Use cases: CDK bootstrap resource identification; Multi-environment CDK deployment; Bootstrap resource isolation; CDK role management
|
|
122
|
+
*
|
|
123
|
+
* AWS: AWS CDK bootstrap resources including deployment roles and asset buckets
|
|
124
|
+
*
|
|
125
|
+
* Validation: Must be valid CDK bootstrap qualifier string; defaults to standard CDK qualifier if not specified; optional string
|
|
126
|
+
**/
|
|
127
|
+
readonly cdkBootstrapContext?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Q-ENHANCED-INTERFACE
|
|
131
|
+
* Individual pipeline configuration interface for environment-specific MDAA deployment pipelines with domain, environment, and module filtering capabilities. Defines pipeline-specific deployment parameters including target filters for selective deployment, custom command execution, and pipeline-level deployment lifecycle management for targeted infrastructure deployment within multi-domain data architectures.
|
|
132
|
+
* Use cases: Environment-specific pipelines; Selective module deployment; Domain-filtered deployments; Pipeline customization; Targeted infrastructure updates
|
|
133
|
+
* AWS: AWS CodePipeline configuration with domain/environment/module filtering for selective MDAA deployment targeting specific infrastructure components
|
|
134
|
+
* Validation: domainFilter, envFilter, and moduleFilter must reference valid MDAA domains, environments, and modules; pipeline must inherit valid Commands configuration
|
|
135
|
+
*/
|
|
136
|
+
export interface PipelineConfig extends Commands {
|
|
137
|
+
/**
|
|
138
|
+
* Q-ENHANCED-PROPERTY
|
|
139
|
+
* Optional array of domain names for pipeline deployment filtering enabling selective domain-specific deployments. Restricts pipeline execution to only the specified MDAA domains, allowing for targeted deployment strategies and domain isolation in multi-domain data architectures.
|
|
140
|
+
*
|
|
141
|
+
* Use cases: Domain-specific deployments; Multi-domain filtering; Selective domain updates; Domain isolation strategies
|
|
142
|
+
*
|
|
143
|
+
* AWS: AWS CodePipeline domain filtering for selective MDAA domain deployment and targeted infrastructure updates
|
|
144
|
+
*
|
|
145
|
+
* Validation: Must be array of valid MDAA domain names if provided; domains must exist in MDAA configuration; optional for domain filtering
|
|
146
|
+
**/
|
|
147
|
+
readonly domainFilter?: string[];
|
|
148
|
+
/**
|
|
149
|
+
* Q-ENHANCED-PROPERTY
|
|
150
|
+
* Optional array of environment names for pipeline deployment filtering enabling selective environment-specific deployments. Restricts pipeline execution to only the specified MDAA environments, allowing for targeted deployment strategies and environment isolation across development, staging, and production environments.
|
|
151
|
+
*
|
|
152
|
+
* Use cases: Environment-specific deployments; Multi-environment filtering; Selective environment updates; Environment isolation strategies
|
|
153
|
+
*
|
|
154
|
+
* AWS: AWS CodePipeline environment filtering for selective MDAA environment deployment and targeted infrastructure updates
|
|
155
|
+
*
|
|
156
|
+
* Validation: Must be array of valid MDAA environment names if provided; environments must exist in MDAA configuration; optional for environment filtering
|
|
157
|
+
**/
|
|
158
|
+
readonly envFilter?: string[];
|
|
159
|
+
/**
|
|
160
|
+
* Q-ENHANCED-PROPERTY
|
|
161
|
+
* Optional array of module names for pipeline deployment filtering enabling selective module-specific deployments. Restricts pipeline execution to only the specified MDAA modules, allowing for targeted deployment strategies and module isolation for specific infrastructure components or services.
|
|
162
|
+
*
|
|
163
|
+
* Use cases: Module-specific deployments; Multi-module filtering; Selective module updates; Component isolation strategies
|
|
164
|
+
*
|
|
165
|
+
* AWS: AWS CodePipeline module filtering for selective MDAA module deployment and targeted infrastructure component updates
|
|
166
|
+
*
|
|
167
|
+
* Validation: Must be array of valid MDAA module names if provided; modules must exist in MDAA configuration; optional for module filtering
|
|
168
|
+
**/
|
|
169
|
+
readonly moduleFilter?: string[];
|
|
170
|
+
}
|
|
171
|
+
export declare class DevOpsConfigParser extends MdaaAppConfigParser<DevOpsConfigContents> {
|
|
172
|
+
readonly devopsConfig: DevOpsConfigContents;
|
|
173
|
+
constructor(stack: Stack, props: MdaaAppConfigParserProps);
|
|
174
|
+
}
|
|
175
|
+
export declare class MdaaDevopsCDKApp extends MdaaCdkApp {
|
|
176
|
+
constructor(props?: AppProps);
|
|
177
|
+
protected subGenerateResources(stack: Stack, l3ConstructProps: MdaaL3ConstructProps, parserProps: MdaaAppConfigParserProps): void;
|
|
178
|
+
}
|
|
179
|
+
export interface MdaaDevopsL3ConstructProps extends MdaaL3ConstructProps, DevOpsConfigContents {
|
|
180
|
+
}
|
|
181
|
+
export declare class MdaaDevopsL3Construct extends MdaaL3Construct {
|
|
182
|
+
private static readonly DEFAULT_CDK_BOOTSTRAP_CONTEXT;
|
|
183
|
+
private readonly props;
|
|
184
|
+
constructor(scope: Construct, id: string, props: MdaaDevopsL3ConstructProps);
|
|
185
|
+
private importCdkRole;
|
|
186
|
+
}
|
|
187
|
+
export interface MdaaPipelineProps extends PipelineProps, StageCommands, PipelineConfig {
|
|
188
|
+
readonly naming: IMdaaResourceNaming;
|
|
189
|
+
readonly pipelineName: string;
|
|
190
|
+
readonly codeCommitActionRole: IRole;
|
|
191
|
+
readonly codeCommitEventRole: IRole;
|
|
192
|
+
readonly codeBuildActionRole: IRole;
|
|
193
|
+
readonly mdaaRepo: IRepository;
|
|
194
|
+
readonly mdaaBranch?: string;
|
|
195
|
+
readonly configsRepo: IRepository;
|
|
196
|
+
readonly configsBranch?: string;
|
|
197
|
+
readonly kmsKey: IKey;
|
|
198
|
+
readonly manualActionRole: IRole;
|
|
199
|
+
}
|
|
200
|
+
export declare class MdaaPipeline extends Pipeline {
|
|
201
|
+
private readonly props;
|
|
202
|
+
constructor(scope: Construct, id: string, props: MdaaPipelineProps);
|
|
203
|
+
private addPostDeployValidateStage;
|
|
204
|
+
private addDeployStage;
|
|
205
|
+
private addPreDeployValidateStage;
|
|
206
|
+
private addPreDeployStage;
|
|
207
|
+
private createCodeCommitSourceAction;
|
|
208
|
+
private createMdaaCommand;
|
|
209
|
+
private createCodeBuildAction;
|
|
210
|
+
}
|