@ttoss/cloudformation 0.12.13 → 0.13.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 +36 -0
- package/dist/esm/index.js +10 -10
- package/dist/index.js +10 -10
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -62,6 +62,42 @@ const template = createApiTemplate({
|
|
|
62
62
|
});
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
+
When a producing stack exports a value and a consuming stack imports it with
|
|
66
|
+
`Fn::ImportValue`, CloudFormation protects that dependency by blocking deletion
|
|
67
|
+
of the producer export until imports are removed.
|
|
68
|
+
|
|
69
|
+
Producer stack output example:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
const outputs = {
|
|
73
|
+
LambdaPostgresReadQueryFunctionArn: {
|
|
74
|
+
Value: { 'Fn::GetAtt': ['LambdaPostgresReadQueryFunction', 'Arn'] },
|
|
75
|
+
Export: {
|
|
76
|
+
Name: {
|
|
77
|
+
'Fn::Sub': '${AWS::StackName}-LambdaPostgresReadQueryFunctionArn',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Consumer stack usage with parameterized export name:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import { importValueFromParameter } from '@ttoss/cloudformation';
|
|
88
|
+
|
|
89
|
+
const resources = {
|
|
90
|
+
InvokePermission: {
|
|
91
|
+
Type: 'AWS::Lambda::Permission',
|
|
92
|
+
Properties: {
|
|
93
|
+
FunctionName: importValueFromParameter('ReadQueryFunctionArnExportName'),
|
|
94
|
+
Action: 'lambda:InvokeFunction',
|
|
95
|
+
Principal: 'apigateway.amazonaws.com',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
```
|
|
100
|
+
|
|
65
101
|
## Reading Templates
|
|
66
102
|
|
|
67
103
|
### `findAndReadCloudFormationTemplate`
|
package/dist/esm/index.js
CHANGED
|
@@ -5,9 +5,19 @@ var __name = (target, value) => __defProp(target, "name", {
|
|
|
5
5
|
configurable: true
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
+
// src/CloudFormationTemplate.ts
|
|
9
|
+
var importValueFromParameter = /* @__PURE__ */__name(parameterName => {
|
|
10
|
+
return {
|
|
11
|
+
"Fn::ImportValue": {
|
|
12
|
+
"Fn::Sub": `\${${parameterName}}`
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}, "importValueFromParameter");
|
|
16
|
+
|
|
8
17
|
// src/findAndReadCloudFormationTemplate.ts
|
|
9
18
|
import * as fs2 from "fs";
|
|
10
19
|
import * as path2 from "path";
|
|
20
|
+
import { readConfigFile } from "@ttoss/read-config-file";
|
|
11
21
|
|
|
12
22
|
// src/readCloudFormationYamlTemplate.ts
|
|
13
23
|
import * as fs from "fs";
|
|
@@ -167,7 +177,6 @@ var readCloudFormationYamlTemplate = /* @__PURE__ */__name(({
|
|
|
167
177
|
}, "readCloudFormationYamlTemplate");
|
|
168
178
|
|
|
169
179
|
// src/findAndReadCloudFormationTemplate.ts
|
|
170
|
-
import { readConfigFile } from "@ttoss/read-config-file";
|
|
171
180
|
var defaultTemplatePaths = ["ts", "js", "yaml", "yml", "json"].map(extension => {
|
|
172
181
|
return `./src/cloudformation.${extension}`;
|
|
173
182
|
});
|
|
@@ -196,13 +205,4 @@ var findAndReadCloudFormationTemplate = /* @__PURE__ */__name(async ({
|
|
|
196
205
|
options
|
|
197
206
|
});
|
|
198
207
|
}, "findAndReadCloudFormationTemplate");
|
|
199
|
-
|
|
200
|
-
// src/CloudFormationTemplate.ts
|
|
201
|
-
var importValueFromParameter = /* @__PURE__ */__name(parameterName => {
|
|
202
|
-
return {
|
|
203
|
-
"Fn::ImportValue": {
|
|
204
|
-
"Fn::Sub": `\${${parameterName}}`
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
}, "importValueFromParameter");
|
|
208
208
|
export { findAndReadCloudFormationTemplate, importValueFromParameter };
|
package/dist/index.js
CHANGED
|
@@ -47,9 +47,19 @@ __export(index_exports, {
|
|
|
47
47
|
});
|
|
48
48
|
module.exports = __toCommonJS(index_exports);
|
|
49
49
|
|
|
50
|
+
// src/CloudFormationTemplate.ts
|
|
51
|
+
var importValueFromParameter = /* @__PURE__ */__name(parameterName => {
|
|
52
|
+
return {
|
|
53
|
+
"Fn::ImportValue": {
|
|
54
|
+
"Fn::Sub": `\${${parameterName}}`
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}, "importValueFromParameter");
|
|
58
|
+
|
|
50
59
|
// src/findAndReadCloudFormationTemplate.ts
|
|
51
60
|
var fs2 = __toESM(require("fs"), 1);
|
|
52
61
|
var path2 = __toESM(require("path"), 1);
|
|
62
|
+
var import_read_config_file = require("@ttoss/read-config-file");
|
|
53
63
|
|
|
54
64
|
// src/readCloudFormationYamlTemplate.ts
|
|
55
65
|
var fs = __toESM(require("fs"), 1);
|
|
@@ -209,7 +219,6 @@ var readCloudFormationYamlTemplate = /* @__PURE__ */__name(({
|
|
|
209
219
|
}, "readCloudFormationYamlTemplate");
|
|
210
220
|
|
|
211
221
|
// src/findAndReadCloudFormationTemplate.ts
|
|
212
|
-
var import_read_config_file = require("@ttoss/read-config-file");
|
|
213
222
|
var defaultTemplatePaths = ["ts", "js", "yaml", "yml", "json"].map(extension => {
|
|
214
223
|
return `./src/cloudformation.${extension}`;
|
|
215
224
|
});
|
|
@@ -238,15 +247,6 @@ var findAndReadCloudFormationTemplate = /* @__PURE__ */__name(async ({
|
|
|
238
247
|
options
|
|
239
248
|
});
|
|
240
249
|
}, "findAndReadCloudFormationTemplate");
|
|
241
|
-
|
|
242
|
-
// src/CloudFormationTemplate.ts
|
|
243
|
-
var importValueFromParameter = /* @__PURE__ */__name(parameterName => {
|
|
244
|
-
return {
|
|
245
|
-
"Fn::ImportValue": {
|
|
246
|
-
"Fn::Sub": `\${${parameterName}}`
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
}, "importValueFromParameter");
|
|
250
250
|
// Annotate the CommonJS export names for ESM import in node:
|
|
251
251
|
0 && (module.exports = {
|
|
252
252
|
findAndReadCloudFormationTemplate,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/cloudformation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "CloudFormation utils.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"@types/node": "^24.12.0",
|
|
34
34
|
"jest": "^30.3.0",
|
|
35
35
|
"tsup": "^8.5.1",
|
|
36
|
-
"@ttoss/
|
|
37
|
-
"@ttoss/
|
|
36
|
+
"@ttoss/test-utils": "^4.2.11",
|
|
37
|
+
"@ttoss/config": "^1.37.11"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public",
|