26 lines
529 B
TypeScript
Executable File
26 lines
529 B
TypeScript
Executable File
#!/usr/bin/env -S deno run -A
|
|
|
|
import {args, assumeRoleByKey, exit,} from "https://script.hatter.ink/@60/deno-commons-mod.ts";
|
|
import {parseArgs} from "jsr:@std/cli/parse-args";
|
|
|
|
const flags = parseArgs(args(), {
|
|
boolean: ["help"],
|
|
string: ["role-arn"],
|
|
});
|
|
|
|
if (flags.help) {
|
|
console.log(
|
|
"assume-role.ts --role-arn ROLE_ARN",
|
|
);
|
|
exit(0);
|
|
}
|
|
|
|
const roleArn = flags["role-arn"];
|
|
|
|
if (!roleArn) {
|
|
console.error("--role-arn is required");
|
|
exit(1);
|
|
}
|
|
|
|
console.log(await assumeRoleByKey(roleArn));
|