@gradientedge/cdk-utils 8.100.0 → 8.102.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/README.md CHANGED
@@ -62,7 +62,7 @@ pnpm add @gradientedge/cdk-utils
62
62
  [aws-cdk]: https://docs.aws.amazon.com/cdk/latest/guide/home.html
63
63
  [aws-cli-badge]: https://img.shields.io/badge/aws--cli-2.3.4-777BB4?logo=amazon-aws
64
64
  [aws-cli-url]: https://aws.amazon.com/cli/
65
- [builds]: https://img.shields.io/github/workflow/status/gradientedge/cdk-utils/CI-Pipeline/main
65
+ [builds]: https://img.shields.io/github/actions/workflow/status/gradientedge/cdk-utils/ci.yml?branch=main
66
66
  [builds-url]: https://github.com/gradientedge/cdk-utils/actions
67
67
  [cdk-badge]: https://img.shields.io/github/package-json/dependency-version/gradientedge/cdk-utils/aws-cdk-lib
68
68
  [cdk-url]: https://aws.amazon.com/cdk/
@@ -207,6 +207,14 @@ export declare class IamManager {
207
207
  * @param servicePrinicpal
208
208
  */
209
209
  createRoleForLambda(id: string, scope: CommonConstruct, policy: iam.PolicyDocument, servicePrinicpal?: iam.ServicePrincipal): cdk.aws_iam.Role;
210
+ /**
211
+ * @summary Method to create iam statement for appconfig secrets manager integration
212
+ * @param id scoped id of the resource
213
+ * @param scope scope in which this resource is defined
214
+ * @param policy
215
+ * @param servicePrinicpal
216
+ */
217
+ createRoleForAppConfigSecrets(id: string, scope: CommonConstruct, policy: iam.PolicyDocument, servicePrinicpal?: iam.ServicePrincipal): cdk.aws_iam.Role;
210
218
  /**
211
219
  * @summary Method to create iam statement for step function execution
212
220
  * @param id scoped id of the resource
@@ -499,6 +499,24 @@ class IamManager {
499
499
  utils.createCfnOutput(`${id}Name`, scope, role.roleName);
500
500
  return role;
501
501
  }
502
+ /**
503
+ * @summary Method to create iam statement for appconfig secrets manager integration
504
+ * @param id scoped id of the resource
505
+ * @param scope scope in which this resource is defined
506
+ * @param policy
507
+ * @param servicePrinicpal
508
+ */
509
+ createRoleForAppConfigSecrets(id, scope, policy, servicePrinicpal) {
510
+ const role = new iam.Role(scope, `${id}`, {
511
+ assumedBy: servicePrinicpal ?? new iam.ServicePrincipal('appconfig.amazonaws.com'),
512
+ description: `Role for ${id} AppConfig Secrets`,
513
+ inlinePolicies: { policy },
514
+ roleName: `${id}-${scope.props.stage}`,
515
+ });
516
+ utils.createCfnOutput(`${id}Arn`, scope, role.roleArn);
517
+ utils.createCfnOutput(`${id}Name`, scope, role.roleName);
518
+ return role;
519
+ }
502
520
  /**
503
521
  * @summary Method to create iam statement for step function execution
504
522
  * @param id scoped id of the resource
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "8.100.0",
3
+ "version": "8.102.0",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -46,15 +46,15 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@aws-sdk/client-secrets-manager": "^3.357.0",
50
- "@aws-sdk/credential-providers": "^3.357.0",
49
+ "@aws-sdk/client-secrets-manager": "^3.360.0",
50
+ "@aws-sdk/credential-providers": "^3.360.0",
51
51
  "@aws-sdk/types": "^3.357.0",
52
52
  "@types/lodash": "^4.14.195",
53
- "@types/node": "^20.3.1",
53
+ "@types/node": "^20.3.2",
54
54
  "@types/uuid": "^9.0.2",
55
55
  "app-root-path": "^3.1.0",
56
56
  "aws-cdk-lib": "^2.85.0",
57
- "constructs": "^10.2.56",
57
+ "constructs": "^10.2.60",
58
58
  "lodash": "^4.17.21",
59
59
  "moment": "^2.29.4",
60
60
  "nconf": "^0.12.0",
@@ -67,8 +67,8 @@
67
67
  "@babel/eslint-parser": "^7.22.5",
68
68
  "@babel/plugin-proposal-class-properties": "^7.18.6",
69
69
  "@types/jest": "^29.5.2",
70
- "@typescript-eslint/eslint-plugin": "^5.60.0",
71
- "@typescript-eslint/parser": "^5.60.0",
70
+ "@typescript-eslint/eslint-plugin": "^5.60.1",
71
+ "@typescript-eslint/parser": "^5.60.1",
72
72
  "aws-cdk": "^2.85.0",
73
73
  "better-docs": "^2.7.2",
74
74
  "codecov": "^3.8.3",
@@ -78,7 +78,7 @@
78
78
  "eslint": "^8.43.0",
79
79
  "eslint-config-prettier": "^8.8.0",
80
80
  "eslint-plugin-import": "^2.27.5",
81
- "eslint-plugin-jsdoc": "^46.2.6",
81
+ "eslint-plugin-jsdoc": "^46.3.0",
82
82
  "husky": "^8.0.3",
83
83
  "jest": "^29.5.0",
84
84
  "jest-extended": "^4.0.0",
@@ -538,6 +538,32 @@ export class IamManager {
538
538
  return role
539
539
  }
540
540
 
541
+ /**
542
+ * @summary Method to create iam statement for appconfig secrets manager integration
543
+ * @param id scoped id of the resource
544
+ * @param scope scope in which this resource is defined
545
+ * @param policy
546
+ * @param servicePrinicpal
547
+ */
548
+ public createRoleForAppConfigSecrets(
549
+ id: string,
550
+ scope: CommonConstruct,
551
+ policy: iam.PolicyDocument,
552
+ servicePrinicpal?: iam.ServicePrincipal
553
+ ) {
554
+ const role = new iam.Role(scope, `${id}`, {
555
+ assumedBy: servicePrinicpal ?? new iam.ServicePrincipal('appconfig.amazonaws.com'),
556
+ description: `Role for ${id} AppConfig Secrets`,
557
+ inlinePolicies: { policy },
558
+ roleName: `${id}-${scope.props.stage}`,
559
+ })
560
+
561
+ utils.createCfnOutput(`${id}Arn`, scope, role.roleArn)
562
+ utils.createCfnOutput(`${id}Name`, scope, role.roleName)
563
+
564
+ return role
565
+ }
566
+
541
567
  /**
542
568
  * @summary Method to create iam statement for step function execution
543
569
  * @param id scoped id of the resource