@studion/infra-code-blocks 2.0.0-alpha.4 → 2.0.0-alpha.5

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.
Files changed (28) hide show
  1. package/dist/components/acm-certificate/index.js +6 -1
  2. package/dist/components/cloudfront/index.d.ts.map +1 -1
  3. package/dist/components/cloudfront/index.js +93 -46
  4. package/dist/components/cloudfront/lb-cache-strategy.js +9 -1
  5. package/dist/components/cloudfront/s3-cache-strategy.js +12 -4
  6. package/dist/components/database/builder.js +34 -7
  7. package/dist/components/database/database-replica.js +27 -3
  8. package/dist/components/database/ec2-ssm-connect.d.ts +2 -1
  9. package/dist/components/database/ec2-ssm-connect.d.ts.map +1 -1
  10. package/dist/components/database/ec2-ssm-connect.js +33 -16
  11. package/dist/components/database/index.js +55 -7
  12. package/dist/components/ecs-service/index.js +70 -28
  13. package/dist/components/grafana/dashboards/panels.js +23 -17
  14. package/dist/components/grafana/dashboards/web-server-slo.js +4 -1
  15. package/dist/components/password/index.js +7 -1
  16. package/dist/components/prometheus/queries.test.js +10 -19
  17. package/dist/components/redis/elasticache-redis.js +6 -1
  18. package/dist/components/redis/upstash-redis.js +8 -2
  19. package/dist/components/static-site/index.js +7 -1
  20. package/dist/components/static-site/s3-assets.js +4 -1
  21. package/dist/components/vpc/index.js +2 -1
  22. package/dist/components/web-server/builder.js +32 -6
  23. package/dist/components/web-server/index.js +46 -14
  24. package/dist/components/web-server/load-balancer.js +13 -3
  25. package/dist/otel/builder.js +4 -1
  26. package/dist/otel/config.js +11 -14
  27. package/dist/otel/index.js +7 -3
  28. package/package.json +34 -47
@@ -3,15 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OtelCollectorConfigBuilder = void 0;
4
4
  const otlp_receiver_1 = require("./otlp-receiver");
5
5
  class OtelCollectorConfigBuilder {
6
- constructor() {
7
- this._receivers = {};
8
- this._processors = {};
9
- this._exporters = {};
10
- this._extensions = {};
11
- this._service = {
12
- pipelines: {},
13
- };
14
- }
6
+ _receivers = {};
7
+ _processors = {};
8
+ _exporters = {};
9
+ _extensions = {};
10
+ _service = {
11
+ pipelines: {},
12
+ };
15
13
  withOTLPReceiver(protocols = ['http']) {
16
14
  if (!protocols.length) {
17
15
  throw new Error('At least one OTLP receiver protocol should be provided');
@@ -21,7 +19,7 @@ class OtelCollectorConfigBuilder {
21
19
  if (!protocolConfig) {
22
20
  throw new Error(`OTLP receiver protocol ${current} is not supported`);
23
21
  }
24
- return Object.assign(Object.assign({}, all), { [current]: protocolConfig });
22
+ return { ...all, [current]: protocolConfig };
25
23
  }, {});
26
24
  this._receivers.otlp = { protocols: protocolsConfig };
27
25
  return this;
@@ -159,18 +157,17 @@ class OtelCollectorConfigBuilder {
159
157
  }
160
158
  }
161
159
  validatePipelineComponents(pipelineType) {
162
- var _a, _b, _c;
163
- (_a = this._service.pipelines[pipelineType]) === null || _a === void 0 ? void 0 : _a.receivers.forEach(receiver => {
160
+ this._service.pipelines[pipelineType]?.receivers.forEach(receiver => {
164
161
  if (!this._receivers[receiver]) {
165
162
  throw new Error(`Receiver '${receiver}' is used in ${pipelineType} pipeline but not defined`);
166
163
  }
167
164
  });
168
- (_b = this._service.pipelines[pipelineType]) === null || _b === void 0 ? void 0 : _b.processors.forEach(processor => {
165
+ this._service.pipelines[pipelineType]?.processors.forEach(processor => {
169
166
  if (!this._processors[processor]) {
170
167
  throw new Error(`Processor '${processor}' is used in ${pipelineType} pipeline but not defined`);
171
168
  }
172
169
  });
173
- (_c = this._service.pipelines[pipelineType]) === null || _c === void 0 ? void 0 : _c.exporters.forEach(exporter => {
170
+ this._service.pipelines[pipelineType]?.exporters.forEach(exporter => {
174
171
  if (!this._exporters[exporter]) {
175
172
  throw new Error(`Exporter '${exporter}' is used in ${pipelineType} pipeline but not defined`);
176
173
  }
@@ -4,6 +4,11 @@ exports.OtelCollector = void 0;
4
4
  const pulumi = require("@pulumi/pulumi");
5
5
  const yaml = require("yaml");
6
6
  class OtelCollector {
7
+ config;
8
+ configVolume;
9
+ container;
10
+ configContainer;
11
+ taskRoleInlinePolicies;
7
12
  constructor(serviceName, env, config, opts = {}) {
8
13
  const containerName = opts.containerName || pulumi.interpolate `${serviceName}-otel-collector`;
9
14
  const configVolumeName = opts.configVolumeName || 'otel-collector-config-volume';
@@ -45,9 +50,8 @@ class OtelCollector {
45
50
  ];
46
51
  }
47
52
  getCollectorPortMappings(config) {
48
- var _a, _b;
49
- const hasOTLPGRpcReceiver = !!((_a = config.receivers.otlp) === null || _a === void 0 ? void 0 : _a.protocols.grpc);
50
- const hasOTLPHttpReceiver = !!((_b = config.receivers.otlp) === null || _b === void 0 ? void 0 : _b.protocols.http);
53
+ const hasOTLPGRpcReceiver = !!config.receivers.otlp?.protocols.grpc;
54
+ const hasOTLPHttpReceiver = !!config.receivers.otlp?.protocols.http;
51
55
  const protocol = 'tcp';
52
56
  return [
53
57
  ...(hasOTLPGRpcReceiver
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studion/infra-code-blocks",
3
- "version": "2.0.0-alpha.4",
3
+ "version": "2.0.0-alpha.5",
4
4
  "description": "Studion common infra components",
5
5
  "keywords": [
6
6
  "infrastructure",
@@ -35,63 +35,50 @@
35
35
  },
36
36
  "prettier": "@studion/prettier-config",
37
37
  "dependencies": {
38
- "@pulumi/aws": "^7.15.0",
39
- "@pulumi/aws-native": "^1.38.0",
40
- "@pulumi/awsx": "^3.1.0",
41
- "@pulumi/pulumi": "^3.146.0",
42
- "@pulumi/random": "^4.17.0",
43
- "@pulumiverse/grafana": "^0.16.3",
38
+ "@pulumi/aws": "^7.21.0",
39
+ "@pulumi/aws-native": "^1.56.0",
40
+ "@pulumi/awsx": "^3.2.1",
41
+ "@pulumi/pulumi": "^3.225.0",
42
+ "@pulumi/random": "^4.19.1",
43
+ "@pulumiverse/grafana": "^2.21.0",
44
44
  "@upstash/pulumi": "^0.5.0",
45
- "yaml": "^2.7.1"
45
+ "yaml": "^2.8.2"
46
46
  },
47
47
  "devDependencies": {
48
- "@aws-sdk/client-acm": "^3.973.5",
49
- "@aws-sdk/client-application-auto-scaling": "^3.973.5",
50
- "@aws-sdk/client-cloudfront": "^3.973.5",
51
- "@aws-sdk/client-cloudwatch-logs": "^3.973.5",
52
- "@aws-sdk/client-ec2": "^3.973.5",
53
- "@aws-sdk/client-ecs": "^3.973.5",
54
- "@aws-sdk/client-efs": "^3.973.5",
55
- "@aws-sdk/client-elastic-load-balancing-v2": "^3.764.5",
56
- "@aws-sdk/client-elasticache": "^3.901.5",
57
- "@aws-sdk/client-iam": "^3.973.5",
58
- "@aws-sdk/client-kms": "^3.973.5",
59
- "@aws-sdk/client-rds": "^3.973.5",
60
- "@aws-sdk/client-route-53": "^3.973.5",
61
- "@aws-sdk/client-s3": "^3.982.0",
62
- "@aws-sdk/client-secrets-manager": "^3.973.5",
63
- "@aws-sdk/client-servicediscovery": "^3.973.5",
64
- "@aws-sdk/client-ssm": "^3.986.0",
65
- "@aws-sdk/client-xray": "^3.989.0",
48
+ "@aws-sdk/client-acm": "^3.1002.0",
49
+ "@aws-sdk/client-application-auto-scaling": "^3.1002.0",
50
+ "@aws-sdk/client-cloudfront": "^3.1002.0",
51
+ "@aws-sdk/client-cloudwatch-logs": "^3.1002.0",
52
+ "@aws-sdk/client-ec2": "^3.1002.0",
53
+ "@aws-sdk/client-ecs": "^3.1002.0",
54
+ "@aws-sdk/client-efs": "^3.1002.0",
55
+ "@aws-sdk/client-elastic-load-balancing-v2": "^3.1002.0",
56
+ "@aws-sdk/client-elasticache": "^3.1002.0",
57
+ "@aws-sdk/client-iam": "^3.1002.0",
58
+ "@aws-sdk/client-kms": "^3.1002.0",
59
+ "@aws-sdk/client-rds": "^3.1002.0",
60
+ "@aws-sdk/client-route-53": "^3.1002.0",
61
+ "@aws-sdk/client-s3": "^3.1002.0",
62
+ "@aws-sdk/client-secrets-manager": "^3.1002.0",
63
+ "@aws-sdk/client-servicediscovery": "^3.1002.0",
64
+ "@aws-sdk/client-ssm": "^3.1002.0",
65
+ "@aws-sdk/client-xray": "^3.1002.0",
66
66
  "@studion/prettier-config": "^0.1.0",
67
- "@types/node": "^22",
68
- "exponential-backoff": "^3.1.2",
67
+ "@types/node": "^25",
68
+ "exponential-backoff": "^3.1.3",
69
69
  "http-status": "^2.1.0",
70
70
  "husky": "^9.1.7",
71
- "ioredis": "^5.8.1",
72
- "lint-staged": "^16.1.2",
71
+ "ioredis": "^5.10.0",
72
+ "lint-staged": "^16.3.2",
73
73
  "mime": "^4.1.0",
74
74
  "nanospinner": "^1.2.2",
75
75
  "pathe": "^2.0.3",
76
- "prettier": "^3.4.2",
76
+ "prettier": "^3.8.1",
77
77
  "release-it": "^19.2.4",
78
- "tstyche": "^4.0.0-beta.9",
78
+ "tstyche": "^6.2.0",
79
79
  "tsx": "^4.21.0",
80
- "typescript": "^5.7.3",
81
- "undici": "^6.21.2"
82
- },
83
- "overrides": {
84
- "@pulumi/pulumi": {
85
- "glob": "10.5.0",
86
- "minimatch": "10.2.4",
87
- "tar": "7.5.9"
88
- },
89
- "@aws-sdk/core": {
90
- "fast-xml-parser": "5.3.6"
91
- },
92
- "get-uri": {
93
- "basic-ftp": "5.2.0"
94
- }
80
+ "typescript": "^5.9.3",
81
+ "undici": "^7.22.0"
95
82
  },
96
83
  "publishConfig": {
97
84
  "access": "public"