@studion/infra-code-blocks 0.8.0-next.2 → 2.0.0-alpha.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.
Files changed (183) hide show
  1. package/dist/components/acm-certificate/index.d.ts +20 -0
  2. package/dist/components/acm-certificate/index.d.ts.map +1 -0
  3. package/dist/components/acm-certificate/index.js +40 -0
  4. package/dist/components/cloudfront/index.d.ts +92 -0
  5. package/dist/components/cloudfront/index.d.ts.map +1 -0
  6. package/dist/components/cloudfront/index.js +208 -0
  7. package/dist/components/cloudfront/lb-cache-strategy.d.ts +21 -0
  8. package/dist/components/cloudfront/lb-cache-strategy.d.ts.map +1 -0
  9. package/dist/components/cloudfront/lb-cache-strategy.js +93 -0
  10. package/dist/components/cloudfront/s3-cache-strategy.d.ts +21 -0
  11. package/dist/components/cloudfront/s3-cache-strategy.d.ts.map +1 -0
  12. package/dist/components/cloudfront/s3-cache-strategy.js +78 -0
  13. package/dist/components/cloudfront/types.d.ts +10 -0
  14. package/dist/components/cloudfront/types.d.ts.map +1 -0
  15. package/dist/components/database/builder.d.ts +32 -0
  16. package/dist/components/database/builder.d.ts.map +1 -0
  17. package/dist/components/database/builder.js +82 -0
  18. package/dist/components/database/database-replica.d.ts +35 -0
  19. package/dist/components/database/database-replica.d.ts.map +1 -0
  20. package/dist/components/database/database-replica.js +40 -0
  21. package/dist/components/database/ec2-ssm-connect.d.ts +26 -0
  22. package/dist/components/database/ec2-ssm-connect.d.ts.map +1 -0
  23. package/dist/components/{ec2-ssm-connect.js → database/ec2-ssm-connect.js} +42 -34
  24. package/dist/components/database/index.d.ts +67 -0
  25. package/dist/components/database/index.d.ts.map +1 -0
  26. package/dist/components/database/index.js +144 -0
  27. package/dist/{v2/components → components}/ecs-service/index.d.ts +6 -5
  28. package/dist/components/ecs-service/index.d.ts.map +1 -0
  29. package/dist/{v2/components → components}/ecs-service/index.js +19 -30
  30. package/dist/components/ecs-service/policies.d.ts +3 -0
  31. package/dist/components/ecs-service/policies.d.ts.map +1 -0
  32. package/dist/components/ecs-service/task-size.d.ts +37 -0
  33. package/dist/components/ecs-service/task-size.d.ts.map +1 -0
  34. package/dist/{constants.js → components/ecs-service/task-size.js} +17 -7
  35. package/dist/components/grafana/dashboards/index.d.ts.map +1 -0
  36. package/dist/components/grafana/dashboards/panels.d.ts.map +1 -0
  37. package/dist/components/grafana/dashboards/types.d.ts.map +1 -0
  38. package/dist/components/grafana/dashboards/web-server-slo.d.ts.map +1 -0
  39. package/dist/components/grafana/index.d.ts.map +1 -0
  40. package/dist/components/password/index.d.ts +15 -0
  41. package/dist/components/password/index.d.ts.map +1 -0
  42. package/dist/components/{password.js → password/index.js} +6 -9
  43. package/dist/components/prometheus/index.d.ts.map +1 -0
  44. package/dist/components/prometheus/queries.d.ts.map +1 -0
  45. package/dist/components/prometheus/queries.test.d.ts.map +1 -0
  46. package/dist/components/redis/elasticache-redis.d.ts +38 -0
  47. package/dist/components/redis/elasticache-redis.d.ts.map +1 -0
  48. package/dist/components/redis/elasticache-redis.js +58 -0
  49. package/dist/components/redis/upstash-redis.d.ts +20 -0
  50. package/dist/components/redis/upstash-redis.d.ts.map +1 -0
  51. package/dist/components/redis/upstash-redis.js +29 -0
  52. package/dist/components/static-site/index.d.ts +23 -0
  53. package/dist/components/static-site/index.d.ts.map +1 -0
  54. package/dist/components/static-site/index.js +32 -0
  55. package/dist/components/static-site/s3-assets.d.ts +20 -0
  56. package/dist/components/static-site/s3-assets.d.ts.map +1 -0
  57. package/dist/components/static-site/s3-assets.js +63 -0
  58. package/dist/components/vpc/index.d.ts +20 -0
  59. package/dist/components/vpc/index.d.ts.map +1 -0
  60. package/dist/components/vpc/index.js +31 -0
  61. package/dist/{v2/components → components}/web-server/builder.d.ts +6 -2
  62. package/dist/components/web-server/builder.d.ts.map +1 -0
  63. package/dist/{v2/components → components}/web-server/builder.js +11 -1
  64. package/dist/{v2/components → components}/web-server/index.d.ts +30 -8
  65. package/dist/components/web-server/index.d.ts.map +1 -0
  66. package/dist/{v2/components → components}/web-server/index.js +49 -40
  67. package/dist/{v2/components → components}/web-server/load-balancer.d.ts +4 -3
  68. package/dist/components/web-server/load-balancer.d.ts.map +1 -0
  69. package/dist/{v2/components → components}/web-server/load-balancer.js +17 -14
  70. package/dist/index.d.ts +24 -11
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +38 -26
  73. package/dist/otel/batch-processor.d.ts.map +1 -0
  74. package/dist/{v2/otel → otel}/builder.d.ts +15 -2
  75. package/dist/otel/builder.d.ts.map +1 -0
  76. package/dist/{v2/otel → otel}/builder.js +47 -2
  77. package/dist/{v2/otel → otel}/config.d.ts +13 -1
  78. package/dist/otel/config.d.ts.map +1 -0
  79. package/dist/{v2/otel → otel}/config.js +20 -3
  80. package/dist/{v2/otel → otel}/index.d.ts +8 -0
  81. package/dist/otel/index.d.ts.map +1 -0
  82. package/dist/otel/memory-limiter-processor.d.ts.map +1 -0
  83. package/dist/otel/otlp-receiver.d.ts.map +1 -0
  84. package/dist/otel/prometheus-remote-write-exporter.d.ts.map +1 -0
  85. package/dist/shared/common-tags.d.ts +5 -0
  86. package/dist/shared/common-tags.d.ts.map +1 -0
  87. package/dist/shared/common-tags.js +8 -0
  88. package/dist/shared/merge-with-defaults.d.ts +2 -0
  89. package/dist/shared/merge-with-defaults.d.ts.map +1 -0
  90. package/dist/shared/merge-with-defaults.js +7 -0
  91. package/package.json +32 -14
  92. package/dist/components/acm-certificate.d.ts +0 -11
  93. package/dist/components/acm-certificate.d.ts.map +0 -1
  94. package/dist/components/acm-certificate.js +0 -30
  95. package/dist/components/database-replica.d.ts +0 -69
  96. package/dist/components/database-replica.d.ts.map +0 -1
  97. package/dist/components/database-replica.js +0 -40
  98. package/dist/components/database.d.ts +0 -99
  99. package/dist/components/database.d.ts.map +0 -1
  100. package/dist/components/database.js +0 -118
  101. package/dist/components/ec2-ssm-connect.d.ts +0 -22
  102. package/dist/components/ec2-ssm-connect.d.ts.map +0 -1
  103. package/dist/components/ecs-service.d.ts +0 -143
  104. package/dist/components/ecs-service.d.ts.map +0 -1
  105. package/dist/components/ecs-service.js +0 -357
  106. package/dist/components/mongo.d.ts +0 -39
  107. package/dist/components/mongo.d.ts.map +0 -1
  108. package/dist/components/mongo.js +0 -54
  109. package/dist/components/nuxt-ssr.d.ts +0 -44
  110. package/dist/components/nuxt-ssr.d.ts.map +0 -1
  111. package/dist/components/nuxt-ssr.js +0 -277
  112. package/dist/components/password.d.ts +0 -13
  113. package/dist/components/password.d.ts.map +0 -1
  114. package/dist/components/project.d.ts +0 -77
  115. package/dist/components/project.d.ts.map +0 -1
  116. package/dist/components/project.js +0 -171
  117. package/dist/components/redis.d.ts +0 -23
  118. package/dist/components/redis.d.ts.map +0 -1
  119. package/dist/components/redis.js +0 -35
  120. package/dist/components/static-site.d.ts +0 -36
  121. package/dist/components/static-site.d.ts.map +0 -1
  122. package/dist/components/static-site.js +0 -138
  123. package/dist/components/web-server.d.ts +0 -38
  124. package/dist/components/web-server.d.ts.map +0 -1
  125. package/dist/components/web-server.js +0 -185
  126. package/dist/constants.d.ts +0 -23
  127. package/dist/constants.d.ts.map +0 -1
  128. package/dist/types/pulumi.d.ts +0 -5
  129. package/dist/types/pulumi.d.ts.map +0 -1
  130. package/dist/types/size.d.ts +0 -8
  131. package/dist/types/size.d.ts.map +0 -1
  132. package/dist/types/size.js +0 -2
  133. package/dist/v2/components/ecs-service/index.d.ts.map +0 -1
  134. package/dist/v2/components/ecs-service/policies.d.ts +0 -3
  135. package/dist/v2/components/ecs-service/policies.d.ts.map +0 -1
  136. package/dist/v2/components/grafana/dashboards/index.d.ts.map +0 -1
  137. package/dist/v2/components/grafana/dashboards/panels.d.ts.map +0 -1
  138. package/dist/v2/components/grafana/dashboards/types.d.ts.map +0 -1
  139. package/dist/v2/components/grafana/dashboards/web-server-slo.d.ts.map +0 -1
  140. package/dist/v2/components/grafana/index.d.ts.map +0 -1
  141. package/dist/v2/components/prometheus/index.d.ts.map +0 -1
  142. package/dist/v2/components/prometheus/queries.d.ts.map +0 -1
  143. package/dist/v2/components/prometheus/queries.test.d.ts.map +0 -1
  144. package/dist/v2/components/web-server/builder.d.ts.map +0 -1
  145. package/dist/v2/components/web-server/index.d.ts.map +0 -1
  146. package/dist/v2/components/web-server/load-balancer.d.ts.map +0 -1
  147. package/dist/v2/index.d.ts +0 -13
  148. package/dist/v2/index.d.ts.map +0 -1
  149. package/dist/v2/index.js +0 -16
  150. package/dist/v2/otel/batch-processor.d.ts.map +0 -1
  151. package/dist/v2/otel/builder.d.ts.map +0 -1
  152. package/dist/v2/otel/config.d.ts.map +0 -1
  153. package/dist/v2/otel/index.d.ts.map +0 -1
  154. package/dist/v2/otel/memory-limiter-processor.d.ts.map +0 -1
  155. package/dist/v2/otel/otlp-receiver.d.ts.map +0 -1
  156. package/dist/v2/otel/prometheus-remote-write-exporter.d.ts.map +0 -1
  157. /package/dist/{v2/components/grafana/dashboards → components/cloudfront}/types.js +0 -0
  158. /package/dist/{v2/components → components}/ecs-service/policies.js +0 -0
  159. /package/dist/{v2/components → components}/grafana/dashboards/index.d.ts +0 -0
  160. /package/dist/{v2/components → components}/grafana/dashboards/index.js +0 -0
  161. /package/dist/{v2/components → components}/grafana/dashboards/panels.d.ts +0 -0
  162. /package/dist/{v2/components → components}/grafana/dashboards/panels.js +0 -0
  163. /package/dist/{v2/components → components}/grafana/dashboards/types.d.ts +0 -0
  164. /package/dist/{types/pulumi.js → components/grafana/dashboards/types.js} +0 -0
  165. /package/dist/{v2/components → components}/grafana/dashboards/web-server-slo.d.ts +0 -0
  166. /package/dist/{v2/components → components}/grafana/dashboards/web-server-slo.js +0 -0
  167. /package/dist/{v2/components → components}/grafana/index.d.ts +0 -0
  168. /package/dist/{v2/components → components}/grafana/index.js +0 -0
  169. /package/dist/{v2/components → components}/prometheus/index.d.ts +0 -0
  170. /package/dist/{v2/components → components}/prometheus/index.js +0 -0
  171. /package/dist/{v2/components → components}/prometheus/queries.d.ts +0 -0
  172. /package/dist/{v2/components → components}/prometheus/queries.js +0 -0
  173. /package/dist/{v2/components → components}/prometheus/queries.test.d.ts +0 -0
  174. /package/dist/{v2/components → components}/prometheus/queries.test.js +0 -0
  175. /package/dist/{v2/otel → otel}/batch-processor.d.ts +0 -0
  176. /package/dist/{v2/otel → otel}/batch-processor.js +0 -0
  177. /package/dist/{v2/otel → otel}/index.js +0 -0
  178. /package/dist/{v2/otel → otel}/memory-limiter-processor.d.ts +0 -0
  179. /package/dist/{v2/otel → otel}/memory-limiter-processor.js +0 -0
  180. /package/dist/{v2/otel → otel}/otlp-receiver.d.ts +0 -0
  181. /package/dist/{v2/otel → otel}/otlp-receiver.js +0 -0
  182. /package/dist/{v2/otel → otel}/prometheus-remote-write-exporter.d.ts +0 -0
  183. /package/dist/{v2/otel → otel}/prometheus-remote-write-exporter.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/otel/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AAGtC,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AAGlC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF,yBAAiB,oBAAoB,CAAC;IACpC,KAAY,eAAe,GAAG;QAC5B,mBAAmB,EAAE,6BAA6B,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACvE,mBAAmB,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC;QACvC,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,aAAa,CAAC,+BAA+B,CAAC,gBAAgB,CAAC,CAAC;QAC9E,aAAa,EAAE,aAAa,CAAC,+BAA+B,CAAC,iBAAiB,CAAC,CAAC;KACjF,CAAC;CACH;AAED,qBAAa,o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GAAG,MAAM,GAAG,OAAiB,EAC9C,gBAAgB,GAAE,OAAO,GAAG,QAAQ,GAAG,UAAoB,GAC1D,IAAI;IAMP,mBAAmB,CACjB,SAAS,EAAE,aAAa,CAAC,YAAY,EAAE,EACvC,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE,EACzC,SAAS,EAAE,aAAa,CAAC,YAAY,EAAE,GACtC,IAAI;IAMP,kBAAkB,CAChB,SAAS,EAAE,aAAa,CAAC,YAAY,EAAE,EACvC,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE,EACzC,SAAS,EAAE,aAAa,CAAC,YAAY,EAAE,GACtC,IAAI;IAMP,gBAAgB,CACd,SAAS,EAAE,aAAa,CAAC,YAAY,EAAE,EACvC,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE,EACzC,SAAS,EAAE,aAAa,CAAC,YAAY,EAAE,GACtC,IAAI;IAMP,WAAW,CAAC,EACV,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,EACN,YAAY,EACZ,aAAa,GACd,EAAE,oBAAoB,CAAC,eAAe,GAAG,IAAI;IAe9C,KAAK,IAAI,aAAa;IAStB,OAAO,CAAC,qBAAqB;IAoB7B,OAAO,CAAC,mBAAmB;IAyB3B,OAAO,CAAC,0BAA0B;CA8BnC"}
@@ -30,6 +30,11 @@ class OtelCollectorBuilder {
30
30
  this.createAWSXRayPolicy();
31
31
  return this;
32
32
  }
33
+ withCloudWatchLogsExporter(region, logGroupName, logStreamName, logRetention) {
34
+ this._configBuilder.withCloudWatchLogsExporter(region, logGroupName, logStreamName, logRetention);
35
+ this.createCloudWatchLogsPolicy(logGroupName);
36
+ return this;
37
+ }
33
38
  withHealthCheckExtension(endpoint = '0.0.0.0:13133') {
34
39
  this._configBuilder.withHealthCheckExtension(endpoint);
35
40
  return this;
@@ -59,10 +64,21 @@ class OtelCollectorBuilder {
59
64
  this._configBuilder.withTracesPipeline(receivers, processors, exporters);
60
65
  return this;
61
66
  }
62
- withDefault(prometheusNamespace, prometheusWorkspace, awsRegion) {
63
- this._configBuilder.withDefault(pulumi.output(prometheusNamespace), pulumi.interpolate `${prometheusWorkspace.prometheusEndpoint}api/v1/remote_write`, awsRegion);
67
+ withLogsPipeline(receivers, processors, exporters) {
68
+ this._configBuilder.withLogsPipeline(receivers, processors, exporters);
69
+ return this;
70
+ }
71
+ withDefault({ prometheusNamespace, prometheusWorkspace, region, logGroupName, logStreamName, }) {
72
+ this._configBuilder.withDefault({
73
+ prometheusNamespace,
74
+ prometheusEndpoint: pulumi.interpolate `${prometheusWorkspace.prometheusEndpoint}api/v1/remote_write`,
75
+ region,
76
+ logGroupName,
77
+ logStreamName,
78
+ });
64
79
  this.createAPSInlinePolicy(prometheusWorkspace);
65
80
  this.createAWSXRayPolicy();
81
+ this.createCloudWatchLogsPolicy(logGroupName);
66
82
  return this;
67
83
  }
68
84
  build() {
@@ -108,5 +124,34 @@ class OtelCollectorBuilder {
108
124
  }));
109
125
  this._taskRoleInlinePolicies.push(policy);
110
126
  }
127
+ createCloudWatchLogsPolicy(logGroupName) {
128
+ const policy = pulumi
129
+ .all([this._serviceName, logGroupName])
130
+ .apply(([serviceName, logGroupName]) => {
131
+ return {
132
+ name: `${serviceName}-task-role-cloudwatch-logs`,
133
+ policy: JSON.stringify({
134
+ Version: '2012-10-17',
135
+ Statement: [
136
+ {
137
+ Effect: 'Allow',
138
+ Action: ['logs:CreateLogGroup', 'logs:PutRetentionPolicy'],
139
+ Resource: '*',
140
+ },
141
+ {
142
+ Effect: 'Allow',
143
+ Action: [
144
+ 'logs:CreateLogStream',
145
+ 'logs:DescribeLogStreams',
146
+ 'logs:PutLogEvents',
147
+ ],
148
+ Resource: `arn:aws:logs:*:*:log-group:${logGroupName}:*`,
149
+ },
150
+ ],
151
+ }),
152
+ };
153
+ });
154
+ this._taskRoleInlinePolicies.push(policy);
155
+ }
111
156
  }
112
157
  exports.OtelCollectorBuilder = OtelCollectorBuilder;
@@ -1,6 +1,16 @@
1
1
  import * as pulumi from '@pulumi/pulumi';
2
2
  import { OTLPReceiver } from './otlp-receiver';
3
3
  import type { OtelCollector } from '.';
4
+ import type { PrometheusRemoteWriteExporter } from './prometheus-remote-write-exporter';
5
+ export declare namespace OtelCollectorConfigBuilder {
6
+ type WithDefaultArgs = {
7
+ prometheusNamespace: PrometheusRemoteWriteExporter.Config['namespace'];
8
+ prometheusEndpoint: PrometheusRemoteWriteExporter.Config['endpoint'];
9
+ region: string;
10
+ logGroupName: OtelCollector.AwsCloudWatchLogsExporterConfig['log_group_name'];
11
+ logStreamName: OtelCollector.AwsCloudWatchLogsExporterConfig['log_stream_name'];
12
+ };
13
+ }
4
14
  export declare class OtelCollectorConfigBuilder {
5
15
  private readonly _receivers;
6
16
  private readonly _processors;
@@ -11,6 +21,7 @@ export declare class OtelCollectorConfigBuilder {
11
21
  withBatchProcessor(name?: string, size?: number, maxSize?: number, timeout?: string): this;
12
22
  withMemoryLimiterProcessor(checkInterval?: string, limitPercentage?: number, spikeLimitPercentage?: number): this;
13
23
  withAWSXRayExporter(region: string): this;
24
+ withCloudWatchLogsExporter(region: OtelCollector.AwsCloudWatchLogsExporterConfig['region'], logGroupName: OtelCollector.AwsCloudWatchLogsExporterConfig['log_group_name'], logStreamName: OtelCollector.AwsCloudWatchLogsExporterConfig['log_stream_name'], logRetention?: OtelCollector.AwsCloudWatchLogsExporterConfig['log_retention']): this;
14
25
  withHealthCheckExtension(endpoint?: string): this;
15
26
  withPprofExtension(endpoint?: string): this;
16
27
  withAPS(namespace: pulumi.Input<string>, endpoint: pulumi.Input<string>, region: string): this;
@@ -18,7 +29,8 @@ export declare class OtelCollectorConfigBuilder {
18
29
  withTelemetry(logLevel?: 'debug' | 'warn' | 'error', metricsVerbosity?: 'basic' | 'normal' | 'detailed'): this;
19
30
  withMetricsPipeline(receivers: OtelCollector.ReceiverType[], processors: OtelCollector.ProcessorType[], exporters: OtelCollector.ExporterType[]): this;
20
31
  withTracesPipeline(receivers: OtelCollector.ReceiverType[], processors: OtelCollector.ProcessorType[], exporters: OtelCollector.ExporterType[]): this;
21
- withDefault(prometheusNamespace: pulumi.Input<string>, prometheusWriteEndpoint: pulumi.Input<string>, awsRegion: string): this;
32
+ withLogsPipeline(receivers: OtelCollector.ReceiverType[], processors: OtelCollector.ProcessorType[], exporters: OtelCollector.ExporterType[]): this;
33
+ withDefault({ prometheusNamespace, prometheusEndpoint, region, logGroupName, logStreamName, }: OtelCollectorConfigBuilder.WithDefaultArgs): this;
22
34
  build(): OtelCollector.Config;
23
35
  private validatePipelineProcessorOrder;
24
36
  private validatePipelineComponents;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/otel/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAY,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AACvC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAExF,yBAAiB,0BAA0B,CAAC;IAC1C,KAAY,eAAe,GAAG;QAC5B,mBAAmB,EAAE,6BAA6B,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACvE,kBAAkB,EAAE,6BAA6B,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACrE,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,aAAa,CAAC,+BAA+B,CAAC,gBAAgB,CAAC,CAAC;QAC9E,aAAa,EAAE,aAAa,CAAC,+BAA+B,CAAC,iBAAiB,CAAC,CAAC;KACjF,CAAC;CACH;AAED,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA8B;IACzD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+B;IAC3D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA8B;IACzD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+B;IAC3D,OAAO,CAAC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SAAS,EAAE,aAAa,CAAC,YAAY,EAAE,EACvC,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE,EACzC,SAAS,EAAE,aAAa,CAAC,YAAY,EAAE,GACtC,IAAI;IAUP,gBAAgB,CACd,SAAS,EAAE,aAAa,CAAC,YAAY,EAAE,EACvC,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE,EACzC,SAAS,EAAE,aAAa,CAAC,YAAY,EAAE,GACtC,IAAI;IAUP,WAAW,CAAC,EACV,mBAAmB,EACnB,kBAAkB,EAClB,MAAM,EACN,YAAY,EACZ,aAAa,GACd,EAAE,0BAA0B,CAAC,eAAe,GAAG,IAAI;IA4BpD,KAAK,IAAI,aAAa,CAAC,MAAM;IA0B7B,OAAO,CAAC,8BAA8B;IAiBtC,OAAO,CAAC,0BAA0B;CA2BnC"}
@@ -46,6 +46,10 @@ class OtelCollectorConfigBuilder {
46
46
  this._exporters.awsxray = { region };
47
47
  return this;
48
48
  }
49
+ withCloudWatchLogsExporter(region, logGroupName, logStreamName, logRetention) {
50
+ this._exporters.awscloudwatchlogs = Object.assign({ region, log_group_name: logGroupName, log_stream_name: logStreamName }, (logRetention && { log_retention: logRetention }));
51
+ return this;
52
+ }
49
53
  withHealthCheckExtension(endpoint = '0.0.0.0:13133') {
50
54
  this._extensions.health_check = { endpoint };
51
55
  return this;
@@ -95,23 +99,36 @@ class OtelCollectorConfigBuilder {
95
99
  };
96
100
  return this;
97
101
  }
98
- withDefault(prometheusNamespace, prometheusWriteEndpoint, awsRegion) {
102
+ withLogsPipeline(receivers, processors, exporters) {
103
+ this._service.pipelines.logs = {
104
+ receivers,
105
+ processors,
106
+ exporters,
107
+ };
108
+ return this;
109
+ }
110
+ withDefault({ prometheusNamespace, prometheusEndpoint, region, logGroupName, logStreamName, }) {
99
111
  return this.withOTLPReceiver(['http'])
100
112
  .withMemoryLimiterProcessor()
101
113
  .withBatchProcessor('batch/metrics')
102
114
  .withBatchProcessor('batch/traces', 2000, 5000, '2s')
103
- .withAPS(prometheusNamespace, prometheusWriteEndpoint, awsRegion)
104
- .withAWSXRayExporter(awsRegion)
115
+ .withBatchProcessor('batch/logs', 1024, 5000, '2s')
116
+ .withAPS(prometheusNamespace, prometheusEndpoint, region)
117
+ .withAWSXRayExporter(region)
118
+ .withCloudWatchLogsExporter(region, logGroupName, logStreamName)
105
119
  .withHealthCheckExtension()
106
120
  .withMetricsPipeline(['otlp'], ['memory_limiter', 'batch/metrics'], ['prometheusremotewrite'])
107
121
  .withTracesPipeline(['otlp'], ['memory_limiter', 'batch/traces'], ['awsxray'])
122
+ .withLogsPipeline(['otlp'], ['memory_limiter', 'batch/logs'], ['awscloudwatchlogs'])
108
123
  .withTelemetry();
109
124
  }
110
125
  build() {
111
126
  this.validatePipelineComponents('metrics');
112
127
  this.validatePipelineComponents('traces');
128
+ this.validatePipelineComponents('logs');
113
129
  this.validatePipelineProcessorOrder('metrics');
114
130
  this.validatePipelineProcessorOrder('traces');
131
+ this.validatePipelineProcessorOrder('logs');
115
132
  // FIX: Fix type inference
116
133
  const extensions = Object.keys(this._extensions);
117
134
  if (extensions.length) {
@@ -20,6 +20,12 @@ export declare namespace OtelCollector {
20
20
  region: string;
21
21
  endpoint?: string;
22
22
  };
23
+ type AwsCloudWatchLogsExporterConfig = {
24
+ region: string;
25
+ log_group_name: pulumi.Input<string>;
26
+ log_stream_name: pulumi.Input<string>;
27
+ log_retention?: number;
28
+ };
23
29
  type DebugExportedConfig = {
24
30
  verbosity: string;
25
31
  };
@@ -27,6 +33,7 @@ export declare namespace OtelCollector {
27
33
  prometheusremotewrite?: PrometheusRemoteWriteExporter.Config;
28
34
  awsxray?: AwsXRayExporterConfig;
29
35
  debug?: DebugExportedConfig;
36
+ awscloudwatchlogs?: AwsCloudWatchLogsExporterConfig;
30
37
  };
31
38
  type ExporterType = keyof Exporter;
32
39
  type SigV4AuthExtensionConfig = {
@@ -62,6 +69,7 @@ export declare namespace OtelCollector {
62
69
  pipelines: {
63
70
  metrics?: PipelineConfig;
64
71
  traces?: PipelineConfig;
72
+ logs?: PipelineConfig;
65
73
  };
66
74
  extensions?: ExtensionType[];
67
75
  telemetry?: TelemetryConfig;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/otel/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF,yBAAiB,aAAa,CAAC;IAC7B,KAAY,QAAQ,GAAG;QACrB,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC;KAC5B,CAAC;IACF,KAAY,YAAY,GAAG,MAAM,QAAQ,CAAC;IAE1C,KAAY,SAAS,GAAG;QACtB,KAAK,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;QAC9B,cAAc,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC;KAChD,GAAG;QACF,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC;KACvC,CAAC;IACF,KAAY,aAAa,GAAG,MAAM,SAAS,CAAC;IAE5C,KAAY,qBAAqB,GAAG;QAClC,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF,KAAY,+BAA+B,GAAG;QAC5C,MAAM,EAAE,MAAM,CAAC;QACf,cAAc,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrC,eAAe,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACtC,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CA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;CAqB9B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-limiter-processor.d.ts","sourceRoot":"","sources":["../../src/otel/memory-limiter-processor.ts"],"names":[],"mappings":"AAAA,yBAAiB,sBAAsB,CAAC;IACtC,KAAY,MAAM,GAAG;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,gBAAgB,EAAE,MAAM,CAAC;QACzB,sBAAsB,EAAE,MAAM,CAAC;KAChC,CAAC;CACH;AAED,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otlp-receiver.d.ts","sourceRoot":"","sources":["../../src/otel/otlp-receiver.ts"],"names":[],"mappings":"AAAA,yBAAiB,YAAY,CAAC;IAC5B,KAAY,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACvC,KAAY,MAAM,GAAG;QACnB,SAAS,EAAE;aACR,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE;gBAChB,QAAQ,EAAE,MAAM,CAAC;aAClB;SACF,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prometheus-remote-write-exporter.d.ts","sourceRoot":"","sources":["../../src/otel/prometheus-remote-write-exporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAEzC,yBAAiB,6BAA6B,CAAC;IAC7C,KAAY,MAAM,GAAG;QACnB,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAChC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,CAAC,EAAE;YACL,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SACrC,CAAC;KACH,CAAC;CACH"}
@@ -0,0 +1,5 @@
1
+ export declare const commonTags: {
2
+ Env: string;
3
+ Project: string;
4
+ };
5
+ //# sourceMappingURL=common-tags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common-tags.d.ts","sourceRoot":"","sources":["../../src/shared/common-tags.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;CAGtB,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commonTags = void 0;
4
+ const pulumi = require("@pulumi/pulumi");
5
+ exports.commonTags = {
6
+ Env: pulumi.getStack(),
7
+ Project: pulumi.getProject(),
8
+ };
@@ -0,0 +1,2 @@
1
+ export declare function mergeWithDefaults<T extends Record<PropertyKey, unknown>, U extends Record<PropertyKey, unknown>>(defaults: T, args: U): T & U;
2
+ //# sourceMappingURL=merge-with-defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-with-defaults.d.ts","sourceRoot":"","sources":["../../src/shared/merge-with-defaults.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,CAC/B,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EACtC,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EACtC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAM7B"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mergeWithDefaults = mergeWithDefaults;
4
+ function mergeWithDefaults(defaults, args) {
5
+ const argsWithoutUndefined = Object.fromEntries(Object.entries(args).filter(([, value]) => value !== undefined));
6
+ return Object.assign({}, defaults, argsWithoutUndefined);
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studion/infra-code-blocks",
3
- "version": "0.8.0-next.2",
3
+ "version": "2.0.0-alpha.0",
4
4
  "description": "Studion common infra components",
5
5
  "keywords": [
6
6
  "infrastructure",
@@ -29,46 +29,64 @@
29
29
  "build": "npm run clean && tsc -b src",
30
30
  "format": "prettier -w .",
31
31
  "release": "release-it --only-version",
32
- "test": "TS_NODE_PROJECT=tests node --test --test-concurrency=none -r ts-node/register tests/**[!build]/index.test.ts",
32
+ "test": "tsx --tsconfig tests/tsconfig.json tests/run.ts",
33
33
  "test:build": "npm run build && tstyche build",
34
34
  "prepare": "husky"
35
35
  },
36
36
  "prettier": "@studion/prettier-config",
37
37
  "dependencies": {
38
38
  "@pulumi/aws": "^6.66.3",
39
+ "@pulumi/aws-native": "^1.38.0",
40
+ "@pulumi/aws-v7": "npm:@pulumi/aws@^7.15.0",
39
41
  "@pulumi/awsx": "^2.21.0",
42
+ "@pulumi/awsx-v3": "npm:@pulumi/awsx@^3.1.0",
40
43
  "@pulumi/pulumi": "^3.146.0",
41
44
  "@pulumi/random": "^4.17.0",
42
45
  "@pulumiverse/grafana": "^0.16.3",
43
- "@upstash/pulumi": "^0.3.14",
46
+ "@upstash/pulumi": "^0.5.0",
44
47
  "yaml": "^2.7.1"
45
48
  },
46
49
  "devDependencies": {
47
- "@aws-sdk/client-acm": "^3.782.0",
48
- "@aws-sdk/client-application-auto-scaling": "^3.758.0",
49
- "@aws-sdk/client-cloudwatch-logs": "^3.767.0",
50
- "@aws-sdk/client-ec2": "^3.767.0",
51
- "@aws-sdk/client-ecs": "^3.766.0",
52
- "@aws-sdk/client-efs": "^3.758.0",
53
- "@aws-sdk/client-elastic-load-balancing-v2": "^3.764.0",
54
- "@aws-sdk/client-route-53": "^3.782.0",
55
- "@aws-sdk/client-servicediscovery": "^3.758.0",
50
+ "@aws-sdk/client-acm": "^3.973.5",
51
+ "@aws-sdk/client-application-auto-scaling": "^3.973.5",
52
+ "@aws-sdk/client-cloudfront": "^3.973.5",
53
+ "@aws-sdk/client-cloudwatch-logs": "^3.973.5",
54
+ "@aws-sdk/client-ec2": "^3.973.5",
55
+ "@aws-sdk/client-ecs": "^3.973.5",
56
+ "@aws-sdk/client-efs": "^3.973.5",
57
+ "@aws-sdk/client-elastic-load-balancing-v2": "^3.764.5",
58
+ "@aws-sdk/client-elasticache": "^3.901.5",
59
+ "@aws-sdk/client-iam": "^3.973.5",
60
+ "@aws-sdk/client-kms": "^3.973.5",
61
+ "@aws-sdk/client-rds": "^3.973.5",
62
+ "@aws-sdk/client-route-53": "^3.973.5",
63
+ "@aws-sdk/client-s3": "^3.982.0",
64
+ "@aws-sdk/client-secrets-manager": "^3.973.5",
65
+ "@aws-sdk/client-servicediscovery": "^3.973.5",
66
+ "@aws-sdk/client-ssm": "^3.986.0",
56
67
  "@studion/prettier-config": "^0.1.0",
57
68
  "@types/node": "^22",
58
69
  "exponential-backoff": "^3.1.2",
59
70
  "http-status": "^2.1.0",
60
71
  "husky": "^9.1.7",
72
+ "ioredis": "^5.8.1",
61
73
  "lint-staged": "^16.1.2",
74
+ "mime": "^4.1.0",
62
75
  "nanospinner": "^1.2.2",
63
76
  "pathe": "^2.0.3",
64
77
  "prettier": "^3.4.2",
65
78
  "release-it": "^18.1.1",
66
- "ts-node": "^10.9.2",
67
- "tsconfig-paths": "^4.2.0",
68
79
  "tstyche": "^4.0.0-beta.9",
80
+ "tsx": "^4.21.0",
69
81
  "typescript": "^5.7.3",
70
82
  "undici": "^6.21.2"
71
83
  },
84
+ "overrides": {
85
+ "@pulumi/pulumi": {
86
+ "glob": "10.5.0",
87
+ "tar": "7.5.7"
88
+ }
89
+ },
72
90
  "publishConfig": {
73
91
  "access": "public"
74
92
  }
@@ -1,11 +0,0 @@
1
- import * as pulumi from '@pulumi/pulumi';
2
- import * as aws from '@pulumi/aws';
3
- export type AcmCertificateArgs = {
4
- domain: pulumi.Input<string>;
5
- hostedZoneId: pulumi.Input<string>;
6
- };
7
- export declare class AcmCertificate extends pulumi.ComponentResource {
8
- certificate: aws.acm.Certificate;
9
- constructor(name: string, args: AcmCertificateArgs, opts?: pulumi.ComponentResourceOptions);
10
- }
11
- //# sourceMappingURL=acm-certificate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"acm-certificate.d.ts","sourceRoot":"","sources":["../../src/components/acm-certificate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAGnC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;CACpC,CAAC;AAEF,qBAAa,cAAe,SAAQ,MAAM,CAAC,iBAAiB;IAC1D,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC;gBAG/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,kBAAkB,EACxB,IAAI,GAAE,MAAM,CAAC,wBAA6B;CAsC7C"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AcmCertificate = void 0;
4
- const pulumi = require("@pulumi/pulumi");
5
- const aws = require("@pulumi/aws");
6
- const constants_1 = require("../constants");
7
- class AcmCertificate extends pulumi.ComponentResource {
8
- constructor(name, args, opts = {}) {
9
- super('studion:acm:Certificate', name, {}, opts);
10
- this.certificate = new aws.acm.Certificate(`${args.domain}-certificate`, { domainName: args.domain, validationMethod: 'DNS', tags: constants_1.commonTags }, { parent: this });
11
- const certificateValidationDomain = new aws.route53.Record(`${args.domain}-cert-validation-domain`, {
12
- name: this.certificate.domainValidationOptions[0].resourceRecordName,
13
- type: this.certificate.domainValidationOptions[0].resourceRecordType,
14
- zoneId: args.hostedZoneId,
15
- records: [
16
- this.certificate.domainValidationOptions[0].resourceRecordValue,
17
- ],
18
- ttl: 600,
19
- }, {
20
- parent: this,
21
- deleteBeforeReplace: true,
22
- });
23
- const certificateValidation = new aws.acm.CertificateValidation(`${args.domain}-cert-validation`, {
24
- certificateArn: this.certificate.arn,
25
- validationRecordFqdns: [certificateValidationDomain.fqdn],
26
- }, { parent: this });
27
- this.registerOutputs();
28
- }
29
- }
30
- exports.AcmCertificate = AcmCertificate;
@@ -1,69 +0,0 @@
1
- import * as aws from '@pulumi/aws';
2
- import * as pulumi from '@pulumi/pulumi';
3
- export type DatabaseReplicaArgs = {
4
- /**
5
- * ARN of the primary DB that we want to replicate.
6
- */
7
- replicateSourceDb: pulumi.Input<string>;
8
- /**
9
- * DB subnet group name. Should be the same as primary instance.
10
- * * If primary DB is instance of studion:Database, it can be accessed as
11
- * `db.dbSubnetGroup.name`.
12
- */
13
- dbSubnetGroupName?: pulumi.Input<string>;
14
- /**
15
- * DB security group ID. Should be the same as primary instance.
16
- * If primary DB is instance of studion:Database, it can be accessed as
17
- * `db.dbSecurityGroup.id`.
18
- */
19
- dbSecurityGroupId: pulumi.Input<string>;
20
- /**
21
- * IAM Monitoring role. Should be the same as primary instance.
22
- */
23
- monitoringRole?: aws.iam.Role;
24
- /**
25
- * Specifies if the RDS instance is multi-AZ. Defaults to false.
26
- */
27
- multiAz?: pulumi.Input<boolean>;
28
- /**
29
- * Specifies whether any database modifications are applied immediately,
30
- * or during the next maintenance window. Default is false.
31
- */
32
- applyImmediately?: pulumi.Input<boolean>;
33
- /**
34
- * The allocated storage in gibibytes. Defaults to 20GB.
35
- */
36
- allocatedStorage?: pulumi.Input<number>;
37
- /**
38
- * The upper limit to which Amazon RDS can automatically scale
39
- * the storage of the DB instance. Defaults to 100GB.
40
- */
41
- maxAllocatedStorage?: pulumi.Input<number>;
42
- /**
43
- * The instance type of the RDS instance. Defaults to 'db.t4g.micro'.
44
- */
45
- instanceClass?: pulumi.Input<string>;
46
- /**
47
- * The name of custom aws.rds.ParameterGroup. Setting this param will apply custom
48
- * DB parameters to this instance.
49
- */
50
- parameterGroupName?: pulumi.Input<string>;
51
- /**
52
- * The DB engine version. Defaults to '17.2'.
53
- */
54
- engineVersion?: pulumi.Input<string>;
55
- /**
56
- * A map of tags to assign to the resource.
57
- */
58
- tags?: pulumi.Input<{
59
- [key: string]: pulumi.Input<string>;
60
- }>;
61
- };
62
- export declare class DatabaseReplica extends pulumi.ComponentResource {
63
- name: string;
64
- instance: aws.rds.Instance;
65
- monitoringRole?: aws.iam.Role;
66
- constructor(name: string, args: DatabaseReplicaArgs, opts?: pulumi.ComponentResourceOptions);
67
- private createDatabaseInstance;
68
- }
69
- //# sourceMappingURL=database-replica.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"database-replica.d.ts","sourceRoot":"","sources":["../../src/components/database-replica.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAGzC,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACxC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACzC;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACxC;;OAEG;IACH,cAAc,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAChC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzC;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACxC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACrC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACrC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC;QAClB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KACrC,CAAC,CAAC;CACJ,CAAC;AAYF,qBAAa,eAAgB,SAAQ,MAAM,CAAC,iBAAiB;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC3B,cAAc,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;gBAG5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,mBAAmB,EACzB,IAAI,GAAE,MAAM,CAAC,wBAA6B;IAa5C,OAAO,CAAC,sBAAsB;CAyC/B"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DatabaseReplica = void 0;
4
- const aws = require("@pulumi/aws");
5
- const pulumi = require("@pulumi/pulumi");
6
- const constants_1 = require("../constants");
7
- const defaults = {
8
- multiAz: false,
9
- applyImmediately: false,
10
- allocatedStorage: 20,
11
- maxAllocatedStorage: 100,
12
- instanceClass: 'db.t4g.micro',
13
- enableMonitoring: false,
14
- engineVersion: '17.2',
15
- };
16
- class DatabaseReplica extends pulumi.ComponentResource {
17
- constructor(name, args, opts = {}) {
18
- super('studion:DatabaseReplica', name, {}, opts);
19
- this.name = name;
20
- const argsWithDefaults = Object.assign({}, defaults, args);
21
- this.monitoringRole = argsWithDefaults.monitoringRole;
22
- this.instance = this.createDatabaseInstance(args);
23
- this.registerOutputs();
24
- }
25
- createDatabaseInstance(args) {
26
- const argsWithDefaults = Object.assign({}, defaults, args);
27
- const stack = pulumi.getStack();
28
- const monitoringOptions = argsWithDefaults.enableMonitoring && this.monitoringRole
29
- ? {
30
- monitoringInterval: 60,
31
- monitoringRoleArn: this.monitoringRole.arn,
32
- performanceInsightsEnabled: true,
33
- performanceInsightsRetentionPeriod: 7,
34
- }
35
- : {};
36
- const instance = new aws.rds.Instance(`${this.name}-rds`, Object.assign(Object.assign({ identifierPrefix: `${this.name}-`, engine: 'postgres', engineVersion: argsWithDefaults.engineVersion, allocatedStorage: argsWithDefaults.allocatedStorage, maxAllocatedStorage: argsWithDefaults.maxAllocatedStorage, instanceClass: argsWithDefaults.instanceClass, dbSubnetGroupName: argsWithDefaults.dbSubnetGroupName, vpcSecurityGroupIds: [argsWithDefaults.dbSecurityGroupId], storageEncrypted: true, multiAz: argsWithDefaults.multiAz, publiclyAccessible: false, applyImmediately: argsWithDefaults.applyImmediately, autoMinorVersionUpgrade: true, maintenanceWindow: 'Mon:07:00-Mon:07:30', replicateSourceDb: argsWithDefaults.replicateSourceDb, parameterGroupName: argsWithDefaults.parameterGroupName, skipFinalSnapshot: true }, monitoringOptions), { tags: Object.assign(Object.assign({}, constants_1.commonTags), argsWithDefaults.tags) }), { parent: this });
37
- return instance;
38
- }
39
- }
40
- exports.DatabaseReplica = DatabaseReplica;
@@ -1,99 +0,0 @@
1
- import * as aws from '@pulumi/aws';
2
- import * as pulumi from '@pulumi/pulumi';
3
- import { Password } from './password';
4
- export type DatabaseArgs = {
5
- /**
6
- * The name of the database to create when the DB instance is created.
7
- */
8
- dbName: pulumi.Input<string>;
9
- /**
10
- * Username for the master DB user.
11
- */
12
- username: pulumi.Input<string>;
13
- vpcId: pulumi.Input<string>;
14
- isolatedSubnetIds: pulumi.Input<pulumi.Input<string>[]>;
15
- /**
16
- * The IPv4 CIDR block for the VPC.
17
- */
18
- vpcCidrBlock: pulumi.Input<string>;
19
- /**
20
- * Specifies if the RDS instance is multi-AZ. Defaults to false.
21
- */
22
- multiAz?: pulumi.Input<boolean>;
23
- /**
24
- * Password for the master DB user. If not specified it will be autogenerated.
25
- * The value will be stored as a secret in AWS Secret Manager.
26
- */
27
- password?: pulumi.Input<string>;
28
- /**
29
- * Specifies whether any database modifications are applied immediately,
30
- * or during the next maintenance window. Default is false.
31
- */
32
- applyImmediately?: pulumi.Input<boolean>;
33
- /**
34
- * Determines whether a final DB snapshot is created before the DB
35
- * instance is deleted. Defaults to false.
36
- */
37
- skipFinalSnapshot?: pulumi.Input<boolean>;
38
- /**
39
- * The allocated storage in gibibytes. Defaults to 20GB.
40
- */
41
- allocatedStorage?: pulumi.Input<number>;
42
- /**
43
- * The upper limit to which Amazon RDS can automatically scale
44
- * the storage of the DB instance. Defaults to 100GB.
45
- */
46
- maxAllocatedStorage?: pulumi.Input<number>;
47
- /**
48
- * The instance type of the RDS instance. Defaults to 'db.t4g.micro'.
49
- */
50
- instanceClass?: pulumi.Input<string>;
51
- /**
52
- * Set this to true to enable database monitoring. Defaults to false.
53
- */
54
- enableMonitoring?: pulumi.Input<boolean>;
55
- /**
56
- * Set this to true to allow major version upgrades, for example when creating
57
- * db from the snapshot. Defaults to false.
58
- */
59
- allowMajorVersionUpgrade?: pulumi.Input<boolean>;
60
- /**
61
- * The name of custom aws.rds.ParameterGroup. Setting this param will apply custom
62
- * DB parameters to this instance.
63
- */
64
- parameterGroupName?: pulumi.Input<string>;
65
- /**
66
- * Specifies whether to create this database from a snapshot.
67
- * This correlates to the snapshot ID you'd find in the RDS console,
68
- * e.g: rds:production-2015-06-26-06-05.
69
- */
70
- snapshotIdentifier?: pulumi.Input<string>;
71
- /**
72
- * The DB engine version. Defaults to '17.2'.
73
- */
74
- engineVersion?: pulumi.Input<string>;
75
- /**
76
- * A map of tags to assign to the resource.
77
- */
78
- tags?: pulumi.Input<{
79
- [key: string]: pulumi.Input<string>;
80
- }>;
81
- };
82
- export declare class Database extends pulumi.ComponentResource {
83
- name: string;
84
- instance: aws.rds.Instance;
85
- kms: aws.kms.Key;
86
- dbSubnetGroup: aws.rds.SubnetGroup;
87
- dbSecurityGroup: aws.ec2.SecurityGroup;
88
- password: Password;
89
- encryptedSnapshotCopy?: aws.rds.SnapshotCopy;
90
- monitoringRole?: aws.iam.Role;
91
- constructor(name: string, args: DatabaseArgs, opts?: pulumi.ComponentResourceOptions);
92
- private createSubnetGroup;
93
- private createSecurityGroup;
94
- private createEncryptionKey;
95
- private createMonitoringRole;
96
- private createEncryptedSnapshotCopy;
97
- private createDatabaseInstance;
98
- }
99
- //# sourceMappingURL=database.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/components/database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACxD;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1C;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,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