@gradientedge/cdk-utils 4.8.0 → 4.9.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.
@@ -53,4 +53,11 @@ export declare class ApiManager {
53
53
  * @param {string[]?} allowedHeaders
54
54
  */
55
55
  createApiResource(id: string, scope: common.CommonConstruct, parent: apig.IResource, path: string, integration: apig.Integration, addProxy: boolean, allowedOrigins?: string[], allowedMethods?: string[], allowedHeaders?: string[]): apig.Resource;
56
+ /**
57
+ * @summary Method to create an api deployment
58
+ * @param {string} id
59
+ * @param {common.CommonConstruct} scope
60
+ * @param {apig.IRestApi} restApi
61
+ */
62
+ createApiDeployment(id: string, scope: common.CommonConstruct, restApi: apig.IRestApi): void;
56
63
  }
@@ -145,5 +145,17 @@ class ApiManager {
145
145
  }
146
146
  return resource;
147
147
  }
148
+ /**
149
+ * @summary Method to create an api deployment
150
+ * @param {string} id
151
+ * @param {common.CommonConstruct} scope
152
+ * @param {apig.IRestApi} restApi
153
+ */
154
+ createApiDeployment(id, scope, restApi) {
155
+ new apig.Deployment(scope, `${id}`, {
156
+ api: restApi,
157
+ retainDeployments: false,
158
+ });
159
+ }
148
160
  }
149
161
  exports.ApiManager = ApiManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "4.8.0",
3
+ "version": "4.9.0",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -150,4 +150,17 @@ export class ApiManager {
150
150
 
151
151
  return resource
152
152
  }
153
+
154
+ /**
155
+ * @summary Method to create an api deployment
156
+ * @param {string} id
157
+ * @param {common.CommonConstruct} scope
158
+ * @param {apig.IRestApi} restApi
159
+ */
160
+ public createApiDeployment(id: string, scope: common.CommonConstruct, restApi: apig.IRestApi) {
161
+ new apig.Deployment(scope, `${id}`, {
162
+ api: restApi,
163
+ retainDeployments: false,
164
+ })
165
+ }
153
166
  }