Skip to content

Commit

Permalink
feature: Add Paas, Cloud - Services and Tunnel Commands
Browse files Browse the repository at this point in the history
  • Loading branch information
winstonnolan-spryker committed Sep 10, 2024
1 parent 4e9cd42 commit 2f2cd02
Show file tree
Hide file tree
Showing 4 changed files with 772 additions and 0 deletions.
45 changes: 45 additions & 0 deletions bin/command/paas/commands.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
Registry::Help::section "Paas | Cloud:"
Registry::Help::row "" "${HELP_DESC}The AWS CLI is ${WARN}required${NC} for Paas | Cloud Commands${NC}"
Registry::Help::row "" "${HELP_DESC}The AWS Session Manager plugin for the AWS CLI is ${WARN}required${NC} for Paas | Cloud Commands. See https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html${NC}"
Registry::Help::row "" "${HELP_DESC}AWS Session Tokens and AWS Region are ${WARN}required${NC} for Paas | Cloud Commands. See https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html${NC}"
Registry::Help::section "Commands:"
Registry::addCommand "cloud" "Command::paas"
Registry::addCommand "paas" "Command::paas"

Registry::Help::command -s -c "paas | cloud get-region" "List AWS Region set in your shell"
Registry::Help::command -s -c "paas | cloud environments" "List Paas Environments"
Registry::Help::command -s -c "paas | cloud service-details --environment=ENVIRONMENT_NAME" -a "service [database storage ..]" "List Paas Environment Service Details. See output from environments command. Services: database database-ro-replica storage search scheduler broker"
Registry::Help::command -s -c "paas | cloud create-tunnel --environment=ENVIRONMENT_NAME" -a "service [database storage ..]" "Create AWS SSM Tunnels to one or more Paas Environment Services. See output from environments command. Services: database database-ro-replica storage search scheduler broker"
Registry::Help::command -s -c "paas | cloud close-tunnel" -a "service [database storage ..]" "Close ALL Active AWS SSM Tunnels for Service. Services: database database-ro-replica storage search scheduler broker"
Registry::Help::command -s -c "paas | cloud tunnels" "List ALL Active AWS SSM Tunnels"

function Command::paas() {

subCommand=${1}
case ${subCommand} in
get-region)
Paas::get-region
;;
environments)
Paas::environments
;;
service-details)
Paas::service-details "${@}"
;;
create-tunnel)
Paas::create-tunnel "${@}"
;;
close-tunnel)
Paas::close-tunnel "${@}"
;;
tunnels)
Paas::tunnels
;;
*)
Console::error "Unknown option '${subCommand}'"
exit 1
esac

return "${TRUE}"
}
Loading

0 comments on commit 2f2cd02

Please sign in to comment.