dcl-ops-lib 6.0.4 → 6.0.6

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.
@@ -26,7 +26,7 @@ const getDefaultLogs = (serviceName, logGroup) => {
26
26
  return {
27
27
  logDriver: "awslogs",
28
28
  options: {
29
- "awslogs-group": logGroup.name.apply((name) => name),
29
+ "awslogs-group": (0, stack_1.getStackScopedName)(serviceName),
30
30
  "awslogs-region": "us-east-1",
31
31
  "awslogs-stream-prefix": serviceName,
32
32
  },
@@ -228,10 +228,10 @@ function createFargateTask(serviceName, dockerImage, dockerListeningPort, enviro
228
228
  endpoint: "not exposed",
229
229
  };
230
230
  }
231
- const exposed = yield (0, exposePublicService_1.exposePublicService)(`${serviceName}-${version}`, hostname, dockerListeningPort, healthCheck, undefined, options.extraExposedServiceOptions, deregistrationDelay);
231
+ const exposed = yield (0, exposePublicService_1.exposePublicService)(`${serviceName}-${version}`, hostname, dockerListeningPort, healthCheck, vpc.id, options.extraExposedServiceOptions, deregistrationDelay);
232
232
  const extraALBMappingsExposed = [];
233
233
  for (let extraALBMapping of extraALBMappings) {
234
- const exposedExtra = yield (0, exposePublicService_1.exposePublicService)(`${serviceName}-${extraALBMapping.dockerListeningPort}-${version}`, extraALBMapping.domain, extraALBMapping.dockerListeningPort, extraALBMapping.healthCheck, undefined, extraALBMapping.extraExposedServiceOptions);
234
+ const exposedExtra = yield (0, exposePublicService_1.exposePublicService)(`${serviceName}-${extraALBMapping.dockerListeningPort}-${version}`, extraALBMapping.domain, extraALBMapping.dockerListeningPort, extraALBMapping.healthCheck, vpc.id, extraALBMapping.extraExposedServiceOptions);
235
235
  extraALBMappingsExposed.push(exposedExtra.targetGroup);
236
236
  extraPortMappings.push({
237
237
  containerPort: extraALBMapping.dockerListeningPort,
@@ -22,7 +22,7 @@ export type ExtraExposedServiceOptions = CloudflareDomainOptions & {
22
22
  * @param domain
23
23
  * @param port
24
24
  */
25
- export declare function exposePublicService(name: string, domain: string, port: number, healthCheck?: Partial<albTypes.TargetGroupHealthCheck>, vpc?: aws.ec2.Vpc, extraOptions?: ExtraExposedServiceOptions, deregistrationDelay?: pulumi.Input<number>): Promise<{
25
+ export declare function exposePublicService(name: string, domain: string, port: number, healthCheck?: Partial<albTypes.TargetGroupHealthCheck>, vpcId?: string, extraOptions?: ExtraExposedServiceOptions, deregistrationDelay?: pulumi.Input<number>): Promise<{
26
26
  domain: string;
27
27
  certificate: pulumi.Input<string>;
28
28
  record: import("@pulumi/aws/route53/record").Record | undefined;
@@ -38,7 +38,7 @@ function isUnProxiedDomain(v) {
38
38
  * @param domain
39
39
  * @param port
40
40
  */
41
- function exposePublicService(name, domain, port, healthCheck = {}, vpc, extraOptions, deregistrationDelay) {
41
+ function exposePublicService(name, domain, port, healthCheck = {}, vpcId, extraOptions, deregistrationDelay) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
43
  const { alb, listener } = yield (0, alb_1.getAlb)();
44
44
  const healthCheckValue = Object.assign({}, DEFAULT_HEALTHCHECK_VALUES, healthCheck);
@@ -49,13 +49,14 @@ function exposePublicService(name, domain, port, healthCheck = {}, vpc, extraOpt
49
49
  const createInternalDomain = !onlyCloudflare;
50
50
  const certificate = (0, certificate_1.getCertificateFor)(domain);
51
51
  const slug = name;
52
- const targetVpc = vpc ? vpc : yield aws.ec2.getVpc({ default: true }, { async: true });
52
+ const targetVpcId = vpcId ? vpcId : (yield aws.ec2.getVpc({ default: true }, { async: true })).id;
53
53
  const targetDeregistrationDelay = deregistrationDelay ? deregistrationDelay : 300;
54
54
  const targetGroup = new aws.alb.TargetGroup("tg-" + slug.substr(-32 + 12), {
55
55
  protocol: "HTTP",
56
+ targetType: "ip",
56
57
  port,
57
58
  healthCheck: healthCheckValue,
58
- vpcId: targetVpc.id,
59
+ vpcId: targetVpcId,
59
60
  deregistrationDelay: targetDeregistrationDelay,
60
61
  });
61
62
  const domainParts = (0, getDomainAndSubdomain_1.getDomainAndSubdomain)(domain);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcl-ops-lib",
3
- "version": "6.0.4",
3
+ "version": "6.0.6",
4
4
  "scripts": {
5
5
  "build": "tsc && cp bin/* . && node test.js",
6
6
  "clean": "rm *.d.ts *.js *.js.map"
package/prometheus.js CHANGED
@@ -28,7 +28,7 @@ function makeSecurityGroupAccessibleByPrometheus(securityGroup, fromPort = 0, to
28
28
  description: `Allow access from prometheus`,
29
29
  fromPort,
30
30
  toPort,
31
- protocol: "-1",
31
+ protocol: "tcp",
32
32
  type: "egress",
33
33
  securityGroupId: securityGroup.id,
34
34
  }, { deleteBeforeReplace: true });