@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.
- package/dist/components/acm-certificate/index.d.ts +20 -0
- package/dist/components/acm-certificate/index.d.ts.map +1 -0
- package/dist/components/acm-certificate/index.js +40 -0
- package/dist/components/cloudfront/index.d.ts +92 -0
- package/dist/components/cloudfront/index.d.ts.map +1 -0
- package/dist/components/cloudfront/index.js +208 -0
- package/dist/components/cloudfront/lb-cache-strategy.d.ts +21 -0
- package/dist/components/cloudfront/lb-cache-strategy.d.ts.map +1 -0
- package/dist/components/cloudfront/lb-cache-strategy.js +93 -0
- package/dist/components/cloudfront/s3-cache-strategy.d.ts +21 -0
- package/dist/components/cloudfront/s3-cache-strategy.d.ts.map +1 -0
- package/dist/components/cloudfront/s3-cache-strategy.js +78 -0
- package/dist/components/cloudfront/types.d.ts +10 -0
- package/dist/components/cloudfront/types.d.ts.map +1 -0
- package/dist/components/database/builder.d.ts +32 -0
- package/dist/components/database/builder.d.ts.map +1 -0
- package/dist/components/database/builder.js +82 -0
- package/dist/components/database/database-replica.d.ts +35 -0
- package/dist/components/database/database-replica.d.ts.map +1 -0
- package/dist/components/database/database-replica.js +40 -0
- package/dist/components/database/ec2-ssm-connect.d.ts +26 -0
- package/dist/components/database/ec2-ssm-connect.d.ts.map +1 -0
- package/dist/components/{ec2-ssm-connect.js → database/ec2-ssm-connect.js} +42 -34
- package/dist/components/database/index.d.ts +67 -0
- package/dist/components/database/index.d.ts.map +1 -0
- package/dist/components/database/index.js +144 -0
- package/dist/{v2/components → components}/ecs-service/index.d.ts +6 -5
- package/dist/components/ecs-service/index.d.ts.map +1 -0
- package/dist/{v2/components → components}/ecs-service/index.js +19 -30
- package/dist/components/ecs-service/policies.d.ts +3 -0
- package/dist/components/ecs-service/policies.d.ts.map +1 -0
- package/dist/components/ecs-service/task-size.d.ts +37 -0
- package/dist/components/ecs-service/task-size.d.ts.map +1 -0
- package/dist/{constants.js → components/ecs-service/task-size.js} +17 -7
- package/dist/components/grafana/dashboards/index.d.ts.map +1 -0
- package/dist/components/grafana/dashboards/panels.d.ts.map +1 -0
- package/dist/components/grafana/dashboards/types.d.ts.map +1 -0
- package/dist/components/grafana/dashboards/web-server-slo.d.ts.map +1 -0
- package/dist/components/grafana/index.d.ts.map +1 -0
- package/dist/components/password/index.d.ts +15 -0
- package/dist/components/password/index.d.ts.map +1 -0
- package/dist/components/{password.js → password/index.js} +6 -9
- package/dist/components/prometheus/index.d.ts.map +1 -0
- package/dist/components/prometheus/queries.d.ts.map +1 -0
- package/dist/components/prometheus/queries.test.d.ts.map +1 -0
- package/dist/components/redis/elasticache-redis.d.ts +38 -0
- package/dist/components/redis/elasticache-redis.d.ts.map +1 -0
- package/dist/components/redis/elasticache-redis.js +58 -0
- package/dist/components/redis/upstash-redis.d.ts +20 -0
- package/dist/components/redis/upstash-redis.d.ts.map +1 -0
- package/dist/components/redis/upstash-redis.js +29 -0
- package/dist/components/static-site/index.d.ts +23 -0
- package/dist/components/static-site/index.d.ts.map +1 -0
- package/dist/components/static-site/index.js +32 -0
- package/dist/components/static-site/s3-assets.d.ts +20 -0
- package/dist/components/static-site/s3-assets.d.ts.map +1 -0
- package/dist/components/static-site/s3-assets.js +63 -0
- package/dist/components/vpc/index.d.ts +20 -0
- package/dist/components/vpc/index.d.ts.map +1 -0
- package/dist/components/vpc/index.js +31 -0
- package/dist/{v2/components → components}/web-server/builder.d.ts +6 -2
- package/dist/components/web-server/builder.d.ts.map +1 -0
- package/dist/{v2/components → components}/web-server/builder.js +11 -1
- package/dist/{v2/components → components}/web-server/index.d.ts +30 -8
- package/dist/components/web-server/index.d.ts.map +1 -0
- package/dist/{v2/components → components}/web-server/index.js +49 -40
- package/dist/{v2/components → components}/web-server/load-balancer.d.ts +4 -3
- package/dist/components/web-server/load-balancer.d.ts.map +1 -0
- package/dist/{v2/components → components}/web-server/load-balancer.js +17 -14
- package/dist/index.d.ts +24 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -26
- package/dist/otel/batch-processor.d.ts.map +1 -0
- package/dist/{v2/otel → otel}/builder.d.ts +15 -2
- package/dist/otel/builder.d.ts.map +1 -0
- package/dist/{v2/otel → otel}/builder.js +47 -2
- package/dist/{v2/otel → otel}/config.d.ts +13 -1
- package/dist/otel/config.d.ts.map +1 -0
- package/dist/{v2/otel → otel}/config.js +20 -3
- package/dist/{v2/otel → otel}/index.d.ts +8 -0
- package/dist/otel/index.d.ts.map +1 -0
- package/dist/otel/memory-limiter-processor.d.ts.map +1 -0
- package/dist/otel/otlp-receiver.d.ts.map +1 -0
- package/dist/otel/prometheus-remote-write-exporter.d.ts.map +1 -0
- package/dist/shared/common-tags.d.ts +5 -0
- package/dist/shared/common-tags.d.ts.map +1 -0
- package/dist/shared/common-tags.js +8 -0
- package/dist/shared/merge-with-defaults.d.ts +2 -0
- package/dist/shared/merge-with-defaults.d.ts.map +1 -0
- package/dist/shared/merge-with-defaults.js +7 -0
- package/package.json +32 -14
- package/dist/components/acm-certificate.d.ts +0 -11
- package/dist/components/acm-certificate.d.ts.map +0 -1
- package/dist/components/acm-certificate.js +0 -30
- package/dist/components/database-replica.d.ts +0 -69
- package/dist/components/database-replica.d.ts.map +0 -1
- package/dist/components/database-replica.js +0 -40
- package/dist/components/database.d.ts +0 -99
- package/dist/components/database.d.ts.map +0 -1
- package/dist/components/database.js +0 -118
- package/dist/components/ec2-ssm-connect.d.ts +0 -22
- package/dist/components/ec2-ssm-connect.d.ts.map +0 -1
- package/dist/components/ecs-service.d.ts +0 -143
- package/dist/components/ecs-service.d.ts.map +0 -1
- package/dist/components/ecs-service.js +0 -357
- package/dist/components/mongo.d.ts +0 -39
- package/dist/components/mongo.d.ts.map +0 -1
- package/dist/components/mongo.js +0 -54
- package/dist/components/nuxt-ssr.d.ts +0 -44
- package/dist/components/nuxt-ssr.d.ts.map +0 -1
- package/dist/components/nuxt-ssr.js +0 -277
- package/dist/components/password.d.ts +0 -13
- package/dist/components/password.d.ts.map +0 -1
- package/dist/components/project.d.ts +0 -77
- package/dist/components/project.d.ts.map +0 -1
- package/dist/components/project.js +0 -171
- package/dist/components/redis.d.ts +0 -23
- package/dist/components/redis.d.ts.map +0 -1
- package/dist/components/redis.js +0 -35
- package/dist/components/static-site.d.ts +0 -36
- package/dist/components/static-site.d.ts.map +0 -1
- package/dist/components/static-site.js +0 -138
- package/dist/components/web-server.d.ts +0 -38
- package/dist/components/web-server.d.ts.map +0 -1
- package/dist/components/web-server.js +0 -185
- package/dist/constants.d.ts +0 -23
- package/dist/constants.d.ts.map +0 -1
- package/dist/types/pulumi.d.ts +0 -5
- package/dist/types/pulumi.d.ts.map +0 -1
- package/dist/types/size.d.ts +0 -8
- package/dist/types/size.d.ts.map +0 -1
- package/dist/types/size.js +0 -2
- package/dist/v2/components/ecs-service/index.d.ts.map +0 -1
- package/dist/v2/components/ecs-service/policies.d.ts +0 -3
- package/dist/v2/components/ecs-service/policies.d.ts.map +0 -1
- package/dist/v2/components/grafana/dashboards/index.d.ts.map +0 -1
- package/dist/v2/components/grafana/dashboards/panels.d.ts.map +0 -1
- package/dist/v2/components/grafana/dashboards/types.d.ts.map +0 -1
- package/dist/v2/components/grafana/dashboards/web-server-slo.d.ts.map +0 -1
- package/dist/v2/components/grafana/index.d.ts.map +0 -1
- package/dist/v2/components/prometheus/index.d.ts.map +0 -1
- package/dist/v2/components/prometheus/queries.d.ts.map +0 -1
- package/dist/v2/components/prometheus/queries.test.d.ts.map +0 -1
- package/dist/v2/components/web-server/builder.d.ts.map +0 -1
- package/dist/v2/components/web-server/index.d.ts.map +0 -1
- package/dist/v2/components/web-server/load-balancer.d.ts.map +0 -1
- package/dist/v2/index.d.ts +0 -13
- package/dist/v2/index.d.ts.map +0 -1
- package/dist/v2/index.js +0 -16
- package/dist/v2/otel/batch-processor.d.ts.map +0 -1
- package/dist/v2/otel/builder.d.ts.map +0 -1
- package/dist/v2/otel/config.d.ts.map +0 -1
- package/dist/v2/otel/index.d.ts.map +0 -1
- package/dist/v2/otel/memory-limiter-processor.d.ts.map +0 -1
- package/dist/v2/otel/otlp-receiver.d.ts.map +0 -1
- package/dist/v2/otel/prometheus-remote-write-exporter.d.ts.map +0 -1
- /package/dist/{v2/components/grafana/dashboards → components/cloudfront}/types.js +0 -0
- /package/dist/{v2/components → components}/ecs-service/policies.js +0 -0
- /package/dist/{v2/components → components}/grafana/dashboards/index.d.ts +0 -0
- /package/dist/{v2/components → components}/grafana/dashboards/index.js +0 -0
- /package/dist/{v2/components → components}/grafana/dashboards/panels.d.ts +0 -0
- /package/dist/{v2/components → components}/grafana/dashboards/panels.js +0 -0
- /package/dist/{v2/components → components}/grafana/dashboards/types.d.ts +0 -0
- /package/dist/{types/pulumi.js → components/grafana/dashboards/types.js} +0 -0
- /package/dist/{v2/components → components}/grafana/dashboards/web-server-slo.d.ts +0 -0
- /package/dist/{v2/components → components}/grafana/dashboards/web-server-slo.js +0 -0
- /package/dist/{v2/components → components}/grafana/index.d.ts +0 -0
- /package/dist/{v2/components → components}/grafana/index.js +0 -0
- /package/dist/{v2/components → components}/prometheus/index.d.ts +0 -0
- /package/dist/{v2/components → components}/prometheus/index.js +0 -0
- /package/dist/{v2/components → components}/prometheus/queries.d.ts +0 -0
- /package/dist/{v2/components → components}/prometheus/queries.js +0 -0
- /package/dist/{v2/components → components}/prometheus/queries.test.d.ts +0 -0
- /package/dist/{v2/components → components}/prometheus/queries.test.js +0 -0
- /package/dist/{v2/otel → otel}/batch-processor.d.ts +0 -0
- /package/dist/{v2/otel → otel}/batch-processor.js +0 -0
- /package/dist/{v2/otel → otel}/index.js +0 -0
- /package/dist/{v2/otel → otel}/memory-limiter-processor.d.ts +0 -0
- /package/dist/{v2/otel → otel}/memory-limiter-processor.js +0 -0
- /package/dist/{v2/otel → otel}/otlp-receiver.d.ts +0 -0
- /package/dist/{v2/otel → otel}/otlp-receiver.js +0 -0
- /package/dist/{v2/otel → otel}/prometheus-remote-write-exporter.d.ts +0 -0
- /package/dist/{v2/otel → otel}/prometheus-remote-write-exporter.js +0 -0
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EcsService = void 0;
|
|
4
4
|
const pulumi = require("@pulumi/pulumi");
|
|
5
|
-
const aws = require("@pulumi/aws");
|
|
6
|
-
const
|
|
5
|
+
const aws = require("@pulumi/aws-v7");
|
|
6
|
+
const common_tags_1 = require("../../shared/common-tags");
|
|
7
|
+
const merge_with_defaults_1 = require("../../shared/merge-with-defaults");
|
|
7
8
|
const policies_1 = require("./policies");
|
|
9
|
+
const task_size_1 = require("./task-size");
|
|
8
10
|
const config = new pulumi.Config('aws');
|
|
9
11
|
const awsRegion = config.require('region');
|
|
10
12
|
/**
|
|
@@ -38,8 +40,8 @@ const defaults = {
|
|
|
38
40
|
};
|
|
39
41
|
class EcsService extends pulumi.ComponentResource {
|
|
40
42
|
constructor(name, args, opts = {}) {
|
|
41
|
-
super('studion:ecs:
|
|
42
|
-
const argsWithDefaults =
|
|
43
|
+
super('studion:ecs-service:EcsService', name, {}, Object.assign(Object.assign({}, opts), { aliases: [...(opts.aliases || []), { type: 'studion:ecs:Service' }] }));
|
|
44
|
+
const argsWithDefaults = (0, merge_with_defaults_1.mergeWithDefaults)(defaults, args);
|
|
43
45
|
const taskExecutionRoleInlinePolicies = pulumi.output(args.taskExecutionRoleInlinePolicies ||
|
|
44
46
|
defaults.taskExecutionRoleInlinePolicies);
|
|
45
47
|
const taskRoleInlinePolicies = pulumi.output(args.taskRoleInlinePolicies || defaults.taskRoleInlinePolicies);
|
|
@@ -54,7 +56,7 @@ class EcsService extends pulumi.ComponentResource {
|
|
|
54
56
|
this.persistentStorage = this.createPersistentStorage(this.vpc);
|
|
55
57
|
}
|
|
56
58
|
});
|
|
57
|
-
this.taskDefinition = this.createTaskDefinition(argsWithDefaults.containers, pulumi.output(argsWithDefaults.volumes), this.taskExecutionRole, this.taskRole, argsWithDefaults.size, Object.assign(Object.assign({},
|
|
59
|
+
this.taskDefinition = this.createTaskDefinition(argsWithDefaults.containers, pulumi.output(argsWithDefaults.volumes), this.taskExecutionRole, this.taskRole, argsWithDefaults.size, Object.assign(Object.assign({}, common_tags_1.commonTags), argsWithDefaults.tags));
|
|
58
60
|
if (argsWithDefaults.enableServiceAutoDiscovery) {
|
|
59
61
|
this.serviceDiscoveryService = this.createServiceDiscovery();
|
|
60
62
|
}
|
|
@@ -75,13 +77,13 @@ class EcsService extends pulumi.ComponentResource {
|
|
|
75
77
|
const logGroup = new aws.cloudwatch.LogGroup(`${this.name}-log-group`, {
|
|
76
78
|
retentionInDays: 14,
|
|
77
79
|
namePrefix: `/ecs/${this.name}-`,
|
|
78
|
-
tags:
|
|
80
|
+
tags: common_tags_1.commonTags,
|
|
79
81
|
}, { parent: this });
|
|
80
82
|
return logGroup;
|
|
81
83
|
}
|
|
82
84
|
createTaskDefinition(containers, volumes, taskExecutionRole, taskRole, size, tags) {
|
|
83
85
|
const stack = pulumi.getStack();
|
|
84
|
-
const { cpu, memory } = pulumi.output(size).apply(
|
|
86
|
+
const { cpu, memory } = pulumi.output(size).apply(task_size_1.parseTaskSize);
|
|
85
87
|
const containerDefinitions = containers.map(container => {
|
|
86
88
|
return this.createContainerDefinition(container);
|
|
87
89
|
});
|
|
@@ -89,7 +91,7 @@ class EcsService extends pulumi.ComponentResource {
|
|
|
89
91
|
return pulumi.all(containerDefinitions).apply(containerDefinitions => {
|
|
90
92
|
return taskDefinitionVolumes.apply(volumes => {
|
|
91
93
|
return new aws.ecs.TaskDefinition(`${this.name}-task-definition`, Object.assign(Object.assign({ family: `${this.name}-task-definition-${stack}`, networkMode: 'awsvpc', executionRoleArn: taskExecutionRole.arn, taskRoleArn: taskRole.arn, cpu,
|
|
92
|
-
memory, requiresCompatibilities: ['FARGATE'], containerDefinitions: JSON.stringify(containerDefinitions) }, ((volumes === null || volumes === void 0 ? void 0 : volumes.length) ? { volumes } : {})), { tags: Object.assign(Object.assign({},
|
|
94
|
+
memory, requiresCompatibilities: ['FARGATE'], containerDefinitions: JSON.stringify(containerDefinitions) }, ((volumes === null || volumes === void 0 ? void 0 : volumes.length) ? { volumes } : {})), { tags: Object.assign(Object.assign({}, common_tags_1.commonTags), tags) }), { parent: this });
|
|
93
95
|
});
|
|
94
96
|
});
|
|
95
97
|
}
|
|
@@ -158,7 +160,7 @@ class EcsService extends pulumi.ComponentResource {
|
|
|
158
160
|
secretManagerSecretsInlinePolicy,
|
|
159
161
|
...policies,
|
|
160
162
|
]),
|
|
161
|
-
tags:
|
|
163
|
+
tags: common_tags_1.commonTags,
|
|
162
164
|
}, { parent: this });
|
|
163
165
|
return taskExecutionRole;
|
|
164
166
|
}
|
|
@@ -189,7 +191,7 @@ class EcsService extends pulumi.ComponentResource {
|
|
|
189
191
|
execCmdInlinePolicy,
|
|
190
192
|
...policies,
|
|
191
193
|
]),
|
|
192
|
-
tags:
|
|
194
|
+
tags: common_tags_1.commonTags,
|
|
193
195
|
}, { parent: this });
|
|
194
196
|
}
|
|
195
197
|
addSecurityGroup(securityGroup) {
|
|
@@ -214,7 +216,7 @@ class EcsService extends pulumi.ComponentResource {
|
|
|
214
216
|
cidrBlocks: ['0.0.0.0/0'],
|
|
215
217
|
},
|
|
216
218
|
],
|
|
217
|
-
tags:
|
|
219
|
+
tags: common_tags_1.commonTags,
|
|
218
220
|
}, { parent: this });
|
|
219
221
|
this.addSecurityGroup(securityGroup);
|
|
220
222
|
}
|
|
@@ -236,7 +238,7 @@ class EcsService extends pulumi.ComponentResource {
|
|
|
236
238
|
serviceRegistries: {
|
|
237
239
|
registryArn: this.serviceDiscoveryService.arn,
|
|
238
240
|
},
|
|
239
|
-
})), { tags: Object.assign(Object.assign({},
|
|
241
|
+
})), { tags: Object.assign(Object.assign({}, common_tags_1.commonTags), ecsServiceArgs.tags) }), { parent: this });
|
|
240
242
|
}
|
|
241
243
|
createServiceDiscovery() {
|
|
242
244
|
const privateDnsNamespace = this.createPrivateDnsNameSpace();
|
|
@@ -252,14 +254,14 @@ class EcsService extends pulumi.ComponentResource {
|
|
|
252
254
|
],
|
|
253
255
|
routingPolicy: 'MULTIVALUE',
|
|
254
256
|
},
|
|
255
|
-
tags:
|
|
257
|
+
tags: common_tags_1.commonTags,
|
|
256
258
|
}, { parent: this });
|
|
257
259
|
}
|
|
258
260
|
createPrivateDnsNameSpace() {
|
|
259
261
|
return new aws.servicediscovery.PrivateDnsNamespace(`${this.name}-private-dns-namespace`, {
|
|
260
262
|
vpc: this.vpc.vpcId,
|
|
261
263
|
name: this.name,
|
|
262
|
-
tags:
|
|
264
|
+
tags: common_tags_1.commonTags,
|
|
263
265
|
}, { parent: this });
|
|
264
266
|
}
|
|
265
267
|
enableAutoscaling(clusterName, serviceName, minCount, maxCount) {
|
|
@@ -269,7 +271,7 @@ class EcsService extends pulumi.ComponentResource {
|
|
|
269
271
|
resourceId: pulumi.interpolate `service/${clusterName}/${serviceName}`,
|
|
270
272
|
serviceNamespace: 'ecs',
|
|
271
273
|
scalableDimension: 'ecs:service:DesiredCount',
|
|
272
|
-
tags:
|
|
274
|
+
tags: common_tags_1.commonTags,
|
|
273
275
|
}, { parent: this });
|
|
274
276
|
const memoryAutoscalingPolicy = new aws.appautoscaling.Policy(`${this.name}-memory-autoscale-policy`, {
|
|
275
277
|
policyType: 'TargetTrackingScaling',
|
|
@@ -309,7 +311,7 @@ class EcsService extends pulumi.ComponentResource {
|
|
|
309
311
|
],
|
|
310
312
|
performanceMode: 'generalPurpose',
|
|
311
313
|
throughputMode: 'bursting',
|
|
312
|
-
tags: Object.assign(Object.assign({},
|
|
314
|
+
tags: Object.assign(Object.assign({}, common_tags_1.commonTags), { Name: `${this.name}-data` }),
|
|
313
315
|
}, { parent: this });
|
|
314
316
|
const securityGroup = new aws.ec2.SecurityGroup(`${this.name}-persistent-storage-security-group`, {
|
|
315
317
|
vpcId: vpc.vpcId,
|
|
@@ -321,7 +323,7 @@ class EcsService extends pulumi.ComponentResource {
|
|
|
321
323
|
cidrBlocks: [vpc.vpc.cidrBlock],
|
|
322
324
|
},
|
|
323
325
|
],
|
|
324
|
-
tags:
|
|
326
|
+
tags: common_tags_1.commonTags,
|
|
325
327
|
}, { parent: this });
|
|
326
328
|
this.vpc.privateSubnetIds.apply(subnetIds => {
|
|
327
329
|
subnetIds.forEach(subnetId => {
|
|
@@ -351,16 +353,3 @@ class EcsService extends pulumi.ComponentResource {
|
|
|
351
353
|
}
|
|
352
354
|
}
|
|
353
355
|
exports.EcsService = EcsService;
|
|
354
|
-
function parseSize(size) {
|
|
355
|
-
const mapCapabilities = ({ cpu, memory }) => ({
|
|
356
|
-
cpu: String(cpu),
|
|
357
|
-
memory: String(memory),
|
|
358
|
-
});
|
|
359
|
-
if (typeof size === 'string') {
|
|
360
|
-
return mapCapabilities(constants_1.PredefinedSize[size]);
|
|
361
|
-
}
|
|
362
|
-
if (typeof size === 'object') {
|
|
363
|
-
return mapCapabilities(size);
|
|
364
|
-
}
|
|
365
|
-
throw Error('Incorrect EcsService size argument');
|
|
366
|
-
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../../src/components/ecs-service/policies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AAEtC,eAAO,MAAM,gBAAgB,EAAE,GAAG,CAAC,GAAG,CAAC,cAYtC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as pulumi from '@pulumi/pulumi';
|
|
2
|
+
export type TaskSize = {
|
|
3
|
+
cpu: pulumi.Input<string>;
|
|
4
|
+
memory: pulumi.Input<string>;
|
|
5
|
+
} | keyof typeof PredefinedSize;
|
|
6
|
+
export declare function parseTaskSize(size: pulumi.UnwrappedObject<TaskSize>): {
|
|
7
|
+
cpu: string;
|
|
8
|
+
memory: string;
|
|
9
|
+
};
|
|
10
|
+
declare const PredefinedSize: {
|
|
11
|
+
readonly small: {
|
|
12
|
+
readonly cpu: number;
|
|
13
|
+
readonly memory: number;
|
|
14
|
+
};
|
|
15
|
+
readonly medium: {
|
|
16
|
+
readonly cpu: number;
|
|
17
|
+
readonly memory: 1024;
|
|
18
|
+
};
|
|
19
|
+
readonly large: {
|
|
20
|
+
readonly cpu: 1024;
|
|
21
|
+
readonly memory: number;
|
|
22
|
+
};
|
|
23
|
+
readonly xlarge: {
|
|
24
|
+
readonly cpu: number;
|
|
25
|
+
readonly memory: number;
|
|
26
|
+
};
|
|
27
|
+
readonly '2xlarge': {
|
|
28
|
+
readonly cpu: number;
|
|
29
|
+
readonly memory: number;
|
|
30
|
+
};
|
|
31
|
+
readonly '3xlarge': {
|
|
32
|
+
readonly cpu: number;
|
|
33
|
+
readonly memory: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=task-size.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-size.d.ts","sourceRoot":"","sources":["../../../src/components/ecs-service/task-size.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAEzC,MAAM,MAAM,QAAQ,GAChB;IACE,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;CAC9B,GACD,MAAM,OAAO,cAAc,CAAC;AAEhC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB,CAQA;AAKD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;CAyBV,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
3
|
+
exports.parseTaskSize = parseTaskSize;
|
|
4
|
+
function parseTaskSize(size) {
|
|
5
|
+
if (typeof size === 'string') {
|
|
6
|
+
const { cpu, memory } = PredefinedSize[size];
|
|
7
|
+
return { cpu: `${cpu}`, memory: `${memory}` };
|
|
8
|
+
}
|
|
9
|
+
return size;
|
|
10
|
+
}
|
|
5
11
|
const CPU_1_VCPU = 1024;
|
|
6
12
|
const MEMORY_1GB = 1024;
|
|
7
|
-
|
|
13
|
+
const PredefinedSize = {
|
|
8
14
|
small: {
|
|
9
15
|
cpu: CPU_1_VCPU / 4, // 0.25 vCPU
|
|
10
16
|
memory: MEMORY_1GB / 2, // 0.5 GB memory
|
|
@@ -21,8 +27,12 @@ exports.PredefinedSize = {
|
|
|
21
27
|
cpu: CPU_1_VCPU * 2, // 2 vCPU
|
|
22
28
|
memory: MEMORY_1GB * 4, // 4 GB memory
|
|
23
29
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
'2xlarge': {
|
|
31
|
+
cpu: CPU_1_VCPU * 4, // 4 vCPU
|
|
32
|
+
memory: MEMORY_1GB * 8, // 8 GB memory
|
|
33
|
+
},
|
|
34
|
+
'3xlarge': {
|
|
35
|
+
cpu: CPU_1_VCPU * 8, // 8 vCPU
|
|
36
|
+
memory: MEMORY_1GB * 16, // 16 GB memory
|
|
37
|
+
},
|
|
28
38
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/grafana/dashboards/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,KAAK,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../../../src/components/grafana/dashboards/panels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAQlC,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,QAAQ,EAChC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,OAAO,CAAC,MAAM,GACrB,OAAO,CAAC,KAAK,CA0Bf;AAED,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,QAAQ,EAChC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,OAAO,CAAC,MAAM,GACrB,OAAO,CAAC,KAAK,CAUf;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,QAAQ,EAChC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,OAAO,CAAC,MAAM,EACtB,IAAI,CAAC,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,CA4Bf;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,QAAQ,EAChC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,OAAO,CAAC,MAAM,GACrB,OAAO,CAAC,KAAK,CAoCf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/grafana/dashboards/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAGhD,yBAAiB,OAAO,CAAC;IAIvB,KAAY,SAAS,GAAG;QACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAY,MAAM,GAAG;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,SAAS,EAAE,CAAC;KACzB,CAAC;IAEF,KAAY,IAAI,GAAG;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5B,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;KAC5C,CAAC;IAEF,KAAY,KAAK,GAAG;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE;YACP,IAAI,EAAE,MAAM,CAAC;YACb,YAAY,EAAE,MAAM,CAAC;SACtB,EAAE,CAAC;QACJ,WAAW,EAAE;YACX,QAAQ,EAAE;gBACR,IAAI,CAAC,EAAE,MAAM,CAAC;gBACd,GAAG,CAAC,EAAE,MAAM,CAAC;gBACb,GAAG,CAAC,EAAE,MAAM,CAAC;gBACb,KAAK,CAAC,EAAE;oBACN,IAAI,EAAE,MAAM,CAAC;iBACd,CAAC;gBACF,UAAU,CAAC,EAAE;oBACX,IAAI,EAAE,MAAM,CAAC;oBACb,KAAK,EAAE,SAAS,EAAE,CAAC;iBACpB,CAAC;gBACF,MAAM,CAAC,EAAE;oBACP,iBAAiB,CAAC,EAAE,MAAM,CAAC;oBAC3B,SAAS,EAAE,OAAO,CAAC;iBACpB,CAAC;aACH,CAAC;SACH,CAAC;QACF,OAAO,CAAC,EAAE;YACR,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,aAAa,CAAC,EAAE;gBACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;gBACjB,MAAM,CAAC,EAAE,MAAM,CAAC;gBAChB,MAAM,CAAC,EAAE,OAAO,CAAC;aAClB,CAAC;SACH,CAAC;KACH,CAAC;IAEF,UAAiB,KAAK,CAAC;QACrB,KAAY,QAAQ,GAAG;YACrB,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;SACX,CAAC;KACH;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-server-slo.d.ts","sourceRoot":"","sources":["../../../../src/components/grafana/dashboards/web-server-slo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAQlC,cAAM,4BAA4B;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,CAAM;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;gBAEnB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI;IAK5C,gBAAgB,CACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,SAAS,EACvB,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,MAAM,GAC1B,IAAI;IAoCP,eAAe,CACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,SAAS,EACvB,WAAW,EAAE,KAAK,CAAC,SAAS,EAC5B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,MAAM,GAC1B,IAAI;IAwDP,WAAW,CACT,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,KAAK,CAAC,SAAS,EACvB,WAAW,EAAE,KAAK,CAAC,SAAS,EAC5B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,MAAM,GAC1B,IAAI;IA4EP,KAAK,CACH,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,GACxC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;CAmBxC;AAED,eAAe,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/grafana/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as aws from '@pulumi/aws-v7';
|
|
2
|
+
import * as pulumi from '@pulumi/pulumi';
|
|
3
|
+
export declare namespace Password {
|
|
4
|
+
type Args = {
|
|
5
|
+
value?: pulumi.Input<string>;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export declare class Password extends pulumi.ComponentResource {
|
|
9
|
+
name: string;
|
|
10
|
+
value: pulumi.Output<string>;
|
|
11
|
+
secret: aws.secretsmanager.Secret;
|
|
12
|
+
constructor(name: string, args?: Password.Args, opts?: pulumi.ComponentResourceOptions);
|
|
13
|
+
private createPasswordSecret;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/password/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAIzC,yBAAiB,QAAQ,CAAC;IACxB,KAAY,IAAI,GAAG;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAC9B,CAAC;CACH;AAED,qBAAa,QAAS,SAAQ,MAAM,CAAC,iBAAiB;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7B,MAAM,EAAE,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC;gBAGhC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,QAAQ,CAAC,IAAS,EACxB,IAAI,GAAE,MAAM,CAAC,wBAA6B;IAgC5C,OAAO,CAAC,oBAAoB;CAwB7B"}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Password = void 0;
|
|
4
|
-
const aws = require("@pulumi/aws");
|
|
4
|
+
const aws = require("@pulumi/aws-v7");
|
|
5
5
|
const pulumi = require("@pulumi/pulumi");
|
|
6
6
|
const random = require("@pulumi/random");
|
|
7
|
-
const
|
|
7
|
+
const common_tags_1 = require("../../shared/common-tags");
|
|
8
8
|
class Password extends pulumi.ComponentResource {
|
|
9
|
-
constructor(name, args, opts = {}) {
|
|
10
|
-
|
|
11
|
-
additionalSecretOutputs: ['value'],
|
|
12
|
-
});
|
|
13
|
-
super('studion:Password', name, {}, optsWithDefauls);
|
|
9
|
+
constructor(name, args = {}, opts = {}) {
|
|
10
|
+
super('studion:password:Password', name, {}, Object.assign(Object.assign({}, opts), { aliases: [...(opts.aliases || []), { type: 'studion:Password' }] }));
|
|
14
11
|
this.name = name;
|
|
15
12
|
if (args.value) {
|
|
16
|
-
this.value = pulumi.
|
|
13
|
+
this.value = pulumi.secret(args.value);
|
|
17
14
|
}
|
|
18
15
|
else {
|
|
19
16
|
const password = new random.RandomPassword(`${this.name}-random-password`, {
|
|
@@ -31,7 +28,7 @@ class Password extends pulumi.ComponentResource {
|
|
|
31
28
|
const stack = pulumi.getStack();
|
|
32
29
|
const passwordSecret = new aws.secretsmanager.Secret(`${this.name}-password-secret`, {
|
|
33
30
|
namePrefix: `${stack}/${project}/${this.name}-`,
|
|
34
|
-
tags:
|
|
31
|
+
tags: common_tags_1.commonTags,
|
|
35
32
|
}, { parent: this });
|
|
36
33
|
const passwordSecretValue = new aws.secretsmanager.SecretVersion(`${this.name}-password-secret-value`, {
|
|
37
34
|
secretId: passwordSecret.id,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/prometheus/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/components/prometheus/queries.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAO1D,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,SAAS,GACnB,MAAM,CAUR;AAED,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,SAAS,GACnB,MAAM,CAER;AAED,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,MAAM,CAYR;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,MAAM,CAER;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,MAAM,CAKR;AAED,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAWR;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAER"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.test.d.ts","sourceRoot":"","sources":["../../../src/components/prometheus/queries.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as aws from '@pulumi/aws-v7';
|
|
2
|
+
import * as pulumi from '@pulumi/pulumi';
|
|
3
|
+
import * as awsx from '@pulumi/awsx-v3';
|
|
4
|
+
export declare namespace ElastiCacheRedis {
|
|
5
|
+
type Args = {
|
|
6
|
+
vpc: pulumi.Input<awsx.ec2.Vpc>;
|
|
7
|
+
/**
|
|
8
|
+
* Version number of the cache engine to be used
|
|
9
|
+
* @default '7.1'
|
|
10
|
+
*/
|
|
11
|
+
engineVersion?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Instance type for cache nodes
|
|
14
|
+
* @default 'cache.t4g.micro'
|
|
15
|
+
*/
|
|
16
|
+
nodeType?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The name of the parameter group to associate with this cache cluster.
|
|
19
|
+
* @default 'default.redis7'
|
|
20
|
+
*/
|
|
21
|
+
parameterGroupName?: pulumi.Input<string>;
|
|
22
|
+
tags?: pulumi.Input<{
|
|
23
|
+
[key: string]: pulumi.Input<string>;
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export declare class ElastiCacheRedis extends pulumi.ComponentResource {
|
|
28
|
+
name: string;
|
|
29
|
+
vpc: pulumi.Output<awsx.ec2.Vpc>;
|
|
30
|
+
cluster: aws.elasticache.Cluster;
|
|
31
|
+
securityGroup: aws.ec2.SecurityGroup;
|
|
32
|
+
subnetGroup: aws.elasticache.SubnetGroup;
|
|
33
|
+
constructor(name: string, args: ElastiCacheRedis.Args, opts?: pulumi.ComponentResourceOptions);
|
|
34
|
+
private createRedisCluster;
|
|
35
|
+
private createSubnetGroup;
|
|
36
|
+
private createSecurityGroup;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=elasticache-redis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elasticache-redis.d.ts","sourceRoot":"","sources":["../../../src/components/redis/elasticache-redis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAIxC,yBAAiB,gBAAgB,CAAC;IAChC,KAAY,IAAI,GAAG;QACjB,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChC;;;WAGG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB;;;WAGG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;WAGG;QACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC;YAClB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SACrC,CAAC,CAAC;KACJ,CAAC;CACH;AAQD,qBAAa,gBAAiB,SAAQ,MAAM,CAAC,iBAAiB;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC;IACjC,aAAa,EAAE,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC;IACrC,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC;gBAGvC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAC3B,IAAI,GAAE,MAAM,CAAC,wBAA6B;IAoB5C,OAAO,CAAC,kBAAkB;IAuB1B,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,mBAAmB;CAkB5B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ElastiCacheRedis = void 0;
|
|
4
|
+
const aws = require("@pulumi/aws-v7");
|
|
5
|
+
const pulumi = require("@pulumi/pulumi");
|
|
6
|
+
const common_tags_1 = require("../../shared/common-tags");
|
|
7
|
+
const merge_with_defaults_1 = require("../../shared/merge-with-defaults");
|
|
8
|
+
const defaults = {
|
|
9
|
+
engineVersion: '7.1',
|
|
10
|
+
nodeType: 'cache.t4g.micro',
|
|
11
|
+
parameterGroupName: 'default.redis7',
|
|
12
|
+
};
|
|
13
|
+
class ElastiCacheRedis extends pulumi.ComponentResource {
|
|
14
|
+
constructor(name, args, opts = {}) {
|
|
15
|
+
super('studion:redis:ElastiCacheRedis', name, {}, opts);
|
|
16
|
+
const argsWithDefaults = (0, merge_with_defaults_1.mergeWithDefaults)(defaults, args);
|
|
17
|
+
this.name = name;
|
|
18
|
+
this.vpc = pulumi.output(argsWithDefaults.vpc);
|
|
19
|
+
this.securityGroup = this.createSecurityGroup();
|
|
20
|
+
this.subnetGroup = this.createSubnetGroup();
|
|
21
|
+
this.cluster = this.createRedisCluster(argsWithDefaults.engineVersion, argsWithDefaults.nodeType, argsWithDefaults.parameterGroupName, argsWithDefaults.tags);
|
|
22
|
+
this.registerOutputs();
|
|
23
|
+
}
|
|
24
|
+
createRedisCluster(engineVersion, nodeType, parameterGroupName, tags) {
|
|
25
|
+
return new aws.elasticache.Cluster(`${this.name}-cluster`, {
|
|
26
|
+
engine: 'redis',
|
|
27
|
+
engineVersion: engineVersion,
|
|
28
|
+
nodeType: nodeType,
|
|
29
|
+
numCacheNodes: 1,
|
|
30
|
+
securityGroupIds: [this.securityGroup.id],
|
|
31
|
+
subnetGroupName: this.subnetGroup.name,
|
|
32
|
+
parameterGroupName: parameterGroupName,
|
|
33
|
+
port: 6379,
|
|
34
|
+
tags: Object.assign(Object.assign({}, common_tags_1.commonTags), tags),
|
|
35
|
+
}, { parent: this });
|
|
36
|
+
}
|
|
37
|
+
createSubnetGroup() {
|
|
38
|
+
return new aws.elasticache.SubnetGroup(`${this.name}-subnet-group`, {
|
|
39
|
+
subnetIds: this.vpc.isolatedSubnetIds,
|
|
40
|
+
tags: common_tags_1.commonTags,
|
|
41
|
+
}, { parent: this });
|
|
42
|
+
}
|
|
43
|
+
createSecurityGroup() {
|
|
44
|
+
return new aws.ec2.SecurityGroup(`${this.name}-security-group`, {
|
|
45
|
+
vpcId: this.vpc.vpcId,
|
|
46
|
+
ingress: [
|
|
47
|
+
{
|
|
48
|
+
protocol: 'tcp',
|
|
49
|
+
fromPort: 6379,
|
|
50
|
+
toPort: 6379,
|
|
51
|
+
cidrBlocks: [this.vpc.vpc.cidrBlock],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
tags: common_tags_1.commonTags,
|
|
55
|
+
}, { parent: this });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.ElastiCacheRedis = ElastiCacheRedis;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as pulumi from '@pulumi/pulumi';
|
|
2
|
+
import * as upstash from '@upstash/pulumi';
|
|
3
|
+
import { Password } from '../password';
|
|
4
|
+
export declare namespace UpstashRedis {
|
|
5
|
+
type Args = {
|
|
6
|
+
dbName: pulumi.Input<string>;
|
|
7
|
+
/**
|
|
8
|
+
* Primary region for the database
|
|
9
|
+
* @default 'us-east-1'
|
|
10
|
+
*/
|
|
11
|
+
primaryRegion?: pulumi.Input<'us-east-1' | 'us-west-1' | 'us-west-2' | 'eu-central-1' | 'eu-west-1' | 'sa-east-1' | 'ap-southeast-1' | 'ap-southeast-2'>;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare class UpstashRedis extends pulumi.ComponentResource {
|
|
15
|
+
name: string;
|
|
16
|
+
instance: upstash.RedisDatabase;
|
|
17
|
+
password: Password;
|
|
18
|
+
constructor(name: string, args: UpstashRedis.Args, opts?: pulumi.ComponentResourceOptions);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=upstash-redis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstash-redis.d.ts","sourceRoot":"","sources":["../../../src/components/redis/upstash-redis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,yBAAiB,YAAY,CAAC;IAC5B,KAAY,IAAI,GAAG;QACjB,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7B;;;WAGG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC,KAAK,CACxB,WAAW,GACX,WAAW,GACX,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,gBAAgB,GAChB,gBAAgB,CACnB,CAAC;KACH,CAAC;CACH;AAOD,qBAAa,YAAa,SAAQ,MAAM,CAAC,iBAAiB;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC,aAAa,CAAC;IAChC,QAAQ,EAAE,QAAQ,CAAC;gBAGjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,YAAY,CAAC,IAAI,EACvB,IAAI,GAAE,MAAM,CAAC,wBAA6B;CAoC7C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpstashRedis = void 0;
|
|
4
|
+
const pulumi = require("@pulumi/pulumi");
|
|
5
|
+
const upstash = require("@upstash/pulumi");
|
|
6
|
+
const password_1 = require("../password");
|
|
7
|
+
const merge_with_defaults_1 = require("../../shared/merge-with-defaults");
|
|
8
|
+
const defaults = {
|
|
9
|
+
region: 'global',
|
|
10
|
+
primaryRegion: 'us-east-1',
|
|
11
|
+
};
|
|
12
|
+
class UpstashRedis extends pulumi.ComponentResource {
|
|
13
|
+
constructor(name, args, opts = {}) {
|
|
14
|
+
super('studion:redis:UpstashRedis', name, {}, Object.assign(Object.assign({}, opts), { aliases: [...(opts.aliases || []), { type: 'studion:Redis' }] }));
|
|
15
|
+
const dbName = `${pulumi.getProject()}-${pulumi.getStack()}`;
|
|
16
|
+
const argsWithDefaults = (0, merge_with_defaults_1.mergeWithDefaults)(Object.assign(Object.assign({}, defaults), { dbName }), args);
|
|
17
|
+
this.name = name;
|
|
18
|
+
this.instance = new upstash.RedisDatabase(`${this.name}-database`, {
|
|
19
|
+
databaseName: argsWithDefaults.dbName,
|
|
20
|
+
region: argsWithDefaults.region,
|
|
21
|
+
primaryRegion: argsWithDefaults.primaryRegion,
|
|
22
|
+
eviction: true,
|
|
23
|
+
tls: true,
|
|
24
|
+
}, { parent: this });
|
|
25
|
+
this.password = new password_1.Password(`${this.name}-database-password`, { value: this.instance.password }, { parent: this });
|
|
26
|
+
this.registerOutputs();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.UpstashRedis = UpstashRedis;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as pulumi from '@pulumi/pulumi';
|
|
2
|
+
import * as aws from '@pulumi/aws-v7';
|
|
3
|
+
import { S3Assets } from './s3-assets';
|
|
4
|
+
import { CloudFront } from '../cloudfront';
|
|
5
|
+
export declare namespace StaticSite {
|
|
6
|
+
type Args = {
|
|
7
|
+
domain?: pulumi.Input<string>;
|
|
8
|
+
certificate?: pulumi.Input<aws.acm.Certificate>;
|
|
9
|
+
hostedZoneId: pulumi.Input<string>;
|
|
10
|
+
indexDocument?: pulumi.Input<string>;
|
|
11
|
+
errorDocument?: pulumi.Input<string>;
|
|
12
|
+
tags?: pulumi.Input<{
|
|
13
|
+
[key: string]: pulumi.Input<string>;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare class StaticSite extends pulumi.ComponentResource {
|
|
18
|
+
name: string;
|
|
19
|
+
s3Assets: S3Assets;
|
|
20
|
+
cf: CloudFront;
|
|
21
|
+
constructor(name: string, args: StaticSite.Args, opts?: pulumi.ComponentResourceOptions);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/static-site/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,yBAAiB,UAAU,CAAC;IAC1B,KAAY,IAAI,GAAG;QAKjB,MAAM,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAK9B,WAAW,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAChD,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACnC,aAAa,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrC,aAAa,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC;YAClB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SACrC,CAAC,CAAC;KACJ,CAAC;CACH;AAED,qBAAa,UAAW,SAAQ,MAAM,CAAC,iBAAiB;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,EAAE,EAAE,UAAU,CAAC;gBAGb,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,CAAC,IAAI,EACrB,IAAI,GAAE,MAAM,CAAC,wBAA6B;CA6C7C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StaticSite = void 0;
|
|
4
|
+
const pulumi = require("@pulumi/pulumi");
|
|
5
|
+
const s3_assets_1 = require("./s3-assets");
|
|
6
|
+
const cloudfront_1 = require("../cloudfront");
|
|
7
|
+
class StaticSite extends pulumi.ComponentResource {
|
|
8
|
+
constructor(name, args, opts = {}) {
|
|
9
|
+
super('studion:static-site:StaticSite', name, args, Object.assign(Object.assign({}, opts), { aliases: [...(opts.aliases || []), { type: 'studion:StaticSite' }] }));
|
|
10
|
+
const { domain, hostedZoneId, certificate, indexDocument, errorDocument, tags, } = args;
|
|
11
|
+
if (!domain && !certificate) {
|
|
12
|
+
throw new Error('Provide either domain or certificate, or both');
|
|
13
|
+
}
|
|
14
|
+
this.name = name;
|
|
15
|
+
this.s3Assets = new s3_assets_1.S3Assets(`${this.name}-s3-assets`, { indexDocument, errorDocument, tags }, { parent: this });
|
|
16
|
+
this.cf = new cloudfront_1.CloudFront(`${this.name}-cf`, {
|
|
17
|
+
behaviors: [
|
|
18
|
+
{
|
|
19
|
+
type: cloudfront_1.CloudFront.BehaviorType.S3,
|
|
20
|
+
pathPattern: '*',
|
|
21
|
+
bucket: this.s3Assets.bucket,
|
|
22
|
+
websiteConfig: this.s3Assets.websiteConfig,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
domain,
|
|
26
|
+
certificate,
|
|
27
|
+
hostedZoneId,
|
|
28
|
+
tags,
|
|
29
|
+
}, { parent: this });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.StaticSite = StaticSite;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as pulumi from '@pulumi/pulumi';
|
|
2
|
+
import * as aws from '@pulumi/aws-v7';
|
|
3
|
+
export declare namespace S3Assets {
|
|
4
|
+
type Args = {
|
|
5
|
+
indexDocument?: pulumi.Input<string>;
|
|
6
|
+
errorDocument?: pulumi.Input<string>;
|
|
7
|
+
tags?: pulumi.Input<{
|
|
8
|
+
[key: string]: pulumi.Input<string>;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare class S3Assets extends pulumi.ComponentResource {
|
|
13
|
+
name: string;
|
|
14
|
+
bucket: aws.s3.Bucket;
|
|
15
|
+
websiteConfig: aws.s3.BucketWebsiteConfiguration;
|
|
16
|
+
constructor(name: string, args: S3Assets.Args, opts?: pulumi.ComponentResourceOptions);
|
|
17
|
+
private setupWebsiteBucketAccess;
|
|
18
|
+
private createWebsiteBucket;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=s3-assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-assets.d.ts","sourceRoot":"","sources":["../../../src/components/static-site/s3-assets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AAGtC,yBAAiB,QAAQ,CAAC;IACxB,KAAY,IAAI,GAAG;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrC,aAAa,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC;YAClB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SACrC,CAAC,CAAC;KACJ,CAAC;CACH;AAED,qBAAa,QAAS,SAAQ,MAAM,CAAC,iBAAiB;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC;IACtB,aAAa,EAAE,GAAG,CAAC,EAAE,CAAC,0BAA0B,CAAC;gBAG/C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,IAAI,GAAE,MAAM,CAAC,wBAA6B;IAqB5C,OAAO,CAAC,wBAAwB;IAwBhC,OAAO,CAAC,mBAAmB;CA+B5B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.S3Assets = void 0;
|
|
4
|
+
const pulumi = require("@pulumi/pulumi");
|
|
5
|
+
const aws = require("@pulumi/aws-v7");
|
|
6
|
+
const common_tags_1 = require("../../shared/common-tags");
|
|
7
|
+
class S3Assets extends pulumi.ComponentResource {
|
|
8
|
+
constructor(name, args, opts = {}) {
|
|
9
|
+
super('studion:static-site:S3Assets', name, args, opts);
|
|
10
|
+
this.name = name;
|
|
11
|
+
const { indexDocument = 'index.html', errorDocument = 'index.html', tags, } = args;
|
|
12
|
+
const [bucket, websiteConfig] = this.createWebsiteBucket(indexDocument, errorDocument, tags);
|
|
13
|
+
this.bucket = bucket;
|
|
14
|
+
this.websiteConfig = websiteConfig;
|
|
15
|
+
}
|
|
16
|
+
setupWebsiteBucketAccess(bucket) {
|
|
17
|
+
const bucketPublicAccessBlock = new aws.s3.BucketPublicAccessBlock(`${this.name}-bucket-access-block`, {
|
|
18
|
+
bucket: bucket.id,
|
|
19
|
+
blockPublicAcls: false,
|
|
20
|
+
blockPublicPolicy: false,
|
|
21
|
+
ignorePublicAcls: false,
|
|
22
|
+
restrictPublicBuckets: false,
|
|
23
|
+
}, { parent: this });
|
|
24
|
+
const policy = bucket.bucket.apply(getWebsiteBucketPolicy);
|
|
25
|
+
new aws.s3.BucketPolicy(`${this.name}-bucket-policy`, {
|
|
26
|
+
bucket: bucket.id,
|
|
27
|
+
policy: policy.json,
|
|
28
|
+
}, { parent: this, dependsOn: [bucketPublicAccessBlock] });
|
|
29
|
+
}
|
|
30
|
+
createWebsiteBucket(indexDocument, errorDocument, tags) {
|
|
31
|
+
const bucket = new aws.s3.Bucket(`${this.name}-bucket`, {
|
|
32
|
+
bucketPrefix: `${this.name}-`,
|
|
33
|
+
tags: Object.assign(Object.assign({}, common_tags_1.commonTags), tags),
|
|
34
|
+
}, { parent: this });
|
|
35
|
+
const config = new aws.s3.BucketWebsiteConfiguration(`${this.name}-bucket-website-config`, {
|
|
36
|
+
bucket: bucket.id,
|
|
37
|
+
indexDocument: {
|
|
38
|
+
suffix: indexDocument,
|
|
39
|
+
},
|
|
40
|
+
errorDocument: {
|
|
41
|
+
key: errorDocument,
|
|
42
|
+
},
|
|
43
|
+
}, { parent: this });
|
|
44
|
+
this.setupWebsiteBucketAccess(bucket);
|
|
45
|
+
return [bucket, config];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.S3Assets = S3Assets;
|
|
49
|
+
const getWebsiteBucketPolicy = (bucketName) => aws.iam.getPolicyDocument({
|
|
50
|
+
statements: [
|
|
51
|
+
{
|
|
52
|
+
effect: 'Allow',
|
|
53
|
+
principals: [
|
|
54
|
+
{
|
|
55
|
+
type: '*',
|
|
56
|
+
identifiers: ['*'],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
actions: ['s3:GetObject'],
|
|
60
|
+
resources: [`arn:aws:s3:::${bucketName}/*`],
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
});
|