tombolaltd / ecs-monitor

A simple monitoring solution for Amazon's Elastic Container Service (ECS)
MIT License
60 stars 17 forks source link

Configurable regions #27

Closed dnorth98 closed 6 years ago

dnorth98 commented 6 years ago

This tool is fantastic. Working for a company who deploys a lot of services on ECS, this is a great dashboarding tool.

The only drawback is the region is hard-coded. I've actually tried to make it passable via the environment but while it gets set on the server side, it doesn't get set on the client for some reason. If the region could be passed in (say via AWS_REGION), that would be handy!

marc-costello commented 6 years ago

Hi @dnorth98, thanks for raising this. Before we open sourced this project it was only used in house and only in a single aws region, this (along with similar configurations) is definitely something to address - So good shout!

It's a pretty big blocker so we'll get right on it, unless you have put some work in to this already? If so feel free to put in a pull request.

dnorth98 commented 6 years ago

Thanks Marc! Yeah I played around this morning in a fork and got the region settable for the dev "mode" and added an endpoint to the server to pass the region to the client. I can't for the life of me see how to get the client to call the sever though (I'm a DevOps guy so python is my thing, JavaScript is all new :) ).

Anyway, I will keep on it and hopefully send you a PR. The setting in dev is in my fork so I at least have that to work with :)

Again, fantastic tool!

On Feb 9, 2018 1:37 PM, "Marc Costello" notifications@github.com wrote:

Hi @dnorth98 https://github.com/dnorth98, thanks for raising this. Before we open sourced this project it was only used in house and only in a single aws region, this (along with similar configurations) is definitely something to address - So good shout!

It's a pretty big blocker so we'll get right on it, unless you have put some work in to this already? If so feel free to put in a pull request.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tombolaltd/ecs-monitor/issues/27#issuecomment-364519747, or mute the thread https://github.com/notifications/unsubscribe-auth/AGT2f6L83jM5mlHxhi0z3h8lecY646iXks5tTJBRgaJpZM4SAFq4 .

marc-costello commented 6 years ago

https://github.com/tombolaltd/ecs-monitor/commit/c78dacc91d8781ead00aebb113a48de3c848abb9

It was getting the better of me, so I've added what you need. The region is now configurable by settings an _AWSREGION property in the devCredentials.json for development, and setting an _AWSREGION environment variable for production. i.e.

$ docker run -p 1337:1337 --rm \
    -e AWS_REGION=... \
    -e AWS_ACCESS_KEY_ID=... \
    -e AWS_SECRET_ACCESS_KEY=... \
    ecs-monitor

The server knows which aws region to use by looking for the process.env.AWS_REGION we pass in at runtime. And passes it down to the client in the /authenticate request.

Hope this helps @dnorth98! Let me know if you have any other issues.

dnorth98 commented 6 years ago

You are a STAR Marc. Thanks so much. This is along the lines I was going but being a JS noob, your solution is 1000x cleaner than what I had so far. Thanks again, I'll be putting this on our main dashboard display next week.

On Fri, Feb 9, 2018 at 3:01 PM, Marc Costello notifications@github.com wrote:

Closed #27 https://github.com/tombolaltd/ecs-monitor/issues/27.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tombolaltd/ecs-monitor/issues/27#event-1467406892, or mute the thread https://github.com/notifications/unsubscribe-auth/AGT2f6r5Wm0XjbhYJprYReZ7NcFnkmglks5tTKQVgaJpZM4SAFq4 .

-- Dave North Nerd at large