-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned cluster output. Added install script. Removed goterm dep
- Loading branch information
1 parent
19283a7
commit b13aa37
Showing
5 changed files
with
123 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ _testmain.go | |
*.prof | ||
|
||
vendor/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,52 @@ | ||
# go-ecs | ||
A go utility for viewing status/config of AWS ECS cluster(s) | ||
|
||
go-ecs is a simple command line utility to view [AWS ECS](https://aws.amazon.com/ecs/) cluster status quickly. | ||
|
||
## Installation | ||
|
||
On OS X or Linux: | ||
|
||
``` | ||
curl https://raw.githubusercontent.com/colinmutter/go-ecs/master/install.sh | sh | ||
``` | ||
|
||
On Windows download [binary](https://github.com/colinmutter/go-ecs/releases). | ||
|
||
## Usage | ||
|
||
``` | ||
go-ecs [options] | ||
-p profile aws profile name | ||
``` | ||
|
||
## Configuration | ||
An IAM Policy will need to be created, or the following permissions granted to allow this utility to function. | ||
|
||
``` | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Action": [ | ||
"ecs:DescribeClusters", | ||
"ecs:DescribeContainerInstances", | ||
"ecs:DescribeServices", | ||
"ecs:DescribeTaskDefinition", | ||
"ecs:DescribeTasks", | ||
"ecs:DiscoverPollEndpoint", | ||
"ecs:ListClusters", | ||
"ecs:ListContainerInstances", | ||
"ecs:ListServices", | ||
"ecs:ListTaskDefinitions", | ||
"ecs:ListTasks", | ||
"ecs:Poll", | ||
"ec2:DescribeInstances" | ||
], | ||
"Resource": [ | ||
"*" | ||
] | ||
} | ||
] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
|
||
install () { | ||
|
||
set -eu | ||
|
||
PROJECT="go-ecs" | ||
REPO="colinmutter/go-ecs" | ||
|
||
GITHUB_URL="https://github.com/${REPO}" | ||
RELEASES_URL="${GITHUB_URL}/releases" | ||
UNAME=$(uname) | ||
if [ "$UNAME" != "Linux" -a "$UNAME" != "Darwin" ] ; then | ||
echo "Sorry, OS not supported: ${UNAME}. Download binary from ${RELEASES_URL}" | ||
exit 1 | ||
fi | ||
|
||
if [ "$UNAME" = "Darwin" ] ; then | ||
OSX_ARCH=$(uname -m) | ||
if [ "${OSX_ARCH}" = "x86_64" ] ; then | ||
PLATFORM="darwin_amd64" | ||
else | ||
echo "Sorry, architecture not supported: ${OSX_ARCH}. Download binary from ${RELEASES_URL}" | ||
exit 1 | ||
fi | ||
elif [ "$UNAME" = "Linux" ] ; then | ||
LINUX_ARCH=$(uname -m) | ||
if [ "${LINUX_ARCH}" = "i686" ] ; then | ||
PLATFORM="linux_386" | ||
elif [ "${LINUX_ARCH}" = "x86_64" ] ; then | ||
PLATFORM="linux_amd64" | ||
else | ||
echo "Sorry, architecture not supported: ${LINUX_ARCH}. Download binary from ${RELEASES_URL}" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
LATEST=$(curl -s https://api.github.com/repos/${REPO}/tags | grep name | head -n 1 | sed 's/[," ]//g' | cut -d ':' -f 2) | ||
URL="${RELEASES_URL}/download/$LATEST/${PROJECT}_$PLATFORM" | ||
|
||
curl -sL ${RELEASES_URL}/download/$LATEST/${PROJECT}_$PLATFORM -o /usr/local/bin/${PROJECT} | ||
chmod +x $_ | ||
|
||
} | ||
|
||
install |