dcl-ops-lib 9.9.1 → 9.9.3

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/buildStatic.js CHANGED
@@ -44,6 +44,11 @@ function buildStatic(staticSite) {
44
44
  }
45
45
  const contentBucket = new aws.s3.Bucket(slug + "contentBucket", bucketInfo, {
46
46
  protect,
47
+ // buildStatic never sets the legacy bucket's inline `lifecycleRules`. Ignore that field
48
+ // so a standalone aws.s3.BucketLifecycleConfigurationV2 (defined by the consumer) can own
49
+ // the bucket lifecycle — otherwise this resource reads it back on refresh and deletes it,
50
+ // which flaps against the standalone resource on every `pulumi up`.
51
+ ignoreChanges: ["lifecycleRules"],
47
52
  });
48
53
  if (staticSite.objectOwnership) {
49
54
  new aws.s3.BucketOwnershipControls(`${contentBucket.bucket}OwnershipControls`, {
@@ -60,6 +65,9 @@ function buildStatic(staticSite) {
60
65
  tags: logsBucketTags,
61
66
  }, {
62
67
  protect,
68
+ // See contentBucket: ignore the legacy inline lifecycleRules so a standalone
69
+ // lifecycle resource can own it without flapping.
70
+ ignoreChanges: ["lifecycleRules"],
63
71
  });
64
72
  const distributionArgs = {
65
73
  enabled: true,
@@ -272,8 +272,11 @@ async function createFargateTask(serviceName, dockerImage, dockerListeningPort,
272
272
  }
273
273
  }
274
274
  // NLB mappings: expose UDP/TCP ports via the shared Network Load Balancer
275
+ const nlbDnsDomains = new Set();
275
276
  for (let nlbMapping of nlbMappings) {
276
- const exposedNlb = await (0, exposeNlbService_1.exposeNlbService)(`${serviceName}-${nlbMapping.port}-${version}`, hostname, nlbMapping.port, nlbMapping.protocol, vpc.id, nlbMapping.healthCheck, nlbMapping.separateDomain);
277
+ const nlbDnsDomain = nlbMapping.separateDomain || hostname;
278
+ const exposedNlb = await (0, exposeNlbService_1.exposeNlbService)(`${serviceName}-${nlbMapping.port}-${version}`, hostname, nlbMapping.port, nlbMapping.protocol, vpc.id, nlbMapping.healthCheck, nlbMapping.separateDomain, nlbDnsDomains.has(nlbDnsDomain));
279
+ nlbDnsDomains.add(nlbDnsDomain);
277
280
  targetGroups.push(exposedNlb.targetGroup);
278
281
  if (!extraPortMappings.find((p) => p.hostPort === nlbMapping.port)) {
279
282
  extraPortMappings.push({
@@ -28,8 +28,9 @@ export type NLBMapping = {
28
28
  * @param vpcId VPC ID for the target group
29
29
  * @param healthCheck health check config for the NLB target group
30
30
  * @param separateDomain if provided, creates DNS on this domain instead of the main one
31
+ * @param skipDnsRecord skip the Cloudflare record (another mapping on the same domain already created it)
31
32
  */
32
- export declare function exposeNlbService(name: string, domain: string, port: number, protocol: "udp" | "tcp", vpcId: string, healthCheck?: NLBMapping["healthCheck"], separateDomain?: string): Promise<{
33
+ export declare function exposeNlbService(name: string, domain: string, port: number, protocol: "udp" | "tcp", vpcId: string, healthCheck?: NLBMapping["healthCheck"], separateDomain?: string, skipDnsRecord?: boolean): Promise<{
33
34
  targetGroup: import("@pulumi/aws/lb/targetGroup").TargetGroup;
34
35
  listener: import("@pulumi/aws/lb/listener").Listener;
35
36
  cloudflareRecord: import("@pulumi/cloudflare/record").Record | undefined;
@@ -25,8 +25,9 @@ const DEFAULT_NLB_HEALTHCHECK = {
25
25
  * @param vpcId VPC ID for the target group
26
26
  * @param healthCheck health check config for the NLB target group
27
27
  * @param separateDomain if provided, creates DNS on this domain instead of the main one
28
+ * @param skipDnsRecord skip the Cloudflare record (another mapping on the same domain already created it)
28
29
  */
29
- async function exposeNlbService(name, domain, port, protocol, vpcId, healthCheck, separateDomain) {
30
+ async function exposeNlbService(name, domain, port, protocol, vpcId, healthCheck, separateDomain, skipDnsRecord = false) {
30
31
  if (port < 7700 || port > 7799) {
31
32
  throw new Error(`NLB port ${port} is outside the allowed range (7700-7799). Update the NLB security group in supra to allow a wider range if needed.`);
32
33
  }
@@ -71,7 +72,7 @@ async function exposeNlbService(name, domain, port, protocol, vpcId, healthCheck
71
72
  const dnsDomain = separateDomain || domain;
72
73
  const domainParts = (0, getDomainAndSubdomain_1.getDomainAndSubdomain)(dnsDomain);
73
74
  let cloudflareRecord;
74
- if (dnsDomain.endsWith(`.${domain_1.publicDomain}`)) {
75
+ if (!skipDnsRecord && dnsDomain.endsWith(`.${domain_1.publicDomain}`)) {
75
76
  cloudflareRecord = await (0, cloudflare_1.setRecord)({
76
77
  recordName: domainParts.subdomain,
77
78
  type: "CNAME",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcl-ops-lib",
3
- "version": "9.9.1",
3
+ "version": "9.9.3",
4
4
  "scripts": {
5
5
  "build": "tsc && cp bin/* . && node test.js",
6
6
  "test": "tsc -p tsconfig.test.json && ENVIRONMENT=dev node bin-test/rateLimiting.test.js",