@akdev1l/constructs 0.0.3 → 0.0.4
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.
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GithubAccessProvider = void 0;
|
|
4
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
+
const constructs_1 = require("constructs");
|
|
6
|
+
class GithubAccessProvider extends constructs_1.Construct {
|
|
4
7
|
static GITHUB_DOMAIN = 'https://token.actions.githubusercontent.com';
|
|
5
8
|
provider;
|
|
6
9
|
role;
|
|
7
10
|
constructor(scope, id, props) {
|
|
8
11
|
super(scope, id);
|
|
9
|
-
this.provider = new
|
|
12
|
+
this.provider = new aws_cdk_lib_1.aws_iam.OpenIdConnectProvider(this, 'GithubActionsProvider', {
|
|
10
13
|
url: GithubAccessProvider.GITHUB_DOMAIN,
|
|
11
14
|
clientIds: ['sts.amazonaws.com'],
|
|
12
15
|
});
|
|
@@ -19,12 +22,13 @@ export class GithubAccessProvider extends Construct {
|
|
|
19
22
|
'token.actions.githubusercontent.com:aud': 'sts.amazonaws.com',
|
|
20
23
|
},
|
|
21
24
|
};
|
|
22
|
-
this.role = new
|
|
25
|
+
this.role = new aws_cdk_lib_1.aws_iam.Role(this, 'GithubActionsRole', {
|
|
23
26
|
roleName: 'GithubActions',
|
|
24
|
-
assumedBy: new
|
|
27
|
+
assumedBy: new aws_cdk_lib_1.aws_iam.WebIdentityPrincipal(this.provider.openIdConnectProviderArn, conditions),
|
|
25
28
|
description: `Access for deployment from repo ${props.repo}`,
|
|
26
|
-
maxSessionDuration: Duration.hours(2),
|
|
29
|
+
maxSessionDuration: aws_cdk_lib_1.Duration.hours(2),
|
|
27
30
|
});
|
|
28
31
|
}
|
|
29
32
|
}
|
|
33
|
+
exports.GithubAccessProvider = GithubAccessProvider;
|
|
30
34
|
//# sourceMappingURL=access-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access-provider.js","sourceRoot":"","sources":["../../../src/github/access-provider.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"access-provider.js","sourceRoot":"","sources":["../../../src/github/access-provider.ts"],"names":[],"mappings":";;;AAAA,6CAGqB;AACrB,2CAAuC;AAMvC,MAAa,oBAAqB,SAAQ,sBAAS;IACzC,MAAM,CAAC,aAAa,GAAG,6CAA6C,CAAC;IAEpE,QAAQ,CAA4B;IACpC,IAAI,CAAW;IAExB,YAAY,KAAgB,EAAE,EAAU,EAAE,KAAgC;QACxE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAEjB,IAAI,CAAC,QAAQ,GAAG,IAAI,qBAAG,CAAC,qBAAqB,CAAC,IAAI,EAAE,uBAAuB,EAAE;YAC3E,GAAG,EAAE,oBAAoB,CAAC,aAAa;YACvC,SAAS,EAAE,CAAC,mBAAmB,CAAC;SACjC,CAAC,CAAC;QAEH,MAAM,UAAU,GAAmB;YACjC,UAAU,EAAE;gBACV,CAAC,GAAG,oBAAoB,CAAC,aAAa,MAAM,CAAC,EAAE,QAAQ,KAAK,CAAC,IAAI,EAAE;aACpE;YACD,wBAAwB,EAAE;gBACxB,yCAAyC,EAAE,6CAA6C;gBACxF,yCAAyC,EAAE,mBAAmB;aAC/D;SACF,CAAC;QAEF,IAAI,CAAC,IAAI,GAAG,IAAI,qBAAG,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,EAAE;YAClD,QAAQ,EAAE,eAAe;YACzB,SAAS,EAAE,IAAI,qBAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,wBAAwB,EAAE,UAAU,CAAC;YAC3F,WAAW,EAAE,mCAAmC,KAAK,CAAC,IAAI,EAAE;YAC5D,kBAAkB,EAAE,sBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;SACtC,CAAC,CAAC;IACL,CAAC;;AA9BH,oDA+BC"}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./access-provider"), exports);
|
|
2
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/github/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/github/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC"}
|
package/build/dist/index.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./github"), exports);
|
|
2
18
|
//# sourceMappingURL=index.js.map
|
package/build/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akdev1l/constructs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "CDK Constructs",
|
|
5
5
|
"private": false,
|
|
6
6
|
"files": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"license": "GPL-3.0",
|
|
28
28
|
"author": "akdev1l",
|
|
29
|
-
"type": "
|
|
29
|
+
"type": "commonjs",
|
|
30
30
|
"main": "build/index.js",
|
|
31
31
|
"scripts": {
|
|
32
32
|
"prepublish": "npm run release",
|