Predictable ASG and ELB names after environment rebuild

0

My customer is trying to monitor in their ElasticBeanstalk infrastructure.

They are using Grafana with Cloudwatch and in combination with ElasticBeanstalk. Every environment rebuild results in a completely new name for the ASGs and ELBs. The filter they're building to get the right ASG and ELB for their application in Grafana is quite complex and results in them not being able to configure any alerts.

Is there a way to achieve some predictability in the ASG and ELB names for ElasticBeanstalk applications? They were expecting what they see in ECS, where the names are somewhat more stable and easy to predict from Grafana.

AWS
luisoa
已提問 4 年前檢視次數 201 次
1 個回答
0
已接受的答案

IMHO, you can use EBS notification feature in your case. https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.managing.sns.html

You will receive a notification like example below:

    {
  "Records": [
    {
      "EventSource": "aws:sns",
      "EventVersion": "1.0",
      "EventSubscriptionArn": "arn:aws:sns:us-east-1...ElasticBeanstalkNotifications-Environment-foo-app...",
      "Sns": {
        "Type": "Notification",
        "MessageId": "111",
        "TopicArn": "arn:aws:sns:us-east-1...ElasticBeanstalkNotifications-Environment-foo-app",
        "Subject": "AWS Elastic Beanstalk Notification - New application version was deployed to running EC2 instances",
        "Message": "Timestamp: Thu May 07 23:38:22 UTC 2015\nMessage: Lambda Function Test: New application version was deployed to running EC2 instances.\n\nEnvironment: foo-app\nApplication: FooApp\n\nEnvironment URL: http://foo.com\nRequestId: 222\nNotificationProcessId: 333",
        "Timestamp": "2015-05-07T23:39:18.628Z",
        "SignatureVersion": "1",
        "Signature": "hello-sig",
        "SigningCertUrl": "https://sns.us-east-1.amazonaws.com/...",
        "UnsubscribeUrl": "https://sns.us-east-1.amazonaws.com/...",
        "MessageAttributes": {}
      }
    }
  ]
}

You might use the 'Environment' value in 'Message' of this notification to modify grafana's resource in Lambda

已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南