@pristine-ts/aws 0.0.247 → 0.0.248
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/lib/cjs/clients/clients.js +1 -0
- package/dist/lib/cjs/clients/clients.js.map +1 -1
- package/dist/lib/cjs/clients/cloudformation.client.js +145 -0
- package/dist/lib/cjs/clients/cloudformation.client.js.map +1 -0
- package/dist/lib/cjs/interfaces/cloudformation-client.interface.js +3 -0
- package/dist/lib/cjs/interfaces/cloudformation-client.interface.js.map +1 -0
- package/dist/lib/cjs/interfaces/interfaces.js +1 -0
- package/dist/lib/cjs/interfaces/interfaces.js.map +1 -1
- package/dist/lib/esm/clients/clients.js +1 -0
- package/dist/lib/esm/clients/clients.js.map +1 -1
- package/dist/lib/esm/clients/cloudformation.client.js +142 -0
- package/dist/lib/esm/clients/cloudformation.client.js.map +1 -0
- package/dist/lib/esm/interfaces/cloudformation-client.interface.js +2 -0
- package/dist/lib/esm/interfaces/cloudformation-client.interface.js.map +1 -0
- package/dist/lib/esm/interfaces/interfaces.js +1 -0
- package/dist/lib/esm/interfaces/interfaces.js.map +1 -1
- package/dist/types/clients/clients.d.ts +1 -0
- package/dist/types/clients/cloudformation.client.d.ts +52 -0
- package/dist/types/interfaces/cloudformation-client.interface.d.ts +38 -0
- package/dist/types/interfaces/interfaces.d.ts +1 -0
- package/dist/types/interfaces/s3-client.interface.d.ts +4 -5
- package/package.json +8 -7
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cloudformation.client"), exports);
|
|
17
18
|
__exportStar(require("./dynamodb.client"), exports);
|
|
18
19
|
__exportStar(require("./event-bridge.client"), exports);
|
|
19
20
|
__exportStar(require("./s3.client"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../../../src/clients/clients.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,wDAAsC;AACtC,8CAA4B;AAC5B,+CAA6B;AAC7B,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../../../src/clients/clients.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,oDAAkC;AAClC,wDAAsC;AACtC,8CAA4B;AAC5B,+CAA6B;AAC7B,+CAA6B"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.CloudformationClient = void 0;
|
|
25
|
+
const tsyringe_1 = require("tsyringe");
|
|
26
|
+
const common_1 = require("@pristine-ts/common");
|
|
27
|
+
const aws_module_keyname_1 = require("../aws.module.keyname");
|
|
28
|
+
const client_cloudformation_1 = require("@aws-sdk/client-cloudformation");
|
|
29
|
+
/**
|
|
30
|
+
* The client to use to interact with AWS Cloudformation. It is a wrapper around the CloudformationClient of @aws-sdk/client-cloudformation.
|
|
31
|
+
* It is tagged so it can be injected using CloudformationClientInterface.
|
|
32
|
+
* AWS documentation https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudformation/
|
|
33
|
+
*/
|
|
34
|
+
let CloudformationClient = class CloudformationClient {
|
|
35
|
+
/**
|
|
36
|
+
* The client to use to interact with AWS Cloudformation. It is a wrapper around the CloudformationClient of @aws-sdk/client-cloudformation.
|
|
37
|
+
* @param logHandler The log handler used to output logs.
|
|
38
|
+
* @param region The aws region for which the client will be used.
|
|
39
|
+
*/
|
|
40
|
+
constructor(logHandler, region) {
|
|
41
|
+
this.logHandler = logHandler;
|
|
42
|
+
this.region = region;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Returns the instantiated CloudformationClient from the @aws-sdk/client-s3 cloudformation
|
|
46
|
+
*/
|
|
47
|
+
getClient() {
|
|
48
|
+
var _a;
|
|
49
|
+
return this.client = (_a = this.client) !== null && _a !== void 0 ? _a : new client_cloudformation_1.CloudFormationClient({ region: this.region });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Allows you to manually set the config if needed.
|
|
53
|
+
* @param config
|
|
54
|
+
*/
|
|
55
|
+
setClient(config) {
|
|
56
|
+
this.client = new client_cloudformation_1.CloudFormationClient(config);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Gets the description and all its details from a Cloudformation stack.
|
|
60
|
+
* @param stackName The stack name to get the.
|
|
61
|
+
*/
|
|
62
|
+
getStackDescription(stackName) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
this.logHandler.debug("CLOUDFORMATION CLIENT - Getting stack information", { stackName }, aws_module_keyname_1.AwsModuleKeyname);
|
|
65
|
+
const command = new client_cloudformation_1.DescribeStacksCommand({
|
|
66
|
+
StackName: stackName,
|
|
67
|
+
});
|
|
68
|
+
try {
|
|
69
|
+
const response = yield this.getClient().send(command);
|
|
70
|
+
if (!response.Stacks || response.Stacks.length < 1) {
|
|
71
|
+
throw new Error("No stacks were returned from cloudformation");
|
|
72
|
+
}
|
|
73
|
+
if (response.Stacks.length > 1) {
|
|
74
|
+
throw new Error("More than one stack was returned from cloudformation");
|
|
75
|
+
}
|
|
76
|
+
return response.Stacks[0];
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
this.logHandler.error("Error getting stack description from cloudformation", { error: e }, aws_module_keyname_1.AwsModuleKeyname);
|
|
80
|
+
throw e;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Creates a new stack in Cloudformation.
|
|
86
|
+
* @param input The input to create the new stack.
|
|
87
|
+
*/
|
|
88
|
+
createStack(input) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
this.logHandler.debug("CLOUDFORMATION CLIENT - Creating new stack", { input }, aws_module_keyname_1.AwsModuleKeyname);
|
|
91
|
+
const command = new client_cloudformation_1.CreateStackCommand(input);
|
|
92
|
+
try {
|
|
93
|
+
return this.getClient().send(command);
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
this.logHandler.error("Error creating stack in cloudformation", { error: e }, aws_module_keyname_1.AwsModuleKeyname);
|
|
97
|
+
throw e;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Updates a stack in Cloudformation.
|
|
103
|
+
* @param input The input to update the new stack.
|
|
104
|
+
*/
|
|
105
|
+
updateStack(input) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
this.logHandler.debug("CLOUDFORMATION CLIENT - Updating stack", { input }, aws_module_keyname_1.AwsModuleKeyname);
|
|
108
|
+
const command = new client_cloudformation_1.UpdateStackCommand(input);
|
|
109
|
+
try {
|
|
110
|
+
return this.getClient().send(command);
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
this.logHandler.error("Error updating stack in cloudformation", { error: e }, aws_module_keyname_1.AwsModuleKeyname);
|
|
114
|
+
throw e;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Deletes a stack in Cloudformation.
|
|
120
|
+
* @param input The input to delete the new stack.
|
|
121
|
+
*/
|
|
122
|
+
deleteStack(input) {
|
|
123
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
this.logHandler.debug("CLOUDFORMATION CLIENT - Deleting stack", { input }, aws_module_keyname_1.AwsModuleKeyname);
|
|
125
|
+
const command = new client_cloudformation_1.DeleteStackCommand(input);
|
|
126
|
+
try {
|
|
127
|
+
return this.getClient().send(command);
|
|
128
|
+
}
|
|
129
|
+
catch (e) {
|
|
130
|
+
this.logHandler.error("Error deleting stack in cloudformation", { error: e }, aws_module_keyname_1.AwsModuleKeyname);
|
|
131
|
+
throw e;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
CloudformationClient = __decorate([
|
|
137
|
+
(0, common_1.tag)("CloudformationClientInterface"),
|
|
138
|
+
(0, common_1.moduleScoped)(aws_module_keyname_1.AwsModuleKeyname),
|
|
139
|
+
(0, tsyringe_1.injectable)(),
|
|
140
|
+
__param(0, (0, tsyringe_1.inject)("LogHandlerInterface")),
|
|
141
|
+
__param(1, (0, tsyringe_1.inject)("%pristine.aws.region%")),
|
|
142
|
+
__metadata("design:paramtypes", [Object, String])
|
|
143
|
+
], CloudformationClient);
|
|
144
|
+
exports.CloudformationClient = CloudformationClient;
|
|
145
|
+
//# sourceMappingURL=cloudformation.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudformation.client.js","sourceRoot":"","sources":["../../../../src/clients/cloudformation.client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAE5C,gDAAsD;AACtD,8DAAuD;AACvD,0EASwC;AAGxC;;;;GAIG;AAII,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAQ7B;;;;OAIG;IACH,YACoD,UAA+B,EACvC,MAAc;QADN,eAAU,GAAV,UAAU,CAAqB;QACvC,WAAM,GAAN,MAAM,CAAQ;IAE1D,CAAC;IAED;;OAEG;IACH,SAAS;;QACL,OAAO,IAAI,CAAC,MAAM,GAAG,MAAA,IAAI,CAAC,MAAM,mCAAI,IAAI,4CAAuB,CAAC,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;IAC3F,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,MAAkC;QACxC,IAAI,CAAC,MAAM,GAAG,IAAI,4CAAuB,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;IAED;;;OAGG;IACG,mBAAmB,CAAC,SAAiB;;YACvC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,mDAAmD,EAAE,EAAC,SAAS,EAAC,EAAE,qCAAgB,CAAC,CAAC;YAC1G,MAAM,OAAO,GAAG,IAAI,6CAAqB,CAAC;gBACtC,SAAS,EAAE,SAAS;aACvB,CAAC,CAAA;YACF,IAAI;gBACA,MAAM,QAAQ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AM,OAAO,GAAG,IAAI,0CAAkB,CAAC,KAAK,CAAC,CAAA;YAC7C,IAAI;gBACA,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACzC;YAAC,OAAO,CAAC,EAAE;gBACR,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,wCAAwC,EAAE,EAAC,KAAK,EAAE,CAAC,EAAC,EAAE,qCAAgB,CAAC,CAAC;gBAC9F,MAAM,CAAC,CAAC;aACX;QACL,CAAC;KAAA;IAED;;;OAGG;IACG,WAAW,CAAC,KAA8B;;YAC5C,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,wCAAwC,EAAE,EAAC,KAAK,EAAC,EAAE,qCAAgB,CAAC,CAAC;YAC3F,MAAM,OAAO,GAAG,IAAI,0CAAkB,CAAC,KAAK,CAAC,CAAA;YAC7C,IAAI;gBACA,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACzC;YAAC,OAAO,CAAC,EAAE;gBACR,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,wCAAwC,EAAE,EAAC,KAAK,EAAE,CAAC,EAAC,EAAE,qCAAgB,CAAC,CAAC;gBAC9F,MAAM,CAAC,CAAC;aACX;QACL,CAAC;KAAA;CACJ,CAAA;AAtGY,oBAAoB;IAHhC,IAAA,YAAG,EAAC,+BAA+B,CAAC;IACpC,IAAA,qBAAY,EAAC,qCAAgB,CAAC;IAC9B,IAAA,qBAAU,GAAE;IAeJ,WAAA,IAAA,iBAAM,EAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,uBAAuB,CAAC,CAAA;;GAf3B,oBAAoB,CAsGhC;AAtGY,oDAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudformation-client.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/cloudformation-client.interface.ts"],"names":[],"mappings":""}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cloudformation-client.interface"), exports);
|
|
17
18
|
__exportStar(require("./dynamodb-client.interface"), exports);
|
|
18
19
|
__exportStar(require("./event-bridge-client.interface"), exports);
|
|
19
20
|
__exportStar(require("./s3-client.interface"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,kEAAgD;AAChD,wDAAsC;AACtC,yDAAuC;AACvC,yDAAuC"}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD;AAClD,8DAA4C;AAC5C,kEAAgD;AAChD,wDAAsC;AACtC,yDAAuC;AACvC,yDAAuC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../../../src/clients/clients.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../../../src/clients/clients.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
import { inject, injectable } from "tsyringe";
|
|
23
|
+
import { moduleScoped, tag } from "@pristine-ts/common";
|
|
24
|
+
import { AwsModuleKeyname } from "../aws.module.keyname";
|
|
25
|
+
import { CloudFormationClient as AWSCloudformationClient, CreateStackCommand, DeleteStackCommand, DescribeStacksCommand, UpdateStackCommand } from "@aws-sdk/client-cloudformation";
|
|
26
|
+
/**
|
|
27
|
+
* The client to use to interact with AWS Cloudformation. It is a wrapper around the CloudformationClient of @aws-sdk/client-cloudformation.
|
|
28
|
+
* It is tagged so it can be injected using CloudformationClientInterface.
|
|
29
|
+
* AWS documentation https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudformation/
|
|
30
|
+
*/
|
|
31
|
+
let CloudformationClient = class CloudformationClient {
|
|
32
|
+
/**
|
|
33
|
+
* The client to use to interact with AWS Cloudformation. It is a wrapper around the CloudformationClient of @aws-sdk/client-cloudformation.
|
|
34
|
+
* @param logHandler The log handler used to output logs.
|
|
35
|
+
* @param region The aws region for which the client will be used.
|
|
36
|
+
*/
|
|
37
|
+
constructor(logHandler, region) {
|
|
38
|
+
this.logHandler = logHandler;
|
|
39
|
+
this.region = region;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns the instantiated CloudformationClient from the @aws-sdk/client-s3 cloudformation
|
|
43
|
+
*/
|
|
44
|
+
getClient() {
|
|
45
|
+
var _a;
|
|
46
|
+
return this.client = (_a = this.client) !== null && _a !== void 0 ? _a : new AWSCloudformationClient({ region: this.region });
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Allows you to manually set the config if needed.
|
|
50
|
+
* @param config
|
|
51
|
+
*/
|
|
52
|
+
setClient(config) {
|
|
53
|
+
this.client = new AWSCloudformationClient(config);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Gets the description and all its details from a Cloudformation stack.
|
|
57
|
+
* @param stackName The stack name to get the.
|
|
58
|
+
*/
|
|
59
|
+
getStackDescription(stackName) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
this.logHandler.debug("CLOUDFORMATION CLIENT - Getting stack information", { stackName }, AwsModuleKeyname);
|
|
62
|
+
const command = new DescribeStacksCommand({
|
|
63
|
+
StackName: stackName,
|
|
64
|
+
});
|
|
65
|
+
try {
|
|
66
|
+
const response = yield this.getClient().send(command);
|
|
67
|
+
if (!response.Stacks || response.Stacks.length < 1) {
|
|
68
|
+
throw new Error("No stacks were returned from cloudformation");
|
|
69
|
+
}
|
|
70
|
+
if (response.Stacks.length > 1) {
|
|
71
|
+
throw new Error("More than one stack was returned from cloudformation");
|
|
72
|
+
}
|
|
73
|
+
return response.Stacks[0];
|
|
74
|
+
}
|
|
75
|
+
catch (e) {
|
|
76
|
+
this.logHandler.error("Error getting stack description from cloudformation", { error: e }, AwsModuleKeyname);
|
|
77
|
+
throw e;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Creates a new stack in Cloudformation.
|
|
83
|
+
* @param input The input to create the new stack.
|
|
84
|
+
*/
|
|
85
|
+
createStack(input) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
this.logHandler.debug("CLOUDFORMATION CLIENT - Creating new stack", { input }, AwsModuleKeyname);
|
|
88
|
+
const command = new CreateStackCommand(input);
|
|
89
|
+
try {
|
|
90
|
+
return this.getClient().send(command);
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
this.logHandler.error("Error creating stack in cloudformation", { error: e }, AwsModuleKeyname);
|
|
94
|
+
throw e;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Updates a stack in Cloudformation.
|
|
100
|
+
* @param input The input to update the new stack.
|
|
101
|
+
*/
|
|
102
|
+
updateStack(input) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
this.logHandler.debug("CLOUDFORMATION CLIENT - Updating stack", { input }, AwsModuleKeyname);
|
|
105
|
+
const command = new UpdateStackCommand(input);
|
|
106
|
+
try {
|
|
107
|
+
return this.getClient().send(command);
|
|
108
|
+
}
|
|
109
|
+
catch (e) {
|
|
110
|
+
this.logHandler.error("Error updating stack in cloudformation", { error: e }, AwsModuleKeyname);
|
|
111
|
+
throw e;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Deletes a stack in Cloudformation.
|
|
117
|
+
* @param input The input to delete the new stack.
|
|
118
|
+
*/
|
|
119
|
+
deleteStack(input) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
this.logHandler.debug("CLOUDFORMATION CLIENT - Deleting stack", { input }, AwsModuleKeyname);
|
|
122
|
+
const command = new DeleteStackCommand(input);
|
|
123
|
+
try {
|
|
124
|
+
return this.getClient().send(command);
|
|
125
|
+
}
|
|
126
|
+
catch (e) {
|
|
127
|
+
this.logHandler.error("Error deleting stack in cloudformation", { error: e }, AwsModuleKeyname);
|
|
128
|
+
throw e;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
CloudformationClient = __decorate([
|
|
134
|
+
tag("CloudformationClientInterface"),
|
|
135
|
+
moduleScoped(AwsModuleKeyname),
|
|
136
|
+
injectable(),
|
|
137
|
+
__param(0, inject("LogHandlerInterface")),
|
|
138
|
+
__param(1, inject("%pristine.aws.region%")),
|
|
139
|
+
__metadata("design:paramtypes", [Object, String])
|
|
140
|
+
], CloudformationClient);
|
|
141
|
+
export { CloudformationClient };
|
|
142
|
+
//# sourceMappingURL=cloudformation.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudformation.client.js","sourceRoot":"","sources":["../../../../src/clients/cloudformation.client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAC,YAAY,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACH,oBAAoB,IAAI,uBAAuB,EAE/C,kBAAkB,EAEQ,kBAAkB,EAC5C,qBAAqB,EAEd,kB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C,CAAC;YAC3F,MAAM,OAAO,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAA;YAC7C,IAAI;gBACA,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACzC;YAAC,OAAO,CAAC,EAAE;gBACR,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,wCAAwC,EAAE,EAAC,KAAK,EAAE,CAAC,EAAC,EAAE,gBAAgB,CAAC,CAAC;gBAC9F,MAAM,CAAC,CAAC;aACX;QACL,CAAC;KAAA;CACJ,CAAA;AAtGY,oBAAoB;IAHhC,GAAG,CAAC,+BAA+B,CAAC;IACpC,YAAY,CAAC,gBAAgB,CAAC;IAC9B,UAAU,EAAE;IAeJ,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,MAAM,CAAC,uBAAuB,CAAC,CAAA;;GAf3B,oBAAoB,CAsGhC;SAtGY,oBAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudformation-client.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/cloudformation-client.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { LogHandlerInterface } from "@pristine-ts/logging";
|
|
2
|
+
import { CloudFormationClient as AWSCloudformationClient, CloudFormationClientConfig, CreateStackCommandInput, CreateStackCommandOutput, DeleteStackCommandInput, DeleteStackCommandOutput, Stack, UpdateStackCommandInput, UpdateStackCommandOutput } from "@aws-sdk/client-cloudformation";
|
|
3
|
+
import { CloudformationClientInterface } from "../interfaces/cloudformation-client.interface";
|
|
4
|
+
/**
|
|
5
|
+
* The client to use to interact with AWS Cloudformation. It is a wrapper around the CloudformationClient of @aws-sdk/client-cloudformation.
|
|
6
|
+
* It is tagged so it can be injected using CloudformationClientInterface.
|
|
7
|
+
* AWS documentation https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudformation/
|
|
8
|
+
*/
|
|
9
|
+
export declare class CloudformationClient implements CloudformationClientInterface {
|
|
10
|
+
private readonly logHandler;
|
|
11
|
+
region: string;
|
|
12
|
+
/**
|
|
13
|
+
* The instantiated client from the @aws-sdk/client-cloudformation library.
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
private client;
|
|
17
|
+
/**
|
|
18
|
+
* The client to use to interact with AWS Cloudformation. It is a wrapper around the CloudformationClient of @aws-sdk/client-cloudformation.
|
|
19
|
+
* @param logHandler The log handler used to output logs.
|
|
20
|
+
* @param region The aws region for which the client will be used.
|
|
21
|
+
*/
|
|
22
|
+
constructor(logHandler: LogHandlerInterface, region: string);
|
|
23
|
+
/**
|
|
24
|
+
* Returns the instantiated CloudformationClient from the @aws-sdk/client-s3 cloudformation
|
|
25
|
+
*/
|
|
26
|
+
getClient(): AWSCloudformationClient;
|
|
27
|
+
/**
|
|
28
|
+
* Allows you to manually set the config if needed.
|
|
29
|
+
* @param config
|
|
30
|
+
*/
|
|
31
|
+
setClient(config: CloudFormationClientConfig): void;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the description and all its details from a Cloudformation stack.
|
|
34
|
+
* @param stackName The stack name to get the.
|
|
35
|
+
*/
|
|
36
|
+
getStackDescription(stackName: string): Promise<Stack>;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new stack in Cloudformation.
|
|
39
|
+
* @param input The input to create the new stack.
|
|
40
|
+
*/
|
|
41
|
+
createStack(input: CreateStackCommandInput): Promise<CreateStackCommandOutput>;
|
|
42
|
+
/**
|
|
43
|
+
* Updates a stack in Cloudformation.
|
|
44
|
+
* @param input The input to update the new stack.
|
|
45
|
+
*/
|
|
46
|
+
updateStack(input: UpdateStackCommandInput): Promise<UpdateStackCommandOutput>;
|
|
47
|
+
/**
|
|
48
|
+
* Deletes a stack in Cloudformation.
|
|
49
|
+
* @param input The input to delete the new stack.
|
|
50
|
+
*/
|
|
51
|
+
deleteStack(input: DeleteStackCommandInput): Promise<DeleteStackCommandOutput>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CloudFormationClient as AWSCloudformationClient } from "@aws-sdk/client-cloudformation/dist-types/CloudFormationClient";
|
|
2
|
+
import { CreateStackCommandInput, CreateStackCommandOutput, DeleteStackCommandInput, DeleteStackCommandOutput, Stack, UpdateStackCommandInput, UpdateStackCommandOutput } from "@aws-sdk/client-cloudformation";
|
|
3
|
+
import { CloudFormationClientConfig } from "@aws-sdk/client-cloudformation/dist-types/ts3.4";
|
|
4
|
+
/**
|
|
5
|
+
* The CloudformationClient Interface defines the methods that a Cloudformation client must implement.
|
|
6
|
+
* When injecting the Cloudformation client the 'CloudformationClientInterface' tag should be used.
|
|
7
|
+
*/
|
|
8
|
+
export interface CloudformationClientInterface {
|
|
9
|
+
/**
|
|
10
|
+
* Returns the instantiated CloudformationClient from the @aws-sdk/client-s3 cloudformation
|
|
11
|
+
*/
|
|
12
|
+
getClient(): AWSCloudformationClient;
|
|
13
|
+
/**
|
|
14
|
+
* Allows you to manually set the config if needed.
|
|
15
|
+
* @param config
|
|
16
|
+
*/
|
|
17
|
+
setClient(config: CloudFormationClientConfig): any;
|
|
18
|
+
/**
|
|
19
|
+
* Gets the description and all its details from a Cloudformation stack.
|
|
20
|
+
* @param stackName The stack name to get the.
|
|
21
|
+
*/
|
|
22
|
+
getStackDescription(stackName: string): Promise<Stack>;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new stack in Cloudformation.
|
|
25
|
+
* @param input The input to create the new stack.
|
|
26
|
+
*/
|
|
27
|
+
createStack(input: CreateStackCommandInput): Promise<CreateStackCommandOutput>;
|
|
28
|
+
/**
|
|
29
|
+
* Updates a stack in Cloudformation.
|
|
30
|
+
* @param input The input to update the new stack.
|
|
31
|
+
*/
|
|
32
|
+
updateStack(input: UpdateStackCommandInput): Promise<UpdateStackCommandOutput>;
|
|
33
|
+
/**
|
|
34
|
+
* Deletes a stack in Cloudformation.
|
|
35
|
+
* @param input The input to delete the new stack.
|
|
36
|
+
*/
|
|
37
|
+
deleteStack(input: DeleteStackCommandInput): Promise<DeleteStackCommandOutput>;
|
|
38
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S3PresignedOperationTypeEnum } from "../enums/s3-presigned-operation-type.enum";
|
|
2
|
-
import {
|
|
2
|
+
import { S3Client as AWSS3Client, S3ClientConfig } from "@aws-sdk/client-s3";
|
|
3
3
|
/**
|
|
4
4
|
* The S3Client Interface defines the methods that an S3 client must implement.
|
|
5
5
|
* When injecting the S3 client the 'S3ClientInterface' tag should be used.
|
|
@@ -10,11 +10,10 @@ export interface S3ClientInterface {
|
|
|
10
10
|
*/
|
|
11
11
|
getClient(): AWSS3Client;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @param
|
|
15
|
-
* @param key The key of the object.
|
|
13
|
+
* Allows you to manually set the config if needed.
|
|
14
|
+
* @param config
|
|
16
15
|
*/
|
|
17
|
-
|
|
16
|
+
setClient(config: S3ClientConfig): any;
|
|
18
17
|
/**
|
|
19
18
|
* Gets an object's body as an array buffer from S3.
|
|
20
19
|
* @param bucketName The bucket name where to get the object.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pristine-ts/aws",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.248",
|
|
4
4
|
"description": "",
|
|
5
5
|
"module": "dist/lib/esm/aws.module.js",
|
|
6
6
|
"main": "dist/lib/cjs/aws.module.js",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"author": "",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
+
"@aws-sdk/client-cloudformation": "^3.211.0",
|
|
20
21
|
"@aws-sdk/client-dynamodb": "^3.211.0",
|
|
21
22
|
"@aws-sdk/client-eventbridge": "^3.211.0",
|
|
22
23
|
"@aws-sdk/client-s3": "^3.211.0",
|
|
@@ -27,11 +28,11 @@
|
|
|
27
28
|
"@awslabs-community-fork/dynamodb-data-mapper": "^0.7.9",
|
|
28
29
|
"@awslabs-community-fork/dynamodb-data-marshaller": "^0.7.9",
|
|
29
30
|
"@awslabs-community-fork/dynamodb-expressions": "^0.7.9",
|
|
30
|
-
"@pristine-ts/common": "^0.0.
|
|
31
|
-
"@pristine-ts/core": "^0.0.
|
|
32
|
-
"@pristine-ts/logging": "^0.0.
|
|
33
|
-
"@pristine-ts/networking": "^0.0.
|
|
34
|
-
"@pristine-ts/security": "^0.0.
|
|
31
|
+
"@pristine-ts/common": "^0.0.248",
|
|
32
|
+
"@pristine-ts/core": "^0.0.248",
|
|
33
|
+
"@pristine-ts/logging": "^0.0.248",
|
|
34
|
+
"@pristine-ts/networking": "^0.0.248",
|
|
35
|
+
"@pristine-ts/security": "^0.0.248"
|
|
35
36
|
},
|
|
36
37
|
"publishConfig": {
|
|
37
38
|
"access": "public"
|
|
@@ -70,5 +71,5 @@
|
|
|
70
71
|
"src/*.{js,ts}"
|
|
71
72
|
]
|
|
72
73
|
},
|
|
73
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "4c0e3c9a1ea0f44f808fafc7a80cf030af70ebf1"
|
|
74
75
|
}
|