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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则