zalando-stups / lizzy

REST Service to deploy AWS CloudFormation templates using Senza
Apache License 2.0
21 stars 17 forks source link

added endpoint for a stack's request count (#221) #222

Closed f-sander closed 6 years ago

f-sander commented 6 years ago

This PR addresses this issue #221:

In a Jenkins Pipeline, I want to block the deletion of a stack until it receives no more traffic. The usage of DNS weights for this is insufficient as callers might use long lived connections.

The metric I'm looking at is RequestCount for load balancers in AWS CloudWatch.

A new service lizzy.app.AWS is introduced here that wraps some functionality of boto3 for convenience. In particular, this service provides the following functionality:

  1. resolving a load balancer given a stack-id (if any)
  2. resolving the request count in the last n minutes of that load balancer Both, classic and application, load balancers are supported.

Further, a new endpoint is added /stacks/{stack-id}/request_count that first resolves the stack's load balancer and then returnes the request count of it. If the stack can not be found or the stack does not have a load balancer a 404 is returned.

f-sander commented 6 years ago

Closing this and reopening a cleaned up version.