@intentius/chant-lexicon-aws 0.44.9 → 0.44.12

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/src/plugin.ts CHANGED
@@ -548,6 +548,7 @@ aws cloudformation wait stack-update-complete --stack-name my-app-prod`,
548
548
  environment: string;
549
549
  buildOutput: string;
550
550
  entityNames: string[];
551
+ entities?: Map<string, { entityType: string; props: Record<string, unknown> }>;
551
552
  stack?: string;
552
553
  region?: string;
553
554
  owned?: boolean;
@@ -592,9 +593,14 @@ aws cloudformation wait stack-update-complete --stack-name my-app-prod`,
592
593
  // A stack that doesn't exist yet is the pre-first-apply state: nothing is
593
594
  // deployed for this env, so there are no live resources (every declared
594
595
  // resource is "pending") — not an error. That is a real absence, so the
595
- // empty result is the honest one and `create` is the right proposal.
596
+ // empty result is the honest one and `create` is the right proposal
597
+ // EXCEPT for an entity whose props spell its own physical identity
598
+ // (#1647): a freshly carve-emitted, still-Terraform-owned resource lives
599
+ // in no stack at all, and only an identity read can see it.
596
600
  if (err instanceof AwsReadError && stackDoesNotExist(err.message)) {
597
- return observation(resources);
601
+ const { observeByIdentity } = await import("./identity-observe");
602
+ const identity = await observeByIdentity(options.entityNames, options.entities, resources, client);
603
+ return observation({ ...resources, ...identity.resources }, undefined, identity.queried);
598
604
  }
599
605
  // Any other failure (credentials, throttling, a region that can't be
600
606
  // reached) establishes nothing about what is deployed. Reporting every
@@ -655,6 +661,14 @@ aws cloudformation wait stack-update-complete --stack-name my-app-prod`,
655
661
  };
656
662
  }
657
663
 
664
+ // The identity fallback (#1647): entities the stack did not answer for but
665
+ // whose declared props spell a full primary identifier get a Cloud Control
666
+ // read before "absent" stands. Computed against the stack's answer and
667
+ // merged at the return sites, so the own-property enrichment below neither
668
+ // re-describes nor un-observes what identity found.
669
+ const { observeByIdentity } = await import("./identity-observe");
670
+ const identity = await observeByIdentity(options.entityNames, options.entities, resources, client);
671
+
658
672
  // Each resource's OWN properties, on top of the stack outputs above (#1279).
659
673
  // Until this, a node's `attrs` were the stack's exports replicated onto
660
674
  // every member, so no instance carried its own `VpcId`.
@@ -687,13 +701,13 @@ aws cloudformation wait stack-update-complete --stack-name my-app-prod`,
687
701
  detail: `the stack was read, but this resource's own properties were not — ${own.failures.get(type) ?? "the describe call failed"}`,
688
702
  };
689
703
  }
690
- return observation(described, holes);
704
+ return observation({ ...described, ...identity.resources }, holes, identity.queried);
691
705
  }
692
706
 
693
707
  // Every entity the stack answered for was answered for: an entity the
694
708
  // template doesn't carry is genuinely not in this stack, which is an
695
- // absence, not a hole.
696
- return observation(withProperties);
709
+ // absence, not a hole — unless the identity fallback saw it live (#1647).
710
+ return observation({ ...withProperties, ...identity.resources }, undefined, identity.queried);
697
711
  },
698
712
 
699
713
  /**