@mtndev/cli 1.1.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +91 -0
- package/cjs/__chunks/VH7oDXx4.cjs +28 -0
- package/cjs/commands/aws/ec2/allow-ip/handler.cjs +261 -0
- package/cjs/commands/aws/ec2/allow-ip/handler.d.ts +6 -0
- package/cjs/commands/aws/ec2/allow-ip/index.cjs +25 -0
- package/cjs/commands/aws/ec2/allow-ip/index.d.ts +3 -0
- package/cjs/commands/aws/ec2/allow-ip/schema.cjs +33 -0
- package/cjs/commands/aws/ec2/allow-ip/schema.d.ts +33 -0
- package/cjs/commands/aws/ec2/allow-ip/utils.cjs +379 -0
- package/cjs/commands/aws/ec2/allow-ip/utils.d.ts +189 -0
- package/cjs/commands/aws/iam/admin-group.cjs +111 -0
- package/cjs/commands/aws/iam/admin-group.d.ts +55 -0
- package/cjs/commands/aws/iam/break-glass/handler.cjs +127 -0
- package/cjs/commands/aws/iam/break-glass/handler.d.ts +7 -0
- package/cjs/commands/aws/iam/break-glass/index.cjs +7 -0
- package/cjs/commands/aws/iam/break-glass/index.d.ts +2 -0
- package/cjs/commands/aws/iam/break-glass/schema.cjs +21 -0
- package/cjs/commands/aws/iam/break-glass/schema.d.ts +25 -0
- package/cjs/commands/aws/iam/check-admin/handler.cjs +89 -0
- package/cjs/commands/aws/iam/check-admin/handler.d.ts +5 -0
- package/cjs/commands/aws/iam/check-admin/index.cjs +7 -0
- package/cjs/commands/aws/iam/check-admin/index.d.ts +2 -0
- package/cjs/commands/aws/iam/check-admin/schema.cjs +19 -0
- package/cjs/commands/aws/iam/check-admin/schema.d.ts +19 -0
- package/cjs/commands/aws/iam/policies/s3-restrictions-deny-non-s3-services.json +20 -0
- package/cjs/commands/aws/iam/policies/sts-federation.json +11 -0
- package/cjs/commands/aws/iam/policies/user-admins-deny-list.json +175 -0
- package/cjs/commands/aws/iam/policies/user-admins-deny-regions-list.json +41 -0
- package/cjs/commands/aws/iam/policies/user-admins-self-service-iam.json +56 -0
- package/cjs/commands/aws/iam/policies/user-admins-write-list.json +117 -0
- package/cjs/commands/aws/iam/remove-admin/handler.cjs +120 -0
- package/cjs/commands/aws/iam/remove-admin/handler.d.ts +6 -0
- package/cjs/commands/aws/iam/remove-admin/index.cjs +7 -0
- package/cjs/commands/aws/iam/remove-admin/index.d.ts +2 -0
- package/cjs/commands/aws/iam/remove-admin/schema.cjs +22 -0
- package/cjs/commands/aws/iam/remove-admin/schema.d.ts +28 -0
- package/cjs/commands/aws/iam/setup-acl/handler.cjs +227 -0
- package/cjs/commands/aws/iam/setup-acl/handler.d.ts +6 -0
- package/cjs/commands/aws/iam/setup-acl/index.cjs +13 -0
- package/cjs/commands/aws/iam/setup-acl/index.d.ts +3 -0
- package/cjs/commands/aws/iam/setup-acl/schema.cjs +19 -0
- package/cjs/commands/aws/iam/setup-acl/schema.d.ts +24 -0
- package/cjs/commands/aws/iam/setup-acl/utils.cjs +305 -0
- package/cjs/commands/aws/iam/setup-acl/utils.d.ts +61 -0
- package/cjs/commands/aws/iam/users/handler.cjs +59 -0
- package/cjs/commands/aws/iam/users/handler.d.ts +5 -0
- package/cjs/commands/aws/iam/users/index.cjs +18 -0
- package/cjs/commands/aws/iam/users/index.d.ts +3 -0
- package/cjs/commands/aws/iam/users/schema.cjs +17 -0
- package/cjs/commands/aws/iam/users/schema.d.ts +18 -0
- package/cjs/commands/aws/iam/users/utils.cjs +454 -0
- package/cjs/commands/aws/iam/users/utils.d.ts +119 -0
- package/cjs/commands/aws/index.cjs +223 -0
- package/cjs/commands/aws/index.d.ts +14 -0
- package/cjs/commands/aws/route53/add-record/handler.cjs +264 -0
- package/cjs/commands/aws/route53/add-record/handler.d.ts +36 -0
- package/cjs/commands/aws/route53/add-record/index.cjs +26 -0
- package/cjs/commands/aws/route53/add-record/index.d.ts +3 -0
- package/cjs/commands/aws/route53/add-record/schema.cjs +43 -0
- package/cjs/commands/aws/route53/add-record/schema.d.ts +45 -0
- package/cjs/commands/aws/route53/add-record/utils.cjs +404 -0
- package/cjs/commands/aws/route53/add-record/utils.d.ts +216 -0
- package/cjs/commands/aws/route53/remove-record/handler.cjs +114 -0
- package/cjs/commands/aws/route53/remove-record/handler.d.ts +6 -0
- package/cjs/commands/aws/route53/remove-record/index.cjs +5 -0
- package/cjs/commands/aws/route53/remove-record/index.d.ts +2 -0
- package/cjs/commands/aws/route53/remove-record/schema.cjs +22 -0
- package/cjs/commands/aws/route53/remove-record/schema.d.ts +30 -0
- package/cjs/commands/aws/schema.cjs +19 -0
- package/cjs/commands/aws/schema.d.ts +13 -0
- package/cjs/commands/aws/ses/send-email/handler.cjs +73 -0
- package/cjs/commands/aws/ses/send-email/handler.d.ts +5 -0
- package/cjs/commands/aws/ses/send-email/index.cjs +9 -0
- package/cjs/commands/aws/ses/send-email/index.d.ts +3 -0
- package/cjs/commands/aws/ses/send-email/schema.cjs +24 -0
- package/cjs/commands/aws/ses/send-email/schema.d.ts +39 -0
- package/cjs/commands/aws/ses/send-email/utils.cjs +87 -0
- package/cjs/commands/aws/ses/send-email/utils.d.ts +47 -0
- package/cjs/commands/aws/ses/smtp-password.cjs +72 -0
- package/cjs/commands/aws/ses/smtp-password.d.ts +21 -0
- package/cjs/commands/aws/utils/exec-aws.cjs +145 -0
- package/cjs/commands/aws/utils/exec-aws.d.ts +79 -0
- package/cjs/commands/aws/utils/resolve-policy-path.cjs +15 -0
- package/cjs/commands/aws/utils/resolve-policy-path.d.ts +8 -0
- package/cjs/commands/aws/utils/resolve-profile.cjs +93 -0
- package/cjs/commands/aws/utils/resolve-profile.d.ts +28 -0
- package/cjs/commands/aws/utils/tty.cjs +54 -0
- package/cjs/commands/aws/utils/tty.d.ts +24 -0
- package/cjs/commands/db/create-readonly-user/handler.cjs +254 -0
- package/cjs/commands/db/create-readonly-user/handler.d.ts +5 -0
- package/cjs/commands/db/create-readonly-user/index.cjs +18 -0
- package/cjs/commands/db/create-readonly-user/index.d.ts +3 -0
- package/cjs/commands/db/create-readonly-user/mysql.cjs +102 -0
- package/cjs/commands/db/create-readonly-user/mysql.d.ts +33 -0
- package/cjs/commands/db/create-readonly-user/postgres.cjs +209 -0
- package/cjs/commands/db/create-readonly-user/postgres.d.ts +31 -0
- package/cjs/commands/db/create-readonly-user/schema.cjs +39 -0
- package/cjs/commands/db/create-readonly-user/schema.d.ts +55 -0
- package/cjs/commands/db/create-readonly-user/utils.cjs +160 -0
- package/cjs/commands/db/create-readonly-user/utils.d.ts +112 -0
- package/cjs/commands/db/index.cjs +46 -0
- package/cjs/commands/db/index.d.ts +6 -0
- package/cjs/commands/doppler/handler.cjs +95 -9
- package/cjs/commands/doppler/index.cjs +33 -41
- package/cjs/commands/doppler/index.d.ts +1 -0
- package/cjs/commands/doppler/schema.cjs +130 -6
- package/cjs/commands/doppler/schema.d.ts +233 -17
- package/cjs/commands/doppler/set-secret.cjs +378 -0
- package/cjs/commands/doppler/set-secret.d.ts +113 -0
- package/cjs/commands/doppler/utils/exec.cjs +106 -12
- package/cjs/commands/doppler/utils.cjs +412 -30
- package/cjs/commands/doppler/utils.d.ts +32 -8
- package/cjs/commands/icons/handler.cjs +82 -8
- package/cjs/commands/icons/index.cjs +15 -31
- package/cjs/commands/icons/schema.cjs +101 -13
- package/cjs/commands/icons/schema.d.ts +1 -1
- package/cjs/commands/icons/utils.cjs +131 -13
- package/cjs/commands/index.cjs +54 -82
- package/cjs/commands/schema.cjs +25 -8
- package/cjs/index.cjs +3 -4
- package/esm/commands/aws/ec2/allow-ip/handler.d.ts +6 -0
- package/esm/commands/aws/ec2/allow-ip/handler.js +258 -0
- package/esm/commands/aws/ec2/allow-ip/index.d.ts +3 -0
- package/esm/commands/aws/ec2/allow-ip/index.js +4 -0
- package/esm/commands/aws/ec2/allow-ip/schema.d.ts +33 -0
- package/esm/commands/aws/ec2/allow-ip/schema.js +29 -0
- package/esm/commands/aws/ec2/allow-ip/utils.d.ts +189 -0
- package/esm/commands/aws/ec2/allow-ip/utils.js +363 -0
- package/esm/commands/aws/iam/admin-group.d.ts +55 -0
- package/esm/commands/aws/iam/admin-group.js +104 -0
- package/esm/commands/aws/iam/break-glass/handler.d.ts +7 -0
- package/esm/commands/aws/iam/break-glass/handler.js +124 -0
- package/esm/commands/aws/iam/break-glass/index.d.ts +2 -0
- package/esm/commands/aws/iam/break-glass/index.js +4 -0
- package/esm/commands/aws/iam/break-glass/schema.d.ts +25 -0
- package/esm/commands/aws/iam/break-glass/schema.js +19 -0
- package/esm/commands/aws/iam/check-admin/handler.d.ts +5 -0
- package/esm/commands/aws/iam/check-admin/handler.js +86 -0
- package/esm/commands/aws/iam/check-admin/index.d.ts +2 -0
- package/esm/commands/aws/iam/check-admin/index.js +4 -0
- package/esm/commands/aws/iam/check-admin/schema.d.ts +19 -0
- package/esm/commands/aws/iam/check-admin/schema.js +17 -0
- package/esm/commands/aws/iam/policies/s3-restrictions-deny-non-s3-services.json +20 -0
- package/esm/commands/aws/iam/policies/sts-federation.json +11 -0
- package/esm/commands/aws/iam/policies/user-admins-deny-list.json +175 -0
- package/esm/commands/aws/iam/policies/user-admins-deny-regions-list.json +41 -0
- package/esm/commands/aws/iam/policies/user-admins-self-service-iam.json +56 -0
- package/esm/commands/aws/iam/policies/user-admins-write-list.json +117 -0
- package/esm/commands/aws/iam/remove-admin/handler.d.ts +6 -0
- package/esm/commands/aws/iam/remove-admin/handler.js +117 -0
- package/esm/commands/aws/iam/remove-admin/index.d.ts +2 -0
- package/esm/commands/aws/iam/remove-admin/index.js +4 -0
- package/esm/commands/aws/iam/remove-admin/schema.d.ts +28 -0
- package/esm/commands/aws/iam/remove-admin/schema.js +20 -0
- package/esm/commands/aws/iam/setup-acl/handler.d.ts +6 -0
- package/esm/commands/aws/iam/setup-acl/handler.js +224 -0
- package/esm/commands/aws/iam/setup-acl/index.d.ts +3 -0
- package/esm/commands/aws/iam/setup-acl/index.js +4 -0
- package/esm/commands/aws/iam/setup-acl/schema.d.ts +24 -0
- package/esm/commands/aws/iam/setup-acl/schema.js +18 -0
- package/esm/commands/aws/iam/setup-acl/utils.d.ts +61 -0
- package/esm/commands/aws/iam/setup-acl/utils.js +298 -0
- package/esm/commands/aws/iam/users/handler.d.ts +5 -0
- package/esm/commands/aws/iam/users/handler.js +56 -0
- package/esm/commands/aws/iam/users/index.d.ts +3 -0
- package/esm/commands/aws/iam/users/index.js +4 -0
- package/esm/commands/aws/iam/users/schema.d.ts +18 -0
- package/esm/commands/aws/iam/users/schema.js +16 -0
- package/esm/commands/aws/iam/users/utils.d.ts +119 -0
- package/esm/commands/aws/iam/users/utils.js +440 -0
- package/esm/commands/aws/index.d.ts +14 -0
- package/esm/commands/aws/index.js +142 -0
- package/esm/commands/aws/route53/add-record/handler.d.ts +36 -0
- package/esm/commands/aws/route53/add-record/handler.js +258 -0
- package/esm/commands/aws/route53/add-record/index.d.ts +3 -0
- package/esm/commands/aws/route53/add-record/index.js +4 -0
- package/esm/commands/aws/route53/add-record/schema.d.ts +45 -0
- package/esm/commands/aws/route53/add-record/schema.js +40 -0
- package/esm/commands/aws/route53/add-record/utils.d.ts +216 -0
- package/esm/commands/aws/route53/add-record/utils.js +389 -0
- package/esm/commands/aws/route53/remove-record/handler.d.ts +6 -0
- package/esm/commands/aws/route53/remove-record/handler.js +111 -0
- package/esm/commands/aws/route53/remove-record/index.d.ts +2 -0
- package/esm/commands/aws/route53/remove-record/index.js +3 -0
- package/esm/commands/aws/route53/remove-record/schema.d.ts +30 -0
- package/esm/commands/aws/route53/remove-record/schema.js +21 -0
- package/esm/commands/aws/schema.d.ts +13 -0
- package/esm/commands/aws/schema.js +16 -0
- package/esm/commands/aws/ses/send-email/handler.d.ts +5 -0
- package/esm/commands/aws/ses/send-email/handler.js +70 -0
- package/esm/commands/aws/ses/send-email/index.d.ts +3 -0
- package/esm/commands/aws/ses/send-email/index.js +4 -0
- package/esm/commands/aws/ses/send-email/schema.d.ts +39 -0
- package/esm/commands/aws/ses/send-email/schema.js +23 -0
- package/esm/commands/aws/ses/send-email/utils.d.ts +47 -0
- package/esm/commands/aws/ses/send-email/utils.js +84 -0
- package/esm/commands/aws/ses/smtp-password.d.ts +21 -0
- package/esm/commands/aws/ses/smtp-password.js +69 -0
- package/esm/commands/aws/utils/exec-aws.d.ts +79 -0
- package/esm/commands/aws/utils/exec-aws.js +137 -0
- package/esm/commands/aws/utils/resolve-policy-path.d.ts +8 -0
- package/esm/commands/aws/utils/resolve-policy-path.js +14 -0
- package/esm/commands/aws/utils/resolve-profile.d.ts +28 -0
- package/esm/commands/aws/utils/resolve-profile.js +88 -0
- package/esm/commands/aws/utils/tty.d.ts +24 -0
- package/esm/commands/aws/utils/tty.js +51 -0
- package/esm/commands/db/create-readonly-user/handler.d.ts +5 -0
- package/esm/commands/db/create-readonly-user/handler.js +251 -0
- package/esm/commands/db/create-readonly-user/index.d.ts +3 -0
- package/esm/commands/db/create-readonly-user/index.js +4 -0
- package/esm/commands/db/create-readonly-user/mysql.d.ts +33 -0
- package/esm/commands/db/create-readonly-user/mysql.js +98 -0
- package/esm/commands/db/create-readonly-user/postgres.d.ts +31 -0
- package/esm/commands/db/create-readonly-user/postgres.js +205 -0
- package/esm/commands/db/create-readonly-user/schema.d.ts +55 -0
- package/esm/commands/db/create-readonly-user/schema.js +35 -0
- package/esm/commands/db/create-readonly-user/utils.d.ts +112 -0
- package/esm/commands/db/create-readonly-user/utils.js +151 -0
- package/esm/commands/db/index.d.ts +6 -0
- package/esm/commands/db/index.js +31 -0
- package/esm/commands/doppler/handler.js +92 -9
- package/esm/commands/doppler/index.d.ts +1 -0
- package/esm/commands/doppler/index.js +6 -41
- package/esm/commands/doppler/schema.d.ts +233 -17
- package/esm/commands/doppler/schema.js +125 -7
- package/esm/commands/doppler/set-secret.d.ts +113 -0
- package/esm/commands/doppler/set-secret.js +370 -0
- package/esm/commands/doppler/utils/exec.js +100 -12
- package/esm/commands/doppler/utils.d.ts +32 -8
- package/esm/commands/doppler/utils.js +396 -30
- package/esm/commands/icons/handler.js +79 -8
- package/esm/commands/icons/index.js +4 -31
- package/esm/commands/icons/schema.d.ts +1 -1
- package/esm/commands/icons/schema.js +97 -15
- package/esm/commands/icons/utils.js +125 -13
- package/esm/commands/index.js +49 -78
- package/esm/commands/schema.js +22 -7
- package/esm/index.js +3 -4
- package/package.json +12 -2
- package/vitest.config.ts +11 -0
- package/cjs/__chunks/4GFJUCSP.cjs +0 -52
- package/cjs/__chunks/4SFWHCB3.cjs +0 -133
- package/cjs/__chunks/B2KFW7T7.cjs +0 -1
- package/cjs/__chunks/EMMC33QA.cjs +0 -401
- package/cjs/__chunks/INFOPAHN.cjs +0 -117
- package/cjs/__chunks/J36P6UNE.cjs +0 -75
- package/cjs/__chunks/NIMXXHJQ.cjs +0 -92
- package/cjs/__chunks/NSRFG4DF.cjs +0 -100
- package/cjs/__chunks/WNJ3ZYLI.cjs +0 -1
- package/cjs/__chunks/ZMDIOZPT.cjs +0 -22
- package/esm/__chunks/46HGXFME.js +0 -0
- package/esm/__chunks/6G4PXXKF.js +0 -75
- package/esm/__chunks/6L5RNR7G.js +0 -100
- package/esm/__chunks/FL7AILGH.js +0 -133
- package/esm/__chunks/HJSXC6HP.js +0 -117
- package/esm/__chunks/O262GK4B.js +0 -401
- package/esm/__chunks/O3CCA76Q.js +0 -22
- package/esm/__chunks/SJXQJ7RS.js +0 -92
- package/esm/__chunks/SNCKIAOR.js +0 -0
- package/esm/__chunks/X3R5PSWH.js +0 -52
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,96 @@
|
|
|
1
1
|
# @mtndev/cli
|
|
2
2
|
|
|
3
|
+
## 2.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#18](https://github.com/High-Country-Dev/core/pull/18) [`6afcc2a`](https://github.com/High-Country-Dev/core/commit/6afcc2a3d41b51afddd96adad77abae0b65b2e65) Thanks [@rnarcos](https://github.com/rnarcos)! - Fixed the published CLI crashing on every invocation with `SyntaxError: Cannot use 'import.meta' outside a module`. The CJS build (the target of the published `bin`) contained a raw `import.meta.url`: tsup's experimental CJS code splitting transpiles via sucrase, which leaves `import.meta` untouched. The build pipeline (libsync) was upgraded to 2.0.0, which replaces tsup with tsdown (Rolldown): `import.meta.url` is now rewritten inline per module for CJS output, the module structure is preserved 1:1 (no chunk relocation), and the bundled IAM policy JSON documents are shipped alongside the compiled code — so the original `resolvePolicyPath` design works as written. No CLI interface changes.
|
|
8
|
+
|
|
9
|
+
- [#16](https://github.com/High-Country-Dev/core/pull/16) [`4a43df1`](https://github.com/High-Country-Dev/core/commit/4a43df1064325da93a69df798c9213178b1027c8) Thanks [@dnishiyama](https://github.com/dnishiyama)! - Add Vitest testing infrastructure for `@mtndev/cli`: a Node-environment Vitest
|
|
10
|
+
setup with seed tests for the Doppler command utilities and schemas, wired into
|
|
11
|
+
Turbo and the PR CI checks. Tests are colocated under `src/` (so they are
|
|
12
|
+
typechecked, linted, and formatted) and excluded from the published build via
|
|
13
|
+
`libsync` ignore globs and `tsconfig.build.json`, so no test files ship in the
|
|
14
|
+
`cjs`/`esm` output. No runtime behavior changes.
|
|
15
|
+
|
|
16
|
+
## 2.0.0
|
|
17
|
+
|
|
18
|
+
### Major Changes
|
|
19
|
+
|
|
20
|
+
- [#10](https://github.com/High-Country-Dev/core/pull/10) [`c194a34`](https://github.com/High-Country-Dev/core/commit/c194a34266e500a6d8ab4ae5d292e6d875b36549) Thanks [@rnarcos](https://github.com/rnarcos)! - Renamed `--environment` to `--environments` and added support for comma-separated environment lists. Added `clone` subcommand for cloning secrets between Doppler projects.
|
|
21
|
+
|
|
22
|
+
**Breaking change:** `--environment` has been replaced by `--environments`.
|
|
23
|
+
|
|
24
|
+
**Who is affected:** You are **not** affected if you only use the `-e` shorthand — it is preserved and works unchanged with all existing values (`-e dev`, `-e stg`, `-e prd`, `-e all`). You **are** affected if you use the verbose `--environment` flag in any script or alias.
|
|
25
|
+
|
|
26
|
+
**Migration:**
|
|
27
|
+
|
|
28
|
+
Replace `--environment` with `--environments` in any script using the verbose flag. The `-e` shorthand, and all existing values (`dev`, `stg`, `prd`, `all`) continue to work unchanged. You may now also pass comma-separated values to target multiple environments at once.
|
|
29
|
+
|
|
30
|
+
```shell
|
|
31
|
+
# Before
|
|
32
|
+
mtndev doppler download --environment dev
|
|
33
|
+
mtndev doppler upload --environment prd
|
|
34
|
+
|
|
35
|
+
# After
|
|
36
|
+
mtndev doppler download --environments dev
|
|
37
|
+
mtndev doppler upload --environments prd
|
|
38
|
+
|
|
39
|
+
# New: multiple environments at once
|
|
40
|
+
mtndev doppler download --environments dev,stg
|
|
41
|
+
|
|
42
|
+
# New: clone secrets between projects
|
|
43
|
+
mtndev doppler clone --from my-app --to my-app-copy
|
|
44
|
+
mtndev doppler clone --from my-app --to my-app-copy -e dev,stg
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Minor Changes
|
|
48
|
+
|
|
49
|
+
- [#15](https://github.com/High-Country-Dev/core/pull/15) [`36580db`](https://github.com/High-Country-Dev/core/commit/36580db5ab3f7b17552a44bc0f198fe768d3fcdd) Thanks [@dnishiyama](https://github.com/dnishiyama)! - Add a nested `mtn aws` command group with IAM, EC2, and SES operational commands ported from the internal scripts repo:
|
|
50
|
+
- `aws iam setup-acl` — idempotently create the ACL groups, their managed policies, and (optionally) users
|
|
51
|
+
- `aws iam users` — interactively create IAM users and assign them to the matching ACL group
|
|
52
|
+
- `aws iam check-admin` — alert if anyone is a member of the break-glass `acl-admin-do-not-use` group
|
|
53
|
+
- `aws iam remove-admin` — remove users from `acl-admin-do-not-use` to revoke break-glass access
|
|
54
|
+
- `aws iam break-glass` — grant break-glass admin access by adding a user (default: your own IAM user) to `acl-admin-do-not-use` for one profile
|
|
55
|
+
- `aws ec2 allow-ip` — update or create a roaming SSH ingress rule for your current public IP
|
|
56
|
+
- `aws ses send-email` — send a test email via the SES API or SMTP
|
|
57
|
+
|
|
58
|
+
`check-admin` and `remove-admin` scan a single profile (`--profile` or `AWS_PROFILE`) or every `aws-vault` profile with `--all`, trying stored credentials first and falling back to `aws-vault exec`.
|
|
59
|
+
|
|
60
|
+
- [#15](https://github.com/High-Country-Dev/core/pull/15) [`36580db`](https://github.com/High-Country-Dev/core/commit/36580db5ab3f7b17552a44bc0f198fe768d3fcdd) Thanks [@dnishiyama](https://github.com/dnishiyama)! - Added an interactive AWS profile picker to the `mtn aws` commands. When a single-profile command (`iam setup-acl`, `iam users`, `iam break-glass`, `ec2 allow-ip`, `route53 add-record` / `remove-record`, and `ses send-email` over the API transport) runs with neither `--profile` nor `AWS_PROFILE` set and you're at a terminal, it now prompts with a substring-filtered picker over the profiles in `~/.aws/config` instead of silently falling back to the `default` profile. A single filter match auto-selects, and the choice applies to that one invocation only (a child process can't export `AWS_PROFILE` to your shell). Non-interactive contexts (no TTY, e.g. CI) skip the picker and keep the previous behavior. `check-admin` / `remove-admin` are intentionally excluded, where an unset profile already means "scan every aws-vault profile".
|
|
61
|
+
|
|
62
|
+
```shell
|
|
63
|
+
mtn aws route53 add-record # no profile set → filter & pick, then continues
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- [#15](https://github.com/High-Country-Dev/core/pull/15) [`36580db`](https://github.com/High-Country-Dev/core/commit/36580db5ab3f7b17552a44bc0f198fe768d3fcdd) Thanks [@dnishiyama](https://github.com/dnishiyama)! - Added `mtn db create-readonly-user` to create a read-only MySQL or Postgres user on one database or all databases. Example:
|
|
67
|
+
|
|
68
|
+
```shell
|
|
69
|
+
mtn db create-readonly-user -e postgres -u "$DATABASE_URL" -d all --yes
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
- [#15](https://github.com/High-Country-Dev/core/pull/15) [`36580db`](https://github.com/High-Country-Dev/core/commit/36580db5ab3f7b17552a44bc0f198fe768d3fcdd) Thanks [@dnishiyama](https://github.com/dnishiyama)! - Added `mtn doppler set` to interactively (or via flags) add or update a secret by picking project, environment, and config. Example:
|
|
73
|
+
|
|
74
|
+
```shell
|
|
75
|
+
mtn doppler set -p core --environment dev -c dev --name API_KEY --value secret --yes
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- [#15](https://github.com/High-Country-Dev/core/pull/15) [`36580db`](https://github.com/High-Country-Dev/core/commit/36580db5ab3f7b17552a44bc0f198fe768d3fcdd) Thanks [@dnishiyama](https://github.com/dnishiyama)! - Added `mtn aws route53 add-record` to interactively (or via flags) create or update a DNS record in a Route53 hosted zone, with clear create / overwrite / append feedback. Example:
|
|
79
|
+
|
|
80
|
+
```shell
|
|
81
|
+
mtn aws route53 add-record -z mountaindev.com -t CNAME -n redline --value eb34fd3576733d80.vercel-dns-016.com.
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
- [#15](https://github.com/High-Country-Dev/core/pull/15) [`36580db`](https://github.com/High-Country-Dev/core/commit/36580db5ab3f7b17552a44bc0f198fe768d3fcdd) Thanks [@dnishiyama](https://github.com/dnishiyama)! - Added `mtn aws route53 remove-record` to interactively (or via flags) delete a DNS record from a Route53 hosted zone, showing the record it found and confirming before deleting (alias records included). Also taught `add-record` to detect CNAME conflicts up front — Route53 forbids a CNAME from coexisting with any other record type at the same name, so it now stops with a clear message (and points you at `remove-record`) instead of surfacing the raw `InvalidChangeBatch` error. Example:
|
|
85
|
+
|
|
86
|
+
```shell
|
|
87
|
+
mtn aws route53 remove-record -z etymologyexplorer.com -t CNAME -n wotd --yes
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Patch Changes
|
|
91
|
+
|
|
92
|
+
- [#15](https://github.com/High-Country-Dev/core/pull/15) [`36580db`](https://github.com/High-Country-Dev/core/commit/36580db5ab3f7b17552a44bc0f198fe768d3fcdd) Thanks [@dnishiyama](https://github.com/dnishiyama)! - Updated `mtn aws iam users` to default the account slug from the caller profile / IAM ARN (e.g. `md-declan-thespeckledtrout-iam-admin` → `thespeckledtrout`). Press Enter to accept, or type a different value; `--account-name` still skips the prompt.
|
|
93
|
+
|
|
3
94
|
## 1.1.0
|
|
4
95
|
|
|
5
96
|
### Minor Changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
Object.defineProperty(exports, "__toESM", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return __toESM;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_rolldown_runtime = require("../../../../__chunks/VH7oDXx4.cjs");
|
|
3
|
+
const require_commands_aws_utils_tty = require("../../utils/tty.cjs");
|
|
4
|
+
const require_commands_aws_utils_exec_aws = require("../../utils/exec-aws.cjs");
|
|
5
|
+
const require_commands_aws_utils_resolve_profile = require("../../utils/resolve-profile.cjs");
|
|
6
|
+
const require_commands_aws_ec2_allow_ip_schema = require("./schema.cjs");
|
|
7
|
+
const require_commands_aws_ec2_allow_ip_utils = require("./utils.cjs");
|
|
8
|
+
let chalk = require("chalk");
|
|
9
|
+
chalk = require_rolldown_runtime.__toESM(chalk, 1);
|
|
10
|
+
let zod = require("zod");
|
|
11
|
+
//#region src/commands/aws/ec2/allow-ip/handler.js
|
|
12
|
+
/**
|
|
13
|
+
* Resolve which region to operate in: explicit, else default if it has instances,
|
|
14
|
+
* else prompt from the enabled regions.
|
|
15
|
+
* @param {{ profile?: string; region?: string; verbose: boolean }} params
|
|
16
|
+
* @returns {Promise<string>}
|
|
17
|
+
*/
|
|
18
|
+
async function resolveRegion(params) {
|
|
19
|
+
const { profile, region, verbose } = params;
|
|
20
|
+
if (region) return region;
|
|
21
|
+
if (require_commands_aws_ec2_allow_ip_utils.listInstances({
|
|
22
|
+
profile,
|
|
23
|
+
region: "us-east-1",
|
|
24
|
+
verbose
|
|
25
|
+
}).length > 0) return require_commands_aws_ec2_allow_ip_schema.DEFAULT_REGION;
|
|
26
|
+
const regions = require_commands_aws_ec2_allow_ip_utils.listEnabledRegions({
|
|
27
|
+
profile,
|
|
28
|
+
region: require_commands_aws_ec2_allow_ip_schema.DEFAULT_REGION,
|
|
29
|
+
verbose
|
|
30
|
+
});
|
|
31
|
+
if (regions.length === 0) throw new Error("No enabled AWS regions found for this profile");
|
|
32
|
+
console.log(`No EC2 instances found in ${require_commands_aws_ec2_allow_ip_schema.DEFAULT_REGION}.`);
|
|
33
|
+
const chosen = regions[await require_commands_aws_utils_tty.promptChoice({
|
|
34
|
+
message: "Choose a region:",
|
|
35
|
+
options: regions
|
|
36
|
+
})];
|
|
37
|
+
if (!chosen) throw new Error("No region selected");
|
|
38
|
+
return chosen;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Handle errors from authorize/revoke with the same UX as the original script.
|
|
42
|
+
* Returns when the situation is benign (duplicate); exits the process on a
|
|
43
|
+
* permissions failure; rethrows anything else.
|
|
44
|
+
* @param {AwsCliError} error
|
|
45
|
+
* @param {{
|
|
46
|
+
* securityGroup: import("./utils.js").SecurityGroup;
|
|
47
|
+
* sshRules: import("./utils.js").SshIngressRule[];
|
|
48
|
+
* newCidr: string;
|
|
49
|
+
* ruleDescription: string;
|
|
50
|
+
* action: "create" | "update";
|
|
51
|
+
* }} ctx
|
|
52
|
+
*/
|
|
53
|
+
function handleRuleChangeError(error, ctx) {
|
|
54
|
+
const { securityGroup, sshRules, newCidr, ruleDescription, action } = ctx;
|
|
55
|
+
if (error.code === "InvalidPermission.Duplicate") {
|
|
56
|
+
const matching = require_commands_aws_ec2_allow_ip_utils.ruleAlreadyAllowsIp(sshRules, newCidr);
|
|
57
|
+
const label = matching ? matching.description : ruleDescription;
|
|
58
|
+
console.log(`Security group ${securityGroup.groupId} already allows SSH from ${newCidr} (${label}). Nothing to do.`);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (error.code === "UnauthorizedOperation") {
|
|
62
|
+
console.error(`Could not ${action} the SSH rule: your AWS profile does not have ec2:AuthorizeSecurityGroupIngress or ec2:RevokeSecurityGroupIngress on ${securityGroup.groupName} (${securityGroup.groupId}).`);
|
|
63
|
+
console.error("");
|
|
64
|
+
console.error("Current single-host SSH rules on port 22:");
|
|
65
|
+
require_commands_aws_ec2_allow_ip_utils.printSshRules(sshRules, (message) => console.error(message));
|
|
66
|
+
if (action === "create" && sshRules.length > 0) {
|
|
67
|
+
console.error("");
|
|
68
|
+
console.error("A rule may already exist. Re-run to update your named roaming rule, or ask an admin to grant security group ingress permissions.");
|
|
69
|
+
}
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* `aws ec2 allow-ip` handler: update or create a named roaming SSH rule for the
|
|
76
|
+
* caller's current public IP on a chosen EC2 instance's security group.
|
|
77
|
+
* @param {unknown} options
|
|
78
|
+
*/
|
|
79
|
+
async function allowIpCommand(options) {
|
|
80
|
+
try {
|
|
81
|
+
const { profile: profileOption, region: regionOption, ruleName, verbose } = require_commands_aws_ec2_allow_ip_schema.allowIpOptionsSchema.parse(options);
|
|
82
|
+
const profile = await require_commands_aws_utils_resolve_profile.resolveProfile({ profile: profileOption });
|
|
83
|
+
if (!profile) {
|
|
84
|
+
console.error(chalk.default.red("Error: pass --profile or set AWS_PROFILE."));
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
require_commands_aws_utils_exec_aws.requireCommands(["aws"]);
|
|
88
|
+
const identity = require_commands_aws_utils_exec_aws.getCallerIdentity({
|
|
89
|
+
profile,
|
|
90
|
+
region: require_commands_aws_ec2_allow_ip_schema.DEFAULT_REGION,
|
|
91
|
+
verbose
|
|
92
|
+
});
|
|
93
|
+
const firstName = require_commands_aws_ec2_allow_ip_utils.extractRoamingFirstName({
|
|
94
|
+
profile,
|
|
95
|
+
identity
|
|
96
|
+
});
|
|
97
|
+
const ruleDescription = ruleName ?? require_commands_aws_ec2_allow_ip_utils.roamingRuleDescription(firstName);
|
|
98
|
+
console.log("Caller:");
|
|
99
|
+
console.log(` Account: ${identity.Account}`);
|
|
100
|
+
console.log(` Arn: ${identity.Arn}`);
|
|
101
|
+
console.log(` Roaming rule: ${ruleDescription}`);
|
|
102
|
+
console.log("");
|
|
103
|
+
const region = await resolveRegion({
|
|
104
|
+
profile,
|
|
105
|
+
region: regionOption,
|
|
106
|
+
verbose
|
|
107
|
+
});
|
|
108
|
+
console.log(`Region: ${region}`);
|
|
109
|
+
console.log("");
|
|
110
|
+
const instances = require_commands_aws_ec2_allow_ip_utils.listInstances({
|
|
111
|
+
profile,
|
|
112
|
+
region,
|
|
113
|
+
verbose
|
|
114
|
+
});
|
|
115
|
+
if (instances.length === 0) {
|
|
116
|
+
console.log(`No EC2 instances found in ${region}.`);
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
const instance = instances[await require_commands_aws_utils_tty.promptChoice({
|
|
120
|
+
message: "Choose an EC2 instance:",
|
|
121
|
+
options: instances.map((instance) => require_commands_aws_ec2_allow_ip_utils.instanceLabel(instance))
|
|
122
|
+
})];
|
|
123
|
+
if (!instance) throw new Error("No instance selected");
|
|
124
|
+
console.log("");
|
|
125
|
+
const securityGroups = require_commands_aws_ec2_allow_ip_utils.describeSecurityGroups({
|
|
126
|
+
profile,
|
|
127
|
+
region,
|
|
128
|
+
groupIds: instance.securityGroupIds,
|
|
129
|
+
verbose
|
|
130
|
+
});
|
|
131
|
+
if (securityGroups.length === 0) {
|
|
132
|
+
console.log("No security groups found on the selected instance.");
|
|
133
|
+
process.exit(1);
|
|
134
|
+
}
|
|
135
|
+
let securityGroup;
|
|
136
|
+
if (securityGroups.length === 1) {
|
|
137
|
+
const onlyGroup = securityGroups[0];
|
|
138
|
+
if (!onlyGroup) throw new Error("No security group found on the selected instance");
|
|
139
|
+
securityGroup = onlyGroup;
|
|
140
|
+
console.log(`Security group: ${require_commands_aws_ec2_allow_ip_utils.securityGroupLabel(securityGroup)}`);
|
|
141
|
+
} else securityGroup = securityGroups[await require_commands_aws_utils_tty.promptChoice({
|
|
142
|
+
message: "Choose a security group:",
|
|
143
|
+
options: securityGroups.map((group) => require_commands_aws_ec2_allow_ip_utils.securityGroupLabel(group))
|
|
144
|
+
})];
|
|
145
|
+
if (!securityGroup) throw new Error("No security group selected");
|
|
146
|
+
console.log("");
|
|
147
|
+
const currentIp = await require_commands_aws_ec2_allow_ip_utils.getCurrentPublicIp();
|
|
148
|
+
const newCidr = `${currentIp}/32`;
|
|
149
|
+
console.log(`Current public IP: ${currentIp}`);
|
|
150
|
+
console.log("");
|
|
151
|
+
const sgDetails = require_commands_aws_ec2_allow_ip_utils.getSecurityGroupDetails({
|
|
152
|
+
profile,
|
|
153
|
+
region,
|
|
154
|
+
groupId: securityGroup.groupId,
|
|
155
|
+
verbose
|
|
156
|
+
});
|
|
157
|
+
if (!sgDetails) {
|
|
158
|
+
console.log("Could not load security group details.");
|
|
159
|
+
process.exit(1);
|
|
160
|
+
}
|
|
161
|
+
const sshRules = require_commands_aws_ec2_allow_ip_utils.listSshIngressRules(sgDetails);
|
|
162
|
+
const roamingRule = require_commands_aws_ec2_allow_ip_utils.resolveRoamingRule(sshRules, ruleDescription);
|
|
163
|
+
if (roamingRule && roamingRule.cidrIp === newCidr) {
|
|
164
|
+
console.log(`Security group ${securityGroup.groupId} already allows SSH from ${newCidr} (${ruleDescription}). Nothing to do.`);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const otherRuleAtIp = require_commands_aws_ec2_allow_ip_utils.ruleAlreadyAllowsIp(sshRules, newCidr);
|
|
168
|
+
if (otherRuleAtIp && (!roamingRule || otherRuleAtIp.cidrIp !== roamingRule.cidrIp)) {
|
|
169
|
+
const label = otherRuleAtIp.description || "(no description)";
|
|
170
|
+
console.log(`Security group ${securityGroup.groupId} already allows SSH from ${newCidr} (${label}). Nothing to do.`);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (roamingRule) {
|
|
174
|
+
console.log(`Updating SSH rule (${ruleDescription}): ${roamingRule.cidrIp} -> ${newCidr}`);
|
|
175
|
+
try {
|
|
176
|
+
require_commands_aws_ec2_allow_ip_utils.revokeRule({
|
|
177
|
+
profile,
|
|
178
|
+
region,
|
|
179
|
+
groupId: securityGroup.groupId,
|
|
180
|
+
rule: roamingRule,
|
|
181
|
+
verbose
|
|
182
|
+
});
|
|
183
|
+
require_commands_aws_ec2_allow_ip_utils.authorizeRule({
|
|
184
|
+
profile,
|
|
185
|
+
region,
|
|
186
|
+
groupId: securityGroup.groupId,
|
|
187
|
+
cidrIp: newCidr,
|
|
188
|
+
description: ruleDescription,
|
|
189
|
+
fromPort: roamingRule.fromPort,
|
|
190
|
+
toPort: roamingRule.toPort,
|
|
191
|
+
ipProtocol: roamingRule.ipProtocol,
|
|
192
|
+
verbose
|
|
193
|
+
});
|
|
194
|
+
} catch (error) {
|
|
195
|
+
if (error instanceof require_commands_aws_utils_exec_aws.AwsCliError) {
|
|
196
|
+
handleRuleChangeError(error, {
|
|
197
|
+
securityGroup,
|
|
198
|
+
sshRules,
|
|
199
|
+
newCidr,
|
|
200
|
+
ruleDescription,
|
|
201
|
+
action: "update"
|
|
202
|
+
});
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
throw error;
|
|
206
|
+
}
|
|
207
|
+
} else {
|
|
208
|
+
if (sshRules.length > 0) {
|
|
209
|
+
console.log("Existing single-host SSH rules (unchanged):");
|
|
210
|
+
require_commands_aws_ec2_allow_ip_utils.printSshRules(sshRules);
|
|
211
|
+
console.log("");
|
|
212
|
+
}
|
|
213
|
+
console.log(`Creating new "${ruleDescription}" SSH rule for ${newCidr}`);
|
|
214
|
+
try {
|
|
215
|
+
require_commands_aws_ec2_allow_ip_utils.authorizeRule({
|
|
216
|
+
profile,
|
|
217
|
+
region,
|
|
218
|
+
groupId: securityGroup.groupId,
|
|
219
|
+
cidrIp: newCidr,
|
|
220
|
+
description: ruleDescription,
|
|
221
|
+
verbose
|
|
222
|
+
});
|
|
223
|
+
} catch (error) {
|
|
224
|
+
if (error instanceof require_commands_aws_utils_exec_aws.AwsCliError) {
|
|
225
|
+
handleRuleChangeError(error, {
|
|
226
|
+
securityGroup,
|
|
227
|
+
sshRules,
|
|
228
|
+
newCidr,
|
|
229
|
+
ruleDescription,
|
|
230
|
+
action: "create"
|
|
231
|
+
});
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
throw error;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
console.log("");
|
|
238
|
+
console.log(`Done. ${securityGroup.groupName} (${securityGroup.groupId}) now allows SSH from ${newCidr} (${ruleDescription}).`);
|
|
239
|
+
} catch (error) {
|
|
240
|
+
if (error instanceof zod.ZodError) {
|
|
241
|
+
console.error(chalk.default.red("\n❌ Invalid command options:"));
|
|
242
|
+
error.errors.forEach((err) => {
|
|
243
|
+
console.error(chalk.default.red(` ${err.path.join(".")}: ${err.message}`));
|
|
244
|
+
});
|
|
245
|
+
process.exit(1);
|
|
246
|
+
}
|
|
247
|
+
const verbose = options?.verbose || false;
|
|
248
|
+
console.error(chalk.default.red("\n❌ allow-ip failed:"));
|
|
249
|
+
if (error instanceof Error) {
|
|
250
|
+
console.error(chalk.default.red(` ${error.message}`));
|
|
251
|
+
if (verbose && error.stack) {
|
|
252
|
+
console.error(chalk.default.gray("\nStack trace:"));
|
|
253
|
+
console.error(chalk.default.gray(error.stack));
|
|
254
|
+
}
|
|
255
|
+
} else console.error(chalk.default.red(` ${String(error)}`));
|
|
256
|
+
console.error(chalk.default.yellow("\n💡 Use --verbose for detailed error information\n"));
|
|
257
|
+
process.exit(1);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
//#endregion
|
|
261
|
+
exports.allowIpCommand = allowIpCommand;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_commands_aws_ec2_allow_ip_schema = require("./schema.cjs");
|
|
3
|
+
const require_commands_aws_ec2_allow_ip_utils = require("./utils.cjs");
|
|
4
|
+
const require_commands_aws_ec2_allow_ip_handler = require("./handler.cjs");
|
|
5
|
+
exports.DEFAULT_REGION = require_commands_aws_ec2_allow_ip_schema.DEFAULT_REGION;
|
|
6
|
+
exports.DEFAULT_ROAMING_NAME = require_commands_aws_ec2_allow_ip_schema.DEFAULT_ROAMING_NAME;
|
|
7
|
+
exports.SSH_PORT = require_commands_aws_ec2_allow_ip_schema.SSH_PORT;
|
|
8
|
+
exports.allowIpCommand = require_commands_aws_ec2_allow_ip_handler.allowIpCommand;
|
|
9
|
+
exports.allowIpOptionsSchema = require_commands_aws_ec2_allow_ip_schema.allowIpOptionsSchema;
|
|
10
|
+
exports.authorizeRule = require_commands_aws_ec2_allow_ip_utils.authorizeRule;
|
|
11
|
+
exports.describeSecurityGroups = require_commands_aws_ec2_allow_ip_utils.describeSecurityGroups;
|
|
12
|
+
exports.extractRoamingFirstName = require_commands_aws_ec2_allow_ip_utils.extractRoamingFirstName;
|
|
13
|
+
exports.getCurrentPublicIp = require_commands_aws_ec2_allow_ip_utils.getCurrentPublicIp;
|
|
14
|
+
exports.getSecurityGroupDetails = require_commands_aws_ec2_allow_ip_utils.getSecurityGroupDetails;
|
|
15
|
+
exports.instanceLabel = require_commands_aws_ec2_allow_ip_utils.instanceLabel;
|
|
16
|
+
exports.listEnabledRegions = require_commands_aws_ec2_allow_ip_utils.listEnabledRegions;
|
|
17
|
+
exports.listInstances = require_commands_aws_ec2_allow_ip_utils.listInstances;
|
|
18
|
+
exports.listSshIngressRules = require_commands_aws_ec2_allow_ip_utils.listSshIngressRules;
|
|
19
|
+
exports.printSshRules = require_commands_aws_ec2_allow_ip_utils.printSshRules;
|
|
20
|
+
exports.resolveRoamingRule = require_commands_aws_ec2_allow_ip_utils.resolveRoamingRule;
|
|
21
|
+
exports.revokeRule = require_commands_aws_ec2_allow_ip_utils.revokeRule;
|
|
22
|
+
exports.roamingRuleDescription = require_commands_aws_ec2_allow_ip_utils.roamingRuleDescription;
|
|
23
|
+
exports.ruleAlreadyAllowsIp = require_commands_aws_ec2_allow_ip_utils.ruleAlreadyAllowsIp;
|
|
24
|
+
exports.securityGroupLabel = require_commands_aws_ec2_allow_ip_utils.securityGroupLabel;
|
|
25
|
+
exports.sshRuleLabel = require_commands_aws_ec2_allow_ip_utils.sshRuleLabel;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_commands_aws_schema = require("../../schema.cjs");
|
|
3
|
+
let zod = require("zod");
|
|
4
|
+
//#region src/commands/aws/ec2/allow-ip/schema.js
|
|
5
|
+
/**
|
|
6
|
+
* Default region checked first before prompting.
|
|
7
|
+
*/
|
|
8
|
+
const DEFAULT_REGION = "us-east-1";
|
|
9
|
+
/**
|
|
10
|
+
* SSH port managed by this command.
|
|
11
|
+
*/
|
|
12
|
+
const SSH_PORT = 22;
|
|
13
|
+
/**
|
|
14
|
+
* Fallback first name when one cannot be derived from the profile/IAM user.
|
|
15
|
+
*/
|
|
16
|
+
const DEFAULT_ROAMING_NAME = "Declan";
|
|
17
|
+
/**
|
|
18
|
+
* Zod schema for `aws ec2 allow-ip` options.
|
|
19
|
+
*/
|
|
20
|
+
const allowIpOptionsSchema = zod.z.object({
|
|
21
|
+
profile: require_commands_aws_schema.profileField,
|
|
22
|
+
region: require_commands_aws_schema.regionField,
|
|
23
|
+
ruleName: zod.z.string().optional().describe("SSH rule description to update or create (default: \"{FirstName} Roaming\" derived from the profile/IAM user)"),
|
|
24
|
+
verbose: require_commands_aws_schema.verboseField
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {z.infer<typeof allowIpOptionsSchema>} AllowIpOptions
|
|
28
|
+
*/
|
|
29
|
+
//#endregion
|
|
30
|
+
exports.DEFAULT_REGION = DEFAULT_REGION;
|
|
31
|
+
exports.DEFAULT_ROAMING_NAME = DEFAULT_ROAMING_NAME;
|
|
32
|
+
exports.SSH_PORT = SSH_PORT;
|
|
33
|
+
exports.allowIpOptionsSchema = allowIpOptionsSchema;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default region checked first before prompting.
|
|
3
|
+
*/
|
|
4
|
+
export const DEFAULT_REGION: "us-east-1";
|
|
5
|
+
/**
|
|
6
|
+
* SSH port managed by this command.
|
|
7
|
+
*/
|
|
8
|
+
export const SSH_PORT: 22;
|
|
9
|
+
/**
|
|
10
|
+
* Fallback first name when one cannot be derived from the profile/IAM user.
|
|
11
|
+
*/
|
|
12
|
+
export const DEFAULT_ROAMING_NAME: "Declan";
|
|
13
|
+
/**
|
|
14
|
+
* Zod schema for `aws ec2 allow-ip` options.
|
|
15
|
+
*/
|
|
16
|
+
export const allowIpOptionsSchema: z.ZodObject<{
|
|
17
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
18
|
+
region: z.ZodOptional<z.ZodString>;
|
|
19
|
+
ruleName: z.ZodOptional<z.ZodString>;
|
|
20
|
+
verbose: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
verbose: boolean;
|
|
23
|
+
profile?: string | undefined;
|
|
24
|
+
region?: string | undefined;
|
|
25
|
+
ruleName?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
profile?: string | undefined;
|
|
28
|
+
region?: string | undefined;
|
|
29
|
+
verbose?: boolean | undefined;
|
|
30
|
+
ruleName?: string | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
export type AllowIpOptions = z.infer<typeof allowIpOptionsSchema>;
|
|
33
|
+
import { z } from "zod";
|