@xube/kit-aws-infrastructure 0.0.102 → 0.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pipeline/xube-build-step.d.ts +2 -4
- package/dist/pipeline/xube-build-step.d.ts.map +1 -1
- package/dist/pipeline/xube-build-step.js +2 -2
- package/dist/pipeline/xube-pipeline.d.ts +5 -5
- package/dist/pipeline/xube-pipeline.d.ts.map +1 -1
- package/dist/pipeline/xube-pipeline.js +3 -3
- package/package.json +5 -5
- package/src/pipeline/xube-build-step.ts +13 -20
- package/src/pipeline/xube-pipeline.ts +8 -10
|
@@ -23,16 +23,14 @@ import { XubeEnvironment } from "@xube/kit-aws-schema";
|
|
|
23
23
|
* Location of the cdk output when synth is completed (generally in cdk.out in the cdk directory)
|
|
24
24
|
*/
|
|
25
25
|
interface XubeBuildStepProps extends XubeEnvironment {
|
|
26
|
-
repository: string;
|
|
27
26
|
installCommands?: string[];
|
|
28
27
|
commands?: string[];
|
|
29
|
-
branchName?: string;
|
|
30
28
|
cdkOutPath?: string;
|
|
31
29
|
pipelineSource: CodePipelineSource;
|
|
32
|
-
|
|
30
|
+
buildStepName: string;
|
|
33
31
|
}
|
|
34
32
|
export declare class XubeBuildStep extends Construct {
|
|
35
|
-
|
|
33
|
+
buildStep: CodeBuildStep;
|
|
36
34
|
constructor(scope: Construct, id: string, props: XubeBuildStepProps);
|
|
37
35
|
}
|
|
38
36
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xube-build-step.d.ts","sourceRoot":"","sources":["../../src/pipeline/xube-build-step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAY1E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQvD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,UAAU,kBAAmB,SAAQ,eAAe;IAClD,
|
|
1
|
+
{"version":3,"file":"xube-build-step.d.ts","sourceRoot":"","sources":["../../src/pipeline/xube-build-step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAY1E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQvD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,UAAU,kBAAmB,SAAQ,eAAe;IAClD,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,kBAAkB,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,qBAAa,aAAc,SAAQ,SAAS;IAC1C,SAAS,EAAE,aAAa,CAAC;gBACb,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;CA6BpE"}
|
|
@@ -8,14 +8,14 @@ const constants_1 = require("./constants");
|
|
|
8
8
|
class XubeBuildStep extends constructs_1.Construct {
|
|
9
9
|
constructor(scope, id, props) {
|
|
10
10
|
super(scope, id);
|
|
11
|
-
this.
|
|
11
|
+
this.buildStep = new pipelines_1.CodeBuildStep(id + "synth-step", {
|
|
12
12
|
input: props.pipelineSource,
|
|
13
13
|
env: {},
|
|
14
14
|
role: new aws_iam_1.Role(scope, id + "-build-synth-role", {
|
|
15
15
|
assumedBy: new aws_iam_1.ServicePrincipal("codebuild.amazonaws.com"),
|
|
16
16
|
managedPolicies: [
|
|
17
17
|
new aws_iam_1.ManagedPolicy(scope, id + "-build-synth-policy", {
|
|
18
|
-
managedPolicyName: id +
|
|
18
|
+
managedPolicyName: id + "-policy",
|
|
19
19
|
statements: [
|
|
20
20
|
new aws_iam_1.PolicyStatement({
|
|
21
21
|
actions: ["cognito-idp:*"],
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Construct } from "constructs";
|
|
2
|
+
import { CodeBuildStep } from "aws-cdk-lib/pipelines";
|
|
3
|
+
import { Stage } from "aws-cdk-lib";
|
|
2
4
|
import { XubeEnvironment } from "@xube/kit-aws-schema";
|
|
3
|
-
import { XubeBuildStep } from "./xube-build-step";
|
|
4
|
-
import { XubeDeploymentStage } from "./xube-deploy-stage";
|
|
5
5
|
interface XubeDeployPipelineProps extends XubeEnvironment {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
pipelineName: string;
|
|
7
|
+
buildStep: CodeBuildStep;
|
|
8
|
+
deployStage: Stage;
|
|
9
9
|
}
|
|
10
10
|
export declare class XubeDeployPipeline extends Construct {
|
|
11
11
|
constructor(scope: Construct, id: string, props: XubeDeployPipelineProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xube-pipeline.d.ts","sourceRoot":"","sources":["../../src/pipeline/xube-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"xube-pipeline.d.ts","sourceRoot":"","sources":["../../src/pipeline/xube-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAgB,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,UAAU,uBAAwB,SAAQ,eAAe;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,aAAa,CAAC;IACzB,WAAW,EAAE,KAAK,CAAC;CACpB;AAED,qBAAa,kBAAmB,SAAQ,SAAS;gBACnC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB;CAYzE"}
|
|
@@ -7,12 +7,12 @@ class XubeDeployPipeline extends constructs_1.Construct {
|
|
|
7
7
|
constructor(scope, id, props) {
|
|
8
8
|
super(scope, id);
|
|
9
9
|
const pipeline = new pipelines_1.CodePipeline(this, id + "Pipeline", {
|
|
10
|
-
pipelineName: props.
|
|
11
|
-
synth: props.
|
|
10
|
+
pipelineName: props.pipelineName,
|
|
11
|
+
synth: props.buildStep,
|
|
12
12
|
dockerEnabledForSynth: true,
|
|
13
13
|
dockerEnabledForSelfMutation: true,
|
|
14
14
|
});
|
|
15
|
-
pipeline.addStage(props.
|
|
15
|
+
pipeline.addStage(props.deployStage);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
exports.XubeDeployPipeline = XubeDeployPipeline;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xube/kit-aws-infrastructure",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.104",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/XubeLtd/dev-kit#readme",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@xube/kit-build": "^0.0.
|
|
20
|
+
"@xube/kit-build": "^0.0.104",
|
|
21
21
|
"aws-cdk": "^2.159.1"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@xube/kit-aws-schema": "^0.0.
|
|
25
|
-
"@xube/kit-log": "^0.0.
|
|
26
|
-
"@xube/kit-request": "^0.0.
|
|
24
|
+
"@xube/kit-aws-schema": "^0.0.104",
|
|
25
|
+
"@xube/kit-log": "^0.0.104",
|
|
26
|
+
"@xube/kit-request": "^0.0.104",
|
|
27
27
|
"aws-cdk-lib": "^2.159.1",
|
|
28
28
|
"aws-lambda": "^1.0.7",
|
|
29
29
|
"constructs": "^10.3.0"
|
|
@@ -41,41 +41,34 @@ import {
|
|
|
41
41
|
* Location of the cdk output when synth is completed (generally in cdk.out in the cdk directory)
|
|
42
42
|
*/
|
|
43
43
|
interface XubeBuildStepProps extends XubeEnvironment {
|
|
44
|
-
repository: string;
|
|
45
44
|
installCommands?: string[];
|
|
46
45
|
commands?: string[];
|
|
47
|
-
branchName?: string;
|
|
48
46
|
cdkOutPath?: string;
|
|
49
47
|
pipelineSource: CodePipelineSource;
|
|
50
|
-
|
|
48
|
+
buildStepName: string;
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
export class XubeBuildStep extends Construct {
|
|
54
|
-
|
|
52
|
+
buildStep: CodeBuildStep;
|
|
55
53
|
constructor(scope: Construct, id: string, props: XubeBuildStepProps) {
|
|
56
54
|
super(scope, id);
|
|
57
55
|
|
|
58
|
-
this.
|
|
56
|
+
this.buildStep = new CodeBuildStep(id + "synth-step", {
|
|
59
57
|
input: props.pipelineSource,
|
|
60
58
|
env: {},
|
|
61
|
-
|
|
62
59
|
role: new Role(scope, id + "-build-synth-role", {
|
|
63
60
|
assumedBy: new ServicePrincipal("codebuild.amazonaws.com"),
|
|
64
61
|
managedPolicies: [
|
|
65
|
-
new ManagedPolicy(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}),
|
|
76
|
-
],
|
|
77
|
-
}
|
|
78
|
-
),
|
|
62
|
+
new ManagedPolicy(scope, id + "-build-synth-policy", {
|
|
63
|
+
managedPolicyName: id + "-policy",
|
|
64
|
+
statements: [
|
|
65
|
+
new PolicyStatement({
|
|
66
|
+
actions: ["cognito-idp:*"],
|
|
67
|
+
effect: Effect.ALLOW,
|
|
68
|
+
resources: ["*"],
|
|
69
|
+
}),
|
|
70
|
+
],
|
|
71
|
+
}),
|
|
79
72
|
],
|
|
80
73
|
}),
|
|
81
74
|
buildEnvironment: {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { Construct } from "constructs";
|
|
2
|
-
import { CodePipeline } from "aws-cdk-lib/pipelines";
|
|
3
|
-
import {
|
|
2
|
+
import { CodeBuildStep, CodePipeline } from "aws-cdk-lib/pipelines";
|
|
3
|
+
import { Stage } from "aws-cdk-lib";
|
|
4
4
|
import { XubeEnvironment } from "@xube/kit-aws-schema";
|
|
5
|
-
import { XubeBuildStep } from "./xube-build-step";
|
|
6
|
-
import { XubeDeploymentStage } from "./xube-deploy-stage";
|
|
7
5
|
|
|
8
6
|
interface XubeDeployPipelineProps extends XubeEnvironment {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
pipelineName: string;
|
|
8
|
+
buildStep: CodeBuildStep;
|
|
9
|
+
deployStage: Stage;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
export class XubeDeployPipeline extends Construct {
|
|
@@ -16,12 +14,12 @@ export class XubeDeployPipeline extends Construct {
|
|
|
16
14
|
super(scope, id);
|
|
17
15
|
|
|
18
16
|
const pipeline = new CodePipeline(this, id + "Pipeline", {
|
|
19
|
-
pipelineName: props.
|
|
20
|
-
synth: props.
|
|
17
|
+
pipelineName: props.pipelineName,
|
|
18
|
+
synth: props.buildStep,
|
|
21
19
|
dockerEnabledForSynth: true,
|
|
22
20
|
dockerEnabledForSelfMutation: true,
|
|
23
21
|
});
|
|
24
22
|
|
|
25
|
-
pipeline.addStage(props.
|
|
23
|
+
pipeline.addStage(props.deployStage);
|
|
26
24
|
}
|
|
27
25
|
}
|