在环境重建后,ASG和ELB的名称可预测。 将私有子网中的EC2实例的流日志发送到S3存储桶

0

【以下的问题经过翻译处理】 我的客户正在尝试监控他们的ElasticBeanstalk基础架构。他们使用Grafana和CloudWatch结合ElasticBeanstalk。每次环境重建都会导致ASG和ELB的全新名称。他们正在构建用于在Grafana中获取正确ASG和ELB的过滤器,这是相当复杂的,导致他们无法配置任何警报。是否有办法在ElasticBeanstalk应用程序中对ASG和ELB名称进行一定的可预测性?他们预期能够看到ECS中的情况,那里的名称相对更加稳定且易于从Grafana中预测。

1 Antwort
0

【以下的回答经过翻译处理】 在我看来,你可以在这种情况下使用EBS通知功能。

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.managing.sns.html

您将收到以下示例的通知:

    {
  "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": {}
      }
    }
  ]
}

您可以在此通知的'Message'中使用'Environment'值来修改Lambda中Grafana的资源。

profile picture
EXPERTE
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen