MCPcopy Create free account
hub / github.com/anomalyco/console / Stack

Function Stack

packages/core/src/app/resource.ts:178–206  ·  view source on GitHub ↗
(resource, credentials, region)

Source from the content-addressed store, hash-verified

176 return { cloudfrontUrl: "" };
177 },
178 async Stack(resource, credentials, region) {
179 using client = disposable(
180 () =>
181 new CloudFormationClient({
182 credentials,
183 region,
184 retryStrategy: RETRY_STRATEGY,
185 }),
186 (client) => client.destroy(),
187 );
188 const result = await client.send(
189 new DescribeStacksCommand({
190 StackName: resource.id,
191 }),
192 );
193 const [stack] = result.Stacks || [];
194 const parsed = JSON.parse(
195 stack?.Outputs?.find((o) => o.OutputKey === "SSTMetadata")?.OutputValue ||
196 "{}",
197 );
198 return {
199 outputs:
200 stack?.Outputs?.filter(
201 (o) =>
202 o.OutputKey !== "SSTMetadata" && !o.OutputKey?.startsWith("Export"),
203 ) || [],
204 version: parsed.version as string | undefined,
205 } as const;
206 },
207} satisfies {
208 [key in Metadata["type"]]?: (
209 resource: {

Callers

nothing calls this directly

Calls 1

disposableFunction · 0.90

Tested by

no test coverage detected