add assume role .ts
This commit is contained in:
25
single-scripts/assume-role.ts
Executable file
25
single-scripts/assume-role.ts
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/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));
|
||||
Reference in New Issue
Block a user