MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / samDelete

Function samDelete

packages/cli/src/commands/lambda/sam.ts:114–131  ·  view source on GitHub ↗
(opts: {
  repoRoot: string;
  stackName: string;
  region: string;
  awsProfile?: string;
  stdio?: "inherit" | "pipe";
})

Source from the content-addressed store, hash-verified

112
113/** Run `sam delete` non-interactively. */
114export function samDelete(opts: {
115 repoRoot: string;
116 stackName: string;
117 region: string;
118 awsProfile?: string;
119 stdio?: "inherit" | "pipe";
120}): void {
121 assertSamAvailable();
122 const args = ["delete", "--stack-name", opts.stackName, "--region", opts.region, "--no-prompts"];
123 if (opts.awsProfile) {
124 args.push("--profile", opts.awsProfile);
125 }
126 const samDir = join(opts.repoRoot, "examples", "aws-lambda");
127 const result = spawnSync("sam", args, { cwd: samDir, stdio: opts.stdio ?? "inherit" });
128 if (result.status !== 0) {
129 throw new Error(`[lambda] sam delete exited with code ${result.status ?? "unknown"}`);
130 }
131}
132
133export interface StackOutputBag {
134 bucketName: string;

Callers 1

runDestroyFunction · 0.85

Calls 1

assertSamAvailableFunction · 0.85

Tested by

no test coverage detected