sfolador / ecs-manage
Easily manage your ECS Cluster with this simple artisan command
Requires
- php: ^8.1
- aws/aws-sdk-php-laravel: ^3.8
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-10-16 10:07:37 UTC
README
Easily manage your ECS Cluster with this simple artisan command
This package allows you to easily manage your ECS Cluster with a simple artisan command.
Requirements
You can use this package with Laravel 10.x, and you should have the AWS CLI installed and configured.
Please check if your AWS CLI is configured with the correct region and credentials.
Refer to this link: https://docs.aws.amazon.com/cli/v1/userguide/install-macos.html if you need more information on that specific subject.
Installation
You can install the package via composer:
composer require sfolador/ecs-manage
You can publish the config file with:
php artisan vendor:publish --tag="ecs-manage-config"
This is the contents of the published config file:
return [ 'environments' => [ 'staging', 'production', ], 'default_terminal' => 'iTerm' ];
Usage
php artisan ecs:manage
you will see an output that looks like this:
Select a cluster [mycluster-ecs]: [0] mycluster-ecs
You should select the cluster you want to use. After selecting a cluster you should select and "environment":
Select an environment: [0] staging [1] production
These options can be customized in the config file and will act as a filter on services. Once you select an "environment", you will see a list of services that match the selected "environment".
So, for example, if you selected "staging", the list of services will be:
This works very well if you have a naming convention for your services.
Select a service [sfolador-zero-staging-FARGATE]: [0 ] sfolador-zero-staging-FARGATE [1 ] sfolador-one-staging-FARGATE [2 ] sfolador-two-staging-FARGATE [3 ] sfolador-three-staging-EC2
Select a service and you will see a list of tasks that match the selected service:
Select a task [xxxxxxxxxxxxxx]: [0] xxxxxxxxxxxxxx
Once you select a task, a terminal window will open and will try to connect to the selected task. The command that will launched in the terminal window is:
aws ecs execute-command --region SELECTED_AWS_REGION --cluster SELECTED_CLUSTER --task SELECTED_TASK --command \"/bin/sh\" --interactive
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.