@mtndev/cli 0.0.0-dev-20260626045346 → 0.0.0-pr-20-20261020022402
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 +86 -1
- package/cjs/__chunks/2FSYDFUV.cjs +146 -0
- package/cjs/__chunks/3A5ZYU5M.cjs +105 -0
- package/cjs/__chunks/3NOHGUCF.cjs +9 -0
- package/cjs/__chunks/3T2LXW7J.cjs +387 -0
- package/cjs/__chunks/4XT5JEAS.cjs +1 -0
- package/cjs/__chunks/AZEB4H4I.cjs +208 -0
- package/cjs/__chunks/B5ENMOCD.cjs +288 -0
- package/cjs/__chunks/B6XM5KSF.cjs +338 -0
- package/cjs/__chunks/BDU2UCE5.cjs +1 -0
- package/cjs/__chunks/BLMSMR5E.cjs +46 -0
- package/cjs/__chunks/CMUD7LLN.cjs +47 -0
- package/cjs/__chunks/DTQ2LB3I.cjs +49 -0
- package/cjs/__chunks/FM5MVRQF.cjs +23 -0
- package/cjs/__chunks/FRHST54J.cjs +135 -0
- package/cjs/__chunks/FU4VP2LN.cjs +1 -0
- package/cjs/__chunks/G5K4PVIL.cjs +26 -0
- package/cjs/__chunks/{NSRFG4DF.cjs → GU3R54MK.cjs} +45 -18
- package/cjs/__chunks/GUL36IFZ.cjs +61 -0
- package/cjs/__chunks/GZMTNK5N.cjs +1 -0
- package/cjs/__chunks/H74JSDBU.cjs +30 -0
- package/cjs/__chunks/{EMMC33QA.cjs → JB7T7PKQ.cjs} +170 -33
- package/cjs/__chunks/JSL2JDMW.cjs +1 -0
- package/cjs/__chunks/K4QNHRTP.cjs +163 -0
- package/cjs/__chunks/KU76LC42.cjs +192 -0
- package/cjs/__chunks/LFDSHANP.cjs +34 -0
- package/cjs/__chunks/LHE24ECK.cjs +192 -0
- package/cjs/__chunks/LIKQ3SI4.cjs +1 -0
- package/cjs/__chunks/LXDF5QVZ.cjs +313 -0
- package/cjs/__chunks/LXOOJR2R.cjs +74 -0
- package/cjs/__chunks/N5MXFOQZ.cjs +167 -0
- package/cjs/__chunks/N7D56LPP.cjs +25 -0
- package/cjs/__chunks/NFXQNOQH.cjs +393 -0
- package/cjs/__chunks/NLKJIUEX.cjs +126 -0
- package/cjs/__chunks/NT2XXAI6.cjs +89 -0
- package/cjs/__chunks/NWZGFHKH.cjs +121 -0
- package/cjs/__chunks/R3GUC7O7.cjs +110 -0
- package/cjs/__chunks/RPVAXPJ4.cjs +1 -0
- package/cjs/__chunks/S3LVCWPN.cjs +23 -0
- package/cjs/__chunks/SBBNW2BF.cjs +249 -0
- package/cjs/__chunks/T2A7TN4F.cjs +81 -0
- package/cjs/__chunks/TKNNDDIB.cjs +97 -0
- package/cjs/__chunks/TNSRDJPR.cjs +1 -0
- package/cjs/__chunks/UWHPE2GI.cjs +20 -0
- package/cjs/__chunks/W6K7BV74.cjs +1 -0
- package/cjs/__chunks/WBOQ6AUN.cjs +320 -0
- package/cjs/__chunks/WHGN5PZI.cjs +299 -0
- package/cjs/__chunks/WOYF2L6T.cjs +11 -0
- package/cjs/__chunks/X26XY2N6.cjs +18 -0
- package/cjs/__chunks/XMKOKRXZ.cjs +16 -0
- package/cjs/__chunks/XTJPQ3EX.cjs +1 -0
- package/cjs/__chunks/YRHFKTW2.cjs +63 -0
- package/cjs/commands/aws/ec2/allow-ip/handler.cjs +12 -0
- package/cjs/commands/aws/ec2/allow-ip/handler.d.ts +6 -0
- package/cjs/commands/aws/ec2/allow-ip/index.cjs +55 -0
- package/cjs/commands/aws/ec2/allow-ip/index.d.ts +3 -0
- package/cjs/commands/aws/ec2/allow-ip/schema.cjs +13 -0
- package/cjs/commands/aws/ec2/allow-ip/schema.d.ts +33 -0
- package/cjs/commands/aws/ec2/allow-ip/utils.cjs +39 -0
- package/cjs/commands/aws/ec2/allow-ip/utils.d.ts +189 -0
- package/cjs/commands/aws/iam/admin-group.cjs +15 -0
- package/cjs/commands/aws/iam/admin-group.d.ts +55 -0
- package/cjs/commands/aws/iam/break-glass/handler.cjs +12 -0
- package/cjs/commands/aws/iam/break-glass/handler.d.ts +7 -0
- package/cjs/commands/aws/iam/break-glass/index.cjs +19 -0
- package/cjs/commands/aws/iam/break-glass/index.d.ts +2 -0
- package/cjs/commands/aws/iam/break-glass/schema.cjs +12 -0
- package/cjs/commands/aws/iam/break-glass/schema.d.ts +25 -0
- package/cjs/commands/aws/iam/check-admin/handler.cjs +10 -0
- package/cjs/commands/aws/iam/check-admin/handler.d.ts +5 -0
- package/cjs/commands/aws/iam/check-admin/index.cjs +17 -0
- package/cjs/commands/aws/iam/check-admin/index.d.ts +2 -0
- package/cjs/commands/aws/iam/check-admin/schema.cjs +12 -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.cjs +28 -0
- package/cjs/commands/aws/iam/policies/sts-federation.cjs +19 -0
- package/cjs/commands/aws/iam/policies/user-admins-deny-list.cjs +183 -0
- package/cjs/commands/aws/iam/policies/user-admins-deny-regions-list.cjs +49 -0
- package/cjs/commands/aws/iam/policies/user-admins-self-service-iam.cjs +64 -0
- package/cjs/commands/aws/iam/policies/user-admins-write-list.cjs +125 -0
- package/cjs/commands/aws/iam/remove-admin/handler.cjs +11 -0
- package/cjs/commands/aws/iam/remove-admin/handler.d.ts +6 -0
- package/cjs/commands/aws/iam/remove-admin/index.cjs +18 -0
- package/cjs/commands/aws/iam/remove-admin/index.d.ts +2 -0
- package/cjs/commands/aws/iam/remove-admin/schema.cjs +12 -0
- package/cjs/commands/aws/iam/remove-admin/schema.d.ts +28 -0
- package/cjs/commands/aws/iam/setup-acl/handler.cjs +14 -0
- package/cjs/commands/aws/iam/setup-acl/handler.d.ts +6 -0
- package/cjs/commands/aws/iam/setup-acl/index.cjs +33 -0
- package/cjs/commands/aws/iam/setup-acl/index.d.ts +3 -0
- package/cjs/commands/aws/iam/setup-acl/schema.cjs +7 -0
- package/cjs/commands/aws/iam/setup-acl/schema.d.ts +24 -0
- package/cjs/commands/aws/iam/setup-acl/utils.cjs +20 -0
- package/cjs/commands/aws/iam/setup-acl/utils.d.ts +61 -0
- package/cjs/commands/aws/iam/users/handler.cjs +12 -0
- package/cjs/commands/aws/iam/users/handler.d.ts +5 -0
- package/cjs/commands/aws/iam/users/index.cjs +41 -0
- package/cjs/commands/aws/iam/users/index.d.ts +3 -0
- package/cjs/commands/aws/iam/users/schema.cjs +7 -0
- package/cjs/commands/aws/iam/users/schema.d.ts +18 -0
- package/cjs/commands/aws/iam/users/utils.cjs +30 -0
- package/cjs/commands/aws/iam/users/utils.d.ts +119 -0
- package/cjs/commands/aws/index.cjs +229 -0
- package/cjs/commands/aws/index.d.ts +14 -0
- package/cjs/commands/aws/route53/add-record/handler.cjs +18 -0
- package/cjs/commands/aws/route53/add-record/handler.d.ts +36 -0
- package/cjs/commands/aws/route53/add-record/index.cjs +57 -0
- package/cjs/commands/aws/route53/add-record/index.d.ts +3 -0
- package/cjs/commands/aws/route53/add-record/schema.cjs +11 -0
- package/cjs/commands/aws/route53/add-record/schema.d.ts +45 -0
- package/cjs/commands/aws/route53/add-record/utils.cjs +37 -0
- package/cjs/commands/aws/route53/add-record/utils.d.ts +216 -0
- package/cjs/commands/aws/route53/remove-record/handler.cjs +14 -0
- package/cjs/commands/aws/route53/remove-record/handler.d.ts +6 -0
- package/cjs/commands/aws/route53/remove-record/index.cjs +18 -0
- package/cjs/commands/aws/route53/remove-record/index.d.ts +2 -0
- package/cjs/commands/aws/route53/remove-record/schema.cjs +8 -0
- package/cjs/commands/aws/route53/remove-record/schema.d.ts +30 -0
- package/cjs/commands/aws/schema.cjs +10 -0
- package/cjs/commands/aws/schema.d.ts +13 -0
- package/cjs/commands/aws/ses/send-email/handler.cjs +12 -0
- package/cjs/commands/aws/ses/send-email/handler.d.ts +5 -0
- package/cjs/commands/aws/ses/send-email/index.cjs +23 -0
- package/cjs/commands/aws/ses/send-email/index.d.ts +3 -0
- package/cjs/commands/aws/ses/send-email/schema.cjs +7 -0
- package/cjs/commands/aws/ses/send-email/schema.d.ts +39 -0
- package/cjs/commands/aws/ses/send-email/utils.cjs +11 -0
- package/cjs/commands/aws/ses/send-email/utils.d.ts +47 -0
- package/cjs/commands/aws/ses/smtp-password.cjs +10 -0
- package/cjs/commands/aws/ses/smtp-password.d.ts +21 -0
- package/cjs/commands/aws/utils/exec-aws.cjs +16 -0
- package/cjs/commands/aws/utils/exec-aws.d.ts +79 -0
- package/cjs/commands/aws/utils/resolve-policy-path.cjs +6 -0
- package/cjs/commands/aws/utils/resolve-policy-path.d.ts +8 -0
- package/cjs/commands/aws/utils/resolve-profile.cjs +11 -0
- package/cjs/commands/aws/utils/resolve-profile.d.ts +28 -0
- package/cjs/commands/aws/utils/tty.cjs +10 -0
- package/cjs/commands/aws/utils/tty.d.ts +24 -0
- package/cjs/commands/db/create-readonly-user/handler.cjs +11 -0
- package/cjs/commands/db/create-readonly-user/handler.d.ts +5 -0
- package/cjs/commands/db/create-readonly-user/index.cjs +40 -0
- package/cjs/commands/db/create-readonly-user/index.d.ts +3 -0
- package/cjs/commands/db/create-readonly-user/mysql.cjs +9 -0
- package/cjs/commands/db/create-readonly-user/mysql.d.ts +33 -0
- package/cjs/commands/db/create-readonly-user/postgres.cjs +9 -0
- package/cjs/commands/db/create-readonly-user/postgres.d.ts +31 -0
- package/cjs/commands/db/create-readonly-user/schema.cjs +12 -0
- package/cjs/commands/db/create-readonly-user/schema.d.ts +55 -0
- package/cjs/commands/db/create-readonly-user/utils.cjs +22 -0
- package/cjs/commands/db/create-readonly-user/utils.d.ts +112 -0
- package/cjs/commands/db/index.cjs +44 -0
- package/cjs/commands/db/index.d.ts +6 -0
- package/cjs/commands/doppler/handler.cjs +6 -4
- package/cjs/commands/doppler/index.cjs +32 -5
- package/cjs/commands/doppler/index.d.ts +1 -0
- package/cjs/commands/doppler/schema.cjs +10 -2
- package/cjs/commands/doppler/schema.d.ts +233 -17
- package/cjs/commands/doppler/set-secret.cjs +19 -0
- package/cjs/commands/doppler/set-secret.d.ts +113 -0
- package/cjs/commands/doppler/utils.cjs +6 -2
- package/cjs/commands/doppler/utils.d.ts +32 -8
- package/cjs/commands/icons/schema.d.ts +1 -1
- package/cjs/commands/index.cjs +91 -12
- package/esm/__chunks/2FTTEFEK.js +97 -0
- package/esm/__chunks/33UYMUQD.js +338 -0
- package/esm/__chunks/3BKWTHLJ.js +25 -0
- package/esm/__chunks/3HE4BEJX.js +105 -0
- package/esm/__chunks/3QLI5BDL.js +387 -0
- package/esm/__chunks/5GIUAFXL.js +89 -0
- package/esm/__chunks/73BJG53F.js +11 -0
- package/esm/__chunks/7VF4Q43Q.js +0 -0
- package/esm/__chunks/AEDEAYF5.js +0 -0
- package/esm/__chunks/AZCP3SFJ.js +0 -0
- package/esm/__chunks/B2DVQ2UL.js +61 -0
- package/esm/__chunks/CVQVHLW5.js +0 -0
- package/esm/__chunks/D62SPZXC.js +0 -0
- package/esm/__chunks/DLEJ25GZ.js +121 -0
- package/esm/__chunks/DMYFNF54.js +192 -0
- package/esm/__chunks/DNFTUMGD.js +23 -0
- package/esm/__chunks/DVKD6YSR.js +49 -0
- package/esm/__chunks/EMSH4P76.js +20 -0
- package/esm/__chunks/FFKFVMIE.js +167 -0
- package/esm/__chunks/FNXUONAV.js +110 -0
- package/esm/__chunks/G4NJHFFU.js +320 -0
- package/esm/__chunks/IEOGAQYI.js +46 -0
- package/esm/__chunks/IZFGBYGE.js +34 -0
- package/esm/__chunks/J34UVKLA.js +26 -0
- package/esm/__chunks/JZPBBBIG.js +74 -0
- package/esm/__chunks/KWUJP5MG.js +135 -0
- package/esm/__chunks/M35URMT4.js +313 -0
- package/esm/__chunks/NF3M2L6C.js +81 -0
- package/esm/__chunks/PNPPDYKC.js +299 -0
- package/esm/__chunks/QFXN4EHM.js +393 -0
- package/esm/__chunks/QKDDLIWD.js +146 -0
- package/esm/__chunks/QSE66AKY.js +208 -0
- package/esm/__chunks/QUF7PS4R.js +18 -0
- package/esm/__chunks/S7IJPJ4R.js +126 -0
- package/esm/__chunks/SD3E3EPH.js +163 -0
- package/esm/__chunks/T3TTUHTW.js +30 -0
- package/esm/__chunks/TIOVE6HR.js +0 -0
- package/esm/__chunks/TXKMEIDQ.js +0 -0
- package/esm/__chunks/U7HAE2RF.js +288 -0
- package/esm/__chunks/UXWY7BYE.js +63 -0
- package/esm/__chunks/VKAKISRG.js +192 -0
- package/esm/__chunks/WD2YR6I7.js +0 -0
- package/esm/__chunks/WOZFZKFY.js +0 -0
- package/esm/__chunks/XI7GZDE2.js +0 -0
- package/esm/__chunks/XOUWDB3T.js +249 -0
- package/esm/__chunks/XQN2TA4S.js +23 -0
- package/esm/__chunks/XXK32TIM.js +16 -0
- package/esm/__chunks/{O262GK4B.js → YGWTVPZE.js} +164 -27
- package/esm/__chunks/{6L5RNR7G.js → YRG7PT33.js} +44 -17
- package/esm/__chunks/ZHKVJO2U.js +47 -0
- package/esm/__chunks/ZO55YUSY.js +9 -0
- package/esm/commands/aws/ec2/allow-ip/handler.d.ts +6 -0
- package/esm/commands/aws/ec2/allow-ip/handler.js +12 -0
- package/esm/commands/aws/ec2/allow-ip/index.d.ts +3 -0
- package/esm/commands/aws/ec2/allow-ip/index.js +55 -0
- package/esm/commands/aws/ec2/allow-ip/schema.d.ts +33 -0
- package/esm/commands/aws/ec2/allow-ip/schema.js +13 -0
- package/esm/commands/aws/ec2/allow-ip/utils.d.ts +189 -0
- package/esm/commands/aws/ec2/allow-ip/utils.js +39 -0
- package/esm/commands/aws/iam/admin-group.d.ts +55 -0
- package/esm/commands/aws/iam/admin-group.js +15 -0
- package/esm/commands/aws/iam/break-glass/handler.d.ts +7 -0
- package/esm/commands/aws/iam/break-glass/handler.js +12 -0
- package/esm/commands/aws/iam/break-glass/index.d.ts +2 -0
- package/esm/commands/aws/iam/break-glass/index.js +19 -0
- package/esm/commands/aws/iam/break-glass/schema.d.ts +25 -0
- package/esm/commands/aws/iam/break-glass/schema.js +12 -0
- package/esm/commands/aws/iam/check-admin/handler.d.ts +5 -0
- package/esm/commands/aws/iam/check-admin/handler.js +10 -0
- package/esm/commands/aws/iam/check-admin/index.d.ts +2 -0
- package/esm/commands/aws/iam/check-admin/index.js +17 -0
- package/esm/commands/aws/iam/check-admin/schema.d.ts +19 -0
- package/esm/commands/aws/iam/check-admin/schema.js +12 -0
- package/esm/commands/aws/iam/policies/s3-restrictions-deny-non-s3-services.js +28 -0
- package/esm/commands/aws/iam/policies/sts-federation.js +19 -0
- package/esm/commands/aws/iam/policies/user-admins-deny-list.js +183 -0
- package/esm/commands/aws/iam/policies/user-admins-deny-regions-list.js +49 -0
- package/esm/commands/aws/iam/policies/user-admins-self-service-iam.js +64 -0
- package/esm/commands/aws/iam/policies/user-admins-write-list.js +125 -0
- package/esm/commands/aws/iam/remove-admin/handler.d.ts +6 -0
- package/esm/commands/aws/iam/remove-admin/handler.js +11 -0
- package/esm/commands/aws/iam/remove-admin/index.d.ts +2 -0
- package/esm/commands/aws/iam/remove-admin/index.js +18 -0
- package/esm/commands/aws/iam/remove-admin/schema.d.ts +28 -0
- package/esm/commands/aws/iam/remove-admin/schema.js +12 -0
- package/esm/commands/aws/iam/setup-acl/handler.d.ts +6 -0
- package/esm/commands/aws/iam/setup-acl/handler.js +14 -0
- package/esm/commands/aws/iam/setup-acl/index.d.ts +3 -0
- package/esm/commands/aws/iam/setup-acl/index.js +33 -0
- package/esm/commands/aws/iam/setup-acl/schema.d.ts +24 -0
- package/esm/commands/aws/iam/setup-acl/schema.js +7 -0
- package/esm/commands/aws/iam/setup-acl/utils.d.ts +61 -0
- package/esm/commands/aws/iam/setup-acl/utils.js +20 -0
- package/esm/commands/aws/iam/users/handler.d.ts +5 -0
- package/esm/commands/aws/iam/users/handler.js +12 -0
- package/esm/commands/aws/iam/users/index.d.ts +3 -0
- package/esm/commands/aws/iam/users/index.js +41 -0
- package/esm/commands/aws/iam/users/schema.d.ts +18 -0
- package/esm/commands/aws/iam/users/schema.js +7 -0
- package/esm/commands/aws/iam/users/utils.d.ts +119 -0
- package/esm/commands/aws/iam/users/utils.js +30 -0
- package/esm/commands/aws/index.d.ts +14 -0
- package/esm/commands/aws/index.js +229 -0
- package/esm/commands/aws/route53/add-record/handler.d.ts +36 -0
- package/esm/commands/aws/route53/add-record/handler.js +18 -0
- package/esm/commands/aws/route53/add-record/index.d.ts +3 -0
- package/esm/commands/aws/route53/add-record/index.js +57 -0
- package/esm/commands/aws/route53/add-record/schema.d.ts +45 -0
- package/esm/commands/aws/route53/add-record/schema.js +11 -0
- package/esm/commands/aws/route53/add-record/utils.d.ts +216 -0
- package/esm/commands/aws/route53/add-record/utils.js +37 -0
- package/esm/commands/aws/route53/remove-record/handler.d.ts +6 -0
- package/esm/commands/aws/route53/remove-record/handler.js +14 -0
- package/esm/commands/aws/route53/remove-record/index.d.ts +2 -0
- package/esm/commands/aws/route53/remove-record/index.js +18 -0
- package/esm/commands/aws/route53/remove-record/schema.d.ts +30 -0
- package/esm/commands/aws/route53/remove-record/schema.js +8 -0
- package/esm/commands/aws/schema.d.ts +13 -0
- package/esm/commands/aws/schema.js +10 -0
- package/esm/commands/aws/ses/send-email/handler.d.ts +5 -0
- package/esm/commands/aws/ses/send-email/handler.js +12 -0
- package/esm/commands/aws/ses/send-email/index.d.ts +3 -0
- package/esm/commands/aws/ses/send-email/index.js +23 -0
- package/esm/commands/aws/ses/send-email/schema.d.ts +39 -0
- package/esm/commands/aws/ses/send-email/schema.js +7 -0
- package/esm/commands/aws/ses/send-email/utils.d.ts +47 -0
- package/esm/commands/aws/ses/send-email/utils.js +11 -0
- package/esm/commands/aws/ses/smtp-password.d.ts +21 -0
- package/esm/commands/aws/ses/smtp-password.js +10 -0
- package/esm/commands/aws/utils/exec-aws.d.ts +79 -0
- package/esm/commands/aws/utils/exec-aws.js +16 -0
- package/esm/commands/aws/utils/resolve-policy-path.d.ts +8 -0
- package/esm/commands/aws/utils/resolve-policy-path.js +6 -0
- package/esm/commands/aws/utils/resolve-profile.d.ts +28 -0
- package/esm/commands/aws/utils/resolve-profile.js +11 -0
- package/esm/commands/aws/utils/tty.d.ts +24 -0
- package/esm/commands/aws/utils/tty.js +10 -0
- package/esm/commands/db/create-readonly-user/handler.d.ts +5 -0
- package/esm/commands/db/create-readonly-user/handler.js +11 -0
- package/esm/commands/db/create-readonly-user/index.d.ts +3 -0
- package/esm/commands/db/create-readonly-user/index.js +40 -0
- package/esm/commands/db/create-readonly-user/mysql.d.ts +33 -0
- package/esm/commands/db/create-readonly-user/mysql.js +9 -0
- package/esm/commands/db/create-readonly-user/postgres.d.ts +31 -0
- package/esm/commands/db/create-readonly-user/postgres.js +9 -0
- package/esm/commands/db/create-readonly-user/schema.d.ts +55 -0
- package/esm/commands/db/create-readonly-user/schema.js +12 -0
- package/esm/commands/db/create-readonly-user/utils.d.ts +112 -0
- package/esm/commands/db/create-readonly-user/utils.js +22 -0
- package/esm/commands/db/index.d.ts +6 -0
- package/esm/commands/db/index.js +44 -0
- package/esm/commands/doppler/handler.js +5 -3
- package/esm/commands/doppler/index.d.ts +1 -0
- package/esm/commands/doppler/index.js +32 -5
- package/esm/commands/doppler/schema.d.ts +233 -17
- package/esm/commands/doppler/schema.js +11 -3
- package/esm/commands/doppler/set-secret.d.ts +113 -0
- package/esm/commands/doppler/set-secret.js +19 -0
- package/esm/commands/doppler/utils.d.ts +32 -8
- package/esm/commands/doppler/utils.js +5 -1
- package/esm/commands/icons/schema.d.ts +1 -1
- package/esm/commands/index.js +86 -7
- package/package.json +13 -3
- package/vitest.config.ts +11 -0
- package/cjs/__chunks/4GFJUCSP.cjs +0 -52
- package/esm/__chunks/X3R5PSWH.js +0 -52
- /package/cjs/__chunks/{WNJ3ZYLI.cjs → 3BY5Y4W7.cjs} +0 -0
- /package/esm/__chunks/{46HGXFME.js → 5ZBVGSOK.js} +0 -0
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _R3GUC7O7cjs = require('./R3GUC7O7.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _CMUD7LLNcjs = require('./CMUD7LLN.cjs');
|
|
8
|
+
|
|
9
|
+
// src/commands/aws/iam/users/utils.js
|
|
10
|
+
var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
|
|
11
|
+
var KNOWN_ROLES = ["read-only", "iam-admin", "power-user"];
|
|
12
|
+
var REQUIRED_ACL_GROUPS = [
|
|
13
|
+
"acl-read-only",
|
|
14
|
+
"acl-iam-full-access",
|
|
15
|
+
"acl-power-users"
|
|
16
|
+
];
|
|
17
|
+
function roleToGroup(role) {
|
|
18
|
+
switch (role) {
|
|
19
|
+
case "read-only":
|
|
20
|
+
return "acl-read-only";
|
|
21
|
+
case "iam-admin":
|
|
22
|
+
return "acl-iam-full-access";
|
|
23
|
+
case "power-user":
|
|
24
|
+
return "acl-power-users";
|
|
25
|
+
default:
|
|
26
|
+
throw new Error(`Unknown role: ${role}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function normalizeSlug(value) {
|
|
30
|
+
return value.toLowerCase().replace(/ /g, "-");
|
|
31
|
+
}
|
|
32
|
+
function isValidSlug(value) {
|
|
33
|
+
return /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(value);
|
|
34
|
+
}
|
|
35
|
+
function buildUsername(params) {
|
|
36
|
+
const { identifier, accountName, role } = params;
|
|
37
|
+
return `md-${identifier}-${accountName}-${role}`;
|
|
38
|
+
}
|
|
39
|
+
function normalizeIdentifier(params) {
|
|
40
|
+
const { raw, accountName, role } = params;
|
|
41
|
+
let identifier = normalizeSlug(raw);
|
|
42
|
+
if (identifier.startsWith("md-")) {
|
|
43
|
+
identifier = identifier.slice(3);
|
|
44
|
+
}
|
|
45
|
+
if (identifier.endsWith(`-${role}`)) {
|
|
46
|
+
identifier = identifier.slice(0, -(role.length + 1));
|
|
47
|
+
} else {
|
|
48
|
+
for (const knownRole of KNOWN_ROLES) {
|
|
49
|
+
if (identifier.endsWith(`-${knownRole}`)) {
|
|
50
|
+
identifier = identifier.slice(0, -(knownRole.length + 1));
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (identifier.endsWith(`-${accountName}`)) {
|
|
56
|
+
identifier = identifier.slice(0, -(accountName.length + 1));
|
|
57
|
+
}
|
|
58
|
+
return identifier;
|
|
59
|
+
}
|
|
60
|
+
function parseMdUsername(name) {
|
|
61
|
+
let value = normalizeSlug(name);
|
|
62
|
+
if (!value.startsWith("md-")) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
value = value.slice(3);
|
|
66
|
+
const rolesByLength = [...KNOWN_ROLES].sort((a, b) => b.length - a.length);
|
|
67
|
+
let role = null;
|
|
68
|
+
for (const knownRole of rolesByLength) {
|
|
69
|
+
if (value.endsWith(`-${knownRole}`)) {
|
|
70
|
+
role = knownRole;
|
|
71
|
+
value = value.slice(0, -(knownRole.length + 1));
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (!role) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const dash = value.indexOf("-");
|
|
79
|
+
if (dash <= 0 || dash === value.length - 1) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
const identifier = value.slice(0, dash);
|
|
83
|
+
const accountName = value.slice(dash + 1);
|
|
84
|
+
if (!isValidSlug(identifier) || !isValidSlug(accountName)) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
return { identifier, accountName, role };
|
|
88
|
+
}
|
|
89
|
+
function inferAccountName(params) {
|
|
90
|
+
const { profile, identity } = params;
|
|
91
|
+
const arn = _nullishCoalesce(_optionalChain([identity, 'optionalAccess', _ => _.Arn]), () => ( ""));
|
|
92
|
+
const username = arn.includes("/") ? _nullishCoalesce(arn.split("/").pop(), () => ( "")) : "";
|
|
93
|
+
for (const candidate of [username, _nullishCoalesce(profile, () => ( ""))]) {
|
|
94
|
+
if (!candidate) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const parsed = parseMdUsername(candidate);
|
|
98
|
+
if (parsed) {
|
|
99
|
+
return parsed.accountName;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
function userExists(params) {
|
|
105
|
+
const { username, profile, verbose } = params;
|
|
106
|
+
try {
|
|
107
|
+
_R3GUC7O7cjs.runAws.call(void 0, {
|
|
108
|
+
profile,
|
|
109
|
+
args: ["iam", "get-user", "--user-name", username],
|
|
110
|
+
verbose
|
|
111
|
+
});
|
|
112
|
+
return true;
|
|
113
|
+
} catch (e) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function ensureUser(params) {
|
|
118
|
+
const { username, profile, verbose } = params;
|
|
119
|
+
if (userExists({ username, profile, verbose })) {
|
|
120
|
+
console.log(` User exists: ${username}`);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
console.log(` Create user: ${username}`);
|
|
124
|
+
_R3GUC7O7cjs.runAws.call(void 0, {
|
|
125
|
+
profile,
|
|
126
|
+
args: ["iam", "create-user", "--user-name", username, "--path", "/"],
|
|
127
|
+
verbose
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function ensureUserInGroup(params) {
|
|
131
|
+
const { username, group, profile, verbose } = params;
|
|
132
|
+
const existing = _R3GUC7O7cjs.runAws.call(void 0, {
|
|
133
|
+
profile,
|
|
134
|
+
args: [
|
|
135
|
+
"iam",
|
|
136
|
+
"get-group",
|
|
137
|
+
"--group-name",
|
|
138
|
+
group,
|
|
139
|
+
"--query",
|
|
140
|
+
`Users[?UserName=='${username}'].UserName`,
|
|
141
|
+
"--output",
|
|
142
|
+
"text"
|
|
143
|
+
],
|
|
144
|
+
expectJson: false,
|
|
145
|
+
verbose
|
|
146
|
+
});
|
|
147
|
+
if (existing) {
|
|
148
|
+
console.log(` Already in group: ${group}`);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
console.log(` Add to group: ${group}`);
|
|
152
|
+
_R3GUC7O7cjs.runAws.call(void 0, {
|
|
153
|
+
profile,
|
|
154
|
+
args: [
|
|
155
|
+
"iam",
|
|
156
|
+
"add-user-to-group",
|
|
157
|
+
"--user-name",
|
|
158
|
+
username,
|
|
159
|
+
"--group-name",
|
|
160
|
+
group
|
|
161
|
+
],
|
|
162
|
+
expectJson: false,
|
|
163
|
+
verbose
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function createCliAccessKey(params) {
|
|
167
|
+
const { username, profile, verbose } = params;
|
|
168
|
+
const keyCountRaw = _R3GUC7O7cjs.runAws.call(void 0, {
|
|
169
|
+
profile,
|
|
170
|
+
args: [
|
|
171
|
+
"iam",
|
|
172
|
+
"list-access-keys",
|
|
173
|
+
"--user-name",
|
|
174
|
+
username,
|
|
175
|
+
"--query",
|
|
176
|
+
"length(AccessKeyMetadata)",
|
|
177
|
+
"--output",
|
|
178
|
+
"text"
|
|
179
|
+
],
|
|
180
|
+
expectJson: false,
|
|
181
|
+
verbose
|
|
182
|
+
});
|
|
183
|
+
const keyCount = Number.parseInt(keyCountRaw, 10) || 0;
|
|
184
|
+
if (keyCount >= 2) {
|
|
185
|
+
console.log(
|
|
186
|
+
_chalk2.default.yellow(
|
|
187
|
+
` WARNING: ${username} already has 2 access keys (AWS max).`
|
|
188
|
+
)
|
|
189
|
+
);
|
|
190
|
+
console.log(
|
|
191
|
+
_chalk2.default.yellow(" Delete an existing key before creating a new one.")
|
|
192
|
+
);
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
const created = _R3GUC7O7cjs.runAws.call(void 0, {
|
|
196
|
+
profile,
|
|
197
|
+
args: [
|
|
198
|
+
"iam",
|
|
199
|
+
"create-access-key",
|
|
200
|
+
"--user-name",
|
|
201
|
+
username,
|
|
202
|
+
"--query",
|
|
203
|
+
"AccessKey.[AccessKeyId,SecretAccessKey]",
|
|
204
|
+
"--output",
|
|
205
|
+
"text"
|
|
206
|
+
],
|
|
207
|
+
expectJson: false,
|
|
208
|
+
verbose
|
|
209
|
+
});
|
|
210
|
+
const [accessKeyId, secretAccessKey] = created.split(/\s+/);
|
|
211
|
+
if (!accessKeyId || !secretAccessKey) {
|
|
212
|
+
throw new Error("Failed to parse the newly created access key");
|
|
213
|
+
}
|
|
214
|
+
const setupCmd = ` export AWS_ACCESS_KEY_ID='${accessKeyId}' AWS_SECRET_ACCESS_KEY='${secretAccessKey}' && aws-vault add ${username} --env --add-config && aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" --profile ${username} && aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" --profile ${username} && aws configure set region us-east-1 --profile ${username}`;
|
|
215
|
+
console.log("");
|
|
216
|
+
console.log(
|
|
217
|
+
` CLI credentials for ${username} (secret shown once \u2014 copy now):`
|
|
218
|
+
);
|
|
219
|
+
console.log(
|
|
220
|
+
" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
|
|
221
|
+
);
|
|
222
|
+
console.log(
|
|
223
|
+
" YOU MUST run the command below with a LEADING SPACE so it is not saved"
|
|
224
|
+
);
|
|
225
|
+
console.log(' to shell history \u2014 same idea as: TEST="a" && echo $TEST');
|
|
226
|
+
console.log("");
|
|
227
|
+
console.log(setupCmd);
|
|
228
|
+
console.log(
|
|
229
|
+
" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
|
|
230
|
+
);
|
|
231
|
+
console.log("");
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
function ensureAclGroupsExist(params) {
|
|
235
|
+
const { profile, verbose } = params;
|
|
236
|
+
const missing = REQUIRED_ACL_GROUPS.filter((group) => {
|
|
237
|
+
try {
|
|
238
|
+
_R3GUC7O7cjs.runAws.call(void 0, {
|
|
239
|
+
profile,
|
|
240
|
+
args: ["iam", "get-group", "--group-name", group],
|
|
241
|
+
verbose
|
|
242
|
+
});
|
|
243
|
+
return false;
|
|
244
|
+
} catch (e2) {
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
if (missing.length > 0) {
|
|
249
|
+
missing.forEach((group) => console.log(` Missing group: ${group}`));
|
|
250
|
+
console.log("");
|
|
251
|
+
console.log(
|
|
252
|
+
" Run `mtn aws iam setup-acl` first to create ACL groups and policies."
|
|
253
|
+
);
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
async function promptAccountName(params) {
|
|
259
|
+
const { accountName, inferredAccountName } = params;
|
|
260
|
+
if (accountName) {
|
|
261
|
+
const slug = normalizeSlug(accountName);
|
|
262
|
+
if (isValidSlug(slug)) {
|
|
263
|
+
console.log(` Account name: ${slug}`);
|
|
264
|
+
return slug;
|
|
265
|
+
}
|
|
266
|
+
console.log(" Invalid account name option \u2014 falling back to prompt.");
|
|
267
|
+
}
|
|
268
|
+
const defaultSlug = inferredAccountName && isValidSlug(normalizeSlug(inferredAccountName)) ? normalizeSlug(inferredAccountName) : null;
|
|
269
|
+
for (; ; ) {
|
|
270
|
+
const hint = defaultSlug ? ` [default: ${defaultSlug}]` : " (e.g. vincent)";
|
|
271
|
+
const raw = await _CMUD7LLNcjs.prompt.call(void 0,
|
|
272
|
+
` AWS account name${hint} \u2014 used in md-{identifier}-{account}-{role}: `
|
|
273
|
+
);
|
|
274
|
+
if (raw === "" && defaultSlug) {
|
|
275
|
+
console.log(` \u2192 account name: ${defaultSlug}`);
|
|
276
|
+
return defaultSlug;
|
|
277
|
+
}
|
|
278
|
+
const slug = normalizeSlug(raw);
|
|
279
|
+
if (isValidSlug(slug)) {
|
|
280
|
+
if (raw !== slug) {
|
|
281
|
+
console.log(` \u2192 account name: ${slug}`);
|
|
282
|
+
}
|
|
283
|
+
return slug;
|
|
284
|
+
}
|
|
285
|
+
console.log(
|
|
286
|
+
" Invalid account name \u2014 use lowercase letters, numbers, and hyphens" + (defaultSlug ? ", or press Enter to accept the default." : ".")
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
async function promptRole() {
|
|
291
|
+
for (; ; ) {
|
|
292
|
+
console.log(" Role (username will be md-{identifier}-{account}-{role}):");
|
|
293
|
+
console.log(" 1) read-only \u2192 acl-read-only");
|
|
294
|
+
console.log(" 2) iam-admin \u2192 acl-iam-full-access");
|
|
295
|
+
console.log(" 3) power-user \u2192 acl-power-users");
|
|
296
|
+
const choice = await _CMUD7LLNcjs.prompt.call(void 0, " Choice [1-3]: ");
|
|
297
|
+
switch (choice) {
|
|
298
|
+
case "1":
|
|
299
|
+
case "read-only":
|
|
300
|
+
return "read-only";
|
|
301
|
+
case "2":
|
|
302
|
+
case "iam-admin":
|
|
303
|
+
return "iam-admin";
|
|
304
|
+
case "3":
|
|
305
|
+
case "power-user":
|
|
306
|
+
return "power-user";
|
|
307
|
+
default:
|
|
308
|
+
console.log(" Invalid choice \u2014 enter 1, 2, 3, or the role name.");
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
async function promptIdentifier(params) {
|
|
313
|
+
const { accountName, role } = params;
|
|
314
|
+
const exampleUser = buildUsername({
|
|
315
|
+
identifier: "declan",
|
|
316
|
+
accountName,
|
|
317
|
+
role
|
|
318
|
+
});
|
|
319
|
+
for (; ; ) {
|
|
320
|
+
const raw = await _CMUD7LLNcjs.prompt.call(void 0,
|
|
321
|
+
` Identifier (e.g. declan, or full ${exampleUser}): `
|
|
322
|
+
);
|
|
323
|
+
const lowerRaw = normalizeSlug(raw);
|
|
324
|
+
const identifier = normalizeIdentifier({ raw, accountName, role });
|
|
325
|
+
if (isValidSlug(identifier)) {
|
|
326
|
+
if (lowerRaw !== identifier) {
|
|
327
|
+
console.log(` \u2192 parsed identifier: ${identifier}`);
|
|
328
|
+
}
|
|
329
|
+
return identifier;
|
|
330
|
+
}
|
|
331
|
+
console.log(
|
|
332
|
+
" Invalid identifier \u2014 use lowercase letters, numbers, and hyphens."
|
|
333
|
+
);
|
|
334
|
+
console.log(" Tip: enter just the short name (e.g. declan).");
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
async function createUsersInteractive(params) {
|
|
338
|
+
const { accountName: accountNameOption, profile, identity, verbose } = params;
|
|
339
|
+
if (!ensureAclGroupsExist({ profile, verbose })) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
console.log("");
|
|
343
|
+
const inferredAccountName = inferAccountName({ profile, identity });
|
|
344
|
+
const accountName = await promptAccountName({
|
|
345
|
+
accountName: accountNameOption,
|
|
346
|
+
inferredAccountName
|
|
347
|
+
});
|
|
348
|
+
console.log("");
|
|
349
|
+
while (await _CMUD7LLNcjs.promptYesNo.call(void 0, { message: " Create another user?", defaultYes: false })) {
|
|
350
|
+
console.log("");
|
|
351
|
+
const role = await promptRole();
|
|
352
|
+
const identifier = await promptIdentifier({ accountName, role });
|
|
353
|
+
const username = buildUsername({ identifier, accountName, role });
|
|
354
|
+
const group = roleToGroup(role);
|
|
355
|
+
console.log("");
|
|
356
|
+
console.log(` \u2192 user: ${username}`);
|
|
357
|
+
console.log(` \u2192 group: ${group}`);
|
|
358
|
+
console.log("");
|
|
359
|
+
ensureUser({ username, profile, verbose });
|
|
360
|
+
ensureUserInGroup({ username, group, profile, verbose });
|
|
361
|
+
try {
|
|
362
|
+
createCliAccessKey({ username, profile, verbose });
|
|
363
|
+
} catch (error) {
|
|
364
|
+
console.log(
|
|
365
|
+
_chalk2.default.yellow(
|
|
366
|
+
` Could not create access key: ${error instanceof Error ? error.message : String(error)}`
|
|
367
|
+
)
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
console.log("");
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
exports.roleToGroup = roleToGroup; exports.normalizeSlug = normalizeSlug; exports.isValidSlug = isValidSlug; exports.buildUsername = buildUsername; exports.normalizeIdentifier = normalizeIdentifier; exports.parseMdUsername = parseMdUsername; exports.inferAccountName = inferAccountName; exports.ensureUser = ensureUser; exports.ensureUserInGroup = ensureUserInGroup; exports.createCliAccessKey = createCliAccessKey; exports.ensureAclGroupsExist = ensureAclGroupsExist; exports.createUsersInteractive = createUsersInteractive;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
var _WHGN5PZIcjs = require('./WHGN5PZI.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _NLKJIUEXcjs = require('./NLKJIUEX.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _KU76LC42cjs = require('./KU76LC42.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _N5MXFOQZcjs = require('./N5MXFOQZ.cjs');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _LXOOJR2Rcjs = require('./LXOOJR2R.cjs');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var _LHE24ECKcjs = require('./LHE24ECK.cjs');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var _2FSYDFUVcjs = require('./2FSYDFUV.cjs');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
var _WBOQ6AUNcjs = require('./WBOQ6AUN.cjs');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var _TKNNDDIBcjs = require('./TKNNDDIB.cjs');
|
|
28
|
+
|
|
29
|
+
// src/commands/aws/index.js
|
|
30
|
+
function collect(value, previous) {
|
|
31
|
+
return [...previous, value];
|
|
32
|
+
}
|
|
33
|
+
function registerAwsCommands(program) {
|
|
34
|
+
const aws = program.command("aws").summary("AWS operational commands (IAM, EC2, SES, Route53)").description("AWS operational commands for IAM, EC2, SES, and Route53");
|
|
35
|
+
const iam = aws.command("iam").summary("IAM ACL group and user management").description("IAM ACL group and user management");
|
|
36
|
+
iam.command("setup-acl").summary("Create ACL groups, policies, and (optionally) users").description(
|
|
37
|
+
"Idempotently create the ACL groups and managed policies, attach them per group, and optionally create IAM users."
|
|
38
|
+
).option(
|
|
39
|
+
"--restrict-regions <yes|no>",
|
|
40
|
+
"Attach the region restriction to acl-power-users (skips the prompt)"
|
|
41
|
+
).option(
|
|
42
|
+
"--no-create-users",
|
|
43
|
+
"Skip IAM user creation after configuring groups"
|
|
44
|
+
).option("-p, --profile <profile>", "AWS profile (defaults to AWS_PROFILE)").option("-r, --region <region>", "AWS region").option("-v, --verbose", "Enable verbose logging").action(async (options) => {
|
|
45
|
+
await _LHE24ECKcjs.setupAclCommand.call(void 0, {
|
|
46
|
+
restrictRegions: options.restrictRegions,
|
|
47
|
+
createUsers: options.createUsers,
|
|
48
|
+
profile: options.profile,
|
|
49
|
+
region: options.region,
|
|
50
|
+
verbose: _nullishCoalesce(options.verbose, () => ( false))
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
iam.command("users").summary("Interactively create IAM users and assign ACL groups").description(
|
|
54
|
+
"Interactively create md-{identifier}-{account}-{role} IAM users, assign ACL groups, and print CLI setup commands."
|
|
55
|
+
).option(
|
|
56
|
+
"--account-name <slug>",
|
|
57
|
+
"AWS account slug used in md-{identifier}-{account}-{role}"
|
|
58
|
+
).option("-p, --profile <profile>", "AWS profile (defaults to AWS_PROFILE)").option("-v, --verbose", "Enable verbose logging").action(async (options) => {
|
|
59
|
+
await _LXOOJR2Rcjs.usersCommand.call(void 0, {
|
|
60
|
+
accountName: options.accountName,
|
|
61
|
+
profile: options.profile,
|
|
62
|
+
verbose: _nullishCoalesce(options.verbose, () => ( false))
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
iam.command("check-admin").summary("Alert if anyone is in acl-admin-do-not-use").description(
|
|
66
|
+
"Scan one profile (--profile or AWS_PROFILE) or all aws-vault profiles (--all) for members of the break-glass acl-admin-do-not-use group."
|
|
67
|
+
).option(
|
|
68
|
+
"-p, --profile <profile>",
|
|
69
|
+
"Operate on this profile (defaults to AWS_PROFILE)"
|
|
70
|
+
).option(
|
|
71
|
+
"--all",
|
|
72
|
+
"Scan every aws-vault profile (default when no profile is set)"
|
|
73
|
+
).option("-v, --verbose", "Show skipped profiles and detailed errors").action(async (options) => {
|
|
74
|
+
await _NLKJIUEXcjs.checkAdminCommand.call(void 0, {
|
|
75
|
+
profile: options.profile,
|
|
76
|
+
all: _nullishCoalesce(options.all, () => ( false)),
|
|
77
|
+
verbose: _nullishCoalesce(options.verbose, () => ( false))
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
iam.command("remove-admin").summary("Remove users from the acl-admin-do-not-use group").description(
|
|
81
|
+
"Remove break-glass admin access by removing users from acl-admin-do-not-use, for one profile (--profile or AWS_PROFILE) or every aws-vault profile (--all)."
|
|
82
|
+
).option(
|
|
83
|
+
"-p, --profile <profile>",
|
|
84
|
+
"Operate on this profile (defaults to AWS_PROFILE)"
|
|
85
|
+
).option(
|
|
86
|
+
"--all",
|
|
87
|
+
"Scan every aws-vault profile (default when no profile is set)"
|
|
88
|
+
).option(
|
|
89
|
+
"--user <name>",
|
|
90
|
+
"Only remove this user (repeatable); default removes all",
|
|
91
|
+
collect,
|
|
92
|
+
[]
|
|
93
|
+
).option("-y, --yes", "Skip the per-profile confirmation prompt").option("--dry-run", "Preview removals without changing anything").option("-v, --verbose", "Show skipped profiles and detailed errors").action(async (options) => {
|
|
94
|
+
await _N5MXFOQZcjs.removeAdminCommand.call(void 0, {
|
|
95
|
+
profile: options.profile,
|
|
96
|
+
all: _nullishCoalesce(options.all, () => ( false)),
|
|
97
|
+
user: _nullishCoalesce(options.user, () => ( [])),
|
|
98
|
+
yes: _nullishCoalesce(options.yes, () => ( false)),
|
|
99
|
+
dryRun: _nullishCoalesce(options.dryRun, () => ( false)),
|
|
100
|
+
verbose: _nullishCoalesce(options.verbose, () => ( false))
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
iam.command("break-glass").summary("Grant break-glass admin access (acl-admin-do-not-use)").description(
|
|
104
|
+
"Grant break-glass AdministratorAccess by adding a user to acl-admin-do-not-use for one profile. Defaults to your own IAM user."
|
|
105
|
+
).option("-p, --profile <profile>", "AWS profile (defaults to AWS_PROFILE)").option(
|
|
106
|
+
"--user <name>",
|
|
107
|
+
"Grant to this user (repeatable); default is your own IAM user",
|
|
108
|
+
collect,
|
|
109
|
+
[]
|
|
110
|
+
).option("-y, --yes", "Skip the confirmation prompt").option("--dry-run", "Preview the grant without changing anything").option("-v, --verbose", "Show detailed errors").action(async (options) => {
|
|
111
|
+
await _KU76LC42cjs.breakGlassCommand.call(void 0, {
|
|
112
|
+
profile: options.profile,
|
|
113
|
+
user: _nullishCoalesce(options.user, () => ( [])),
|
|
114
|
+
yes: _nullishCoalesce(options.yes, () => ( false)),
|
|
115
|
+
dryRun: _nullishCoalesce(options.dryRun, () => ( false)),
|
|
116
|
+
verbose: _nullishCoalesce(options.verbose, () => ( false))
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
const ec2 = aws.command("ec2").summary("EC2 operational commands").description("EC2 operational commands");
|
|
120
|
+
ec2.command("allow-ip").summary("Allow your current public IP for SSH on an EC2 security group").description(
|
|
121
|
+
"Update or create a named roaming SSH rule (port 22) for your current public IP on a chosen EC2 instance security group."
|
|
122
|
+
).option("-p, --profile <profile>", "AWS profile (defaults to AWS_PROFILE)").option("-r, --region <region>", "AWS region").option(
|
|
123
|
+
"--rule-name <name>",
|
|
124
|
+
'SSH rule description (default: "{FirstName} Roaming")'
|
|
125
|
+
).option("-v, --verbose", "Enable verbose logging").action(async (options) => {
|
|
126
|
+
await _WHGN5PZIcjs.allowIpCommand.call(void 0, {
|
|
127
|
+
profile: options.profile,
|
|
128
|
+
region: options.region,
|
|
129
|
+
ruleName: options.ruleName,
|
|
130
|
+
verbose: _nullishCoalesce(options.verbose, () => ( false))
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
const route53 = aws.command("route53").summary("Route53 DNS commands").description("Route53 DNS commands");
|
|
134
|
+
route53.command("add-record").summary("Interactively add or update a DNS record").description(
|
|
135
|
+
"Add or update a Route53 resource record set. Prompts for hosted zone, type, name, and value when not passed as flags. Shows whether the change creates, overwrites, or appends to an existing record."
|
|
136
|
+
).option("-p, --profile <profile>", "AWS profile (defaults to AWS_PROFILE)").option(
|
|
137
|
+
"-z, --zone <name-or-id>",
|
|
138
|
+
"Hosted zone name or ID (e.g. mountaindev.com)"
|
|
139
|
+
).option(
|
|
140
|
+
"-t, --type <type>",
|
|
141
|
+
"Record type (A, AAAA, CNAME, TXT, MX, NS, SRV, CAA)"
|
|
142
|
+
).option(
|
|
143
|
+
"-n, --name <name>",
|
|
144
|
+
'Record name relative to the zone (e.g. "redline") or FQDN'
|
|
145
|
+
).option("--value <value>", "Record value (e.g. CNAME target)").option(
|
|
146
|
+
"--ttl <seconds>",
|
|
147
|
+
"TTL in seconds (default: 300)",
|
|
148
|
+
(value) => Number.parseInt(value, 10)
|
|
149
|
+
).option("-y, --yes", "Skip the confirmation prompt").option("--dry-run", "Preview the change without calling Route53").option("-v, --verbose", "Enable verbose logging").action(async (options) => {
|
|
150
|
+
await _WBOQ6AUNcjs.addRecordCommand.call(void 0, {
|
|
151
|
+
profile: options.profile,
|
|
152
|
+
zone: options.zone,
|
|
153
|
+
type: options.type,
|
|
154
|
+
name: options.name,
|
|
155
|
+
value: options.value,
|
|
156
|
+
ttl: options.ttl,
|
|
157
|
+
yes: _nullishCoalesce(options.yes, () => ( false)),
|
|
158
|
+
dryRun: _nullishCoalesce(options.dryRun, () => ( false)),
|
|
159
|
+
verbose: _nullishCoalesce(options.verbose, () => ( false))
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
route53.command("remove-record").summary("Interactively delete a DNS record").description(
|
|
163
|
+
"Delete a Route53 resource record set. Prompts for hosted zone, type, and name when not passed as flags, shows the record it found, and confirms before deleting."
|
|
164
|
+
).option("-p, --profile <profile>", "AWS profile (defaults to AWS_PROFILE)").option(
|
|
165
|
+
"-z, --zone <name-or-id>",
|
|
166
|
+
"Hosted zone name or ID (e.g. mountaindev.com)"
|
|
167
|
+
).option(
|
|
168
|
+
"-t, --type <type>",
|
|
169
|
+
"Record type (A, AAAA, CNAME, TXT, MX, NS, SRV, CAA)"
|
|
170
|
+
).option(
|
|
171
|
+
"-n, --name <name>",
|
|
172
|
+
'Record name relative to the zone (e.g. "redline") or FQDN'
|
|
173
|
+
).option("-y, --yes", "Skip the confirmation prompt").option("--dry-run", "Preview the deletion without calling Route53").option("-v, --verbose", "Enable verbose logging").action(async (options) => {
|
|
174
|
+
await _2FSYDFUVcjs.removeRecordCommand.call(void 0, {
|
|
175
|
+
profile: options.profile,
|
|
176
|
+
zone: options.zone,
|
|
177
|
+
type: options.type,
|
|
178
|
+
name: options.name,
|
|
179
|
+
yes: _nullishCoalesce(options.yes, () => ( false)),
|
|
180
|
+
dryRun: _nullishCoalesce(options.dryRun, () => ( false)),
|
|
181
|
+
verbose: _nullishCoalesce(options.verbose, () => ( false))
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
const ses = aws.command("ses").summary("SES operational commands").description("SES operational commands");
|
|
185
|
+
ses.command("send-email").summary("Send a test email via SES (API or SMTP)").description(
|
|
186
|
+
"Send a single test email through the SES API (default) or the SES SMTP endpoint."
|
|
187
|
+
).requiredOption("--to <address>", "Recipient email address").requiredOption("--from <address>", "Verified SES sender email address").option("--subject <subject>", "Email subject line").option("--body <body>", "Email body (defaults to a timestamp and token)").option("--transport <api|smtp>", "Send via SES API or SES SMTP", "api").option("-r, --region <region>", "AWS region for SES", "us-east-1").option("-p, --profile <profile>", "AWS profile for api transport").option(
|
|
188
|
+
"--access-key-id <id>",
|
|
189
|
+
"IAM access key ID used as the SMTP username (smtp transport)"
|
|
190
|
+
).option("--dry-run", "Print the email payload without sending").option("-v, --verbose", "Enable verbose logging").action(async (options) => {
|
|
191
|
+
await _TKNNDDIBcjs.sendEmailCommand.call(void 0, {
|
|
192
|
+
to: options.to,
|
|
193
|
+
from: options.from,
|
|
194
|
+
subject: options.subject,
|
|
195
|
+
body: options.body,
|
|
196
|
+
transport: options.transport,
|
|
197
|
+
region: options.region,
|
|
198
|
+
profile: options.profile,
|
|
199
|
+
accessKeyId: options.accessKeyId,
|
|
200
|
+
dryRun: _nullishCoalesce(options.dryRun, () => ( false)),
|
|
201
|
+
verbose: _nullishCoalesce(options.verbose, () => ( false))
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
exports.registerAwsCommands = registerAwsCommands;
|