add assume role .ts
This commit is contained in:
@@ -7,6 +7,15 @@
|
|||||||
"publish_time": 1737272626138,
|
"publish_time": 1737272626138,
|
||||||
"update_time": 1737650670432
|
"update_time": 1737650670432
|
||||||
},
|
},
|
||||||
|
"assume-role.ts": {
|
||||||
|
"script_name": "assume-role.ts",
|
||||||
|
"script_length": 529,
|
||||||
|
"script_sha256": "590f45aa0b9a8d270308e496e269290d07273d5c9d1ad7d5d48e449ad56aebe4",
|
||||||
|
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/assume-role.ts",
|
||||||
|
"single_script_file": true,
|
||||||
|
"publish_time": 1773504207974,
|
||||||
|
"update_time": 1773504207974
|
||||||
|
},
|
||||||
"base58.ts": {
|
"base58.ts": {
|
||||||
"script_name": "base58.ts",
|
"script_name": "base58.ts",
|
||||||
"script_length": 453,
|
"script_length": 453,
|
||||||
|
|||||||
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