AWS Location Tracker - custom event-bus setting

0

I am trying to control which event-bus an AWS Tracker goes onto. I looked at the API Docs and I did not see anything like an "event-bus" as part of it's parameters. In my testing it seems that the Event Bus rule uses the "default" bus every time for an "ENTER" or "EXIT" event. We use various event-bus' per environment. Is there any way I can configure my API call to point to a specific event-bus? Here is a sample snippet I am currently using:

var paramsUpdateTracker = {
  TrackerName: 'test-tracker',
  Updates: [
    {
      DeviceId: 'fake-device-number',
      Position: [-90.22222,41.888888],
      SampleTime: new Date,
    }
  ]
};
  
location.batchUpdateDevicePosition(paramsUpdateTracker, function(err: any, data: any) {
  if (err) {
    console.log(err, err.stack);
  }
  else     {
    console.log(data);
  }
});
jim_b
질문됨 2년 전365회 조회
3개 답변
1

By default, events generated by AWS services get sent to the default event bus in Eventbridge. The custom event bus will be used for custom code (if you use the Eventbridge APIs to send events from your code). It is however possible to send an event from one bus to another - https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-bus-to-bus.html

profile pictureAWS
전문가
답변함 2년 전
  • So it sounds like all ENTER/EXIT events for AWS Location will always be routed to the "default" bus, and there is no way to programmatically put that event on a specific EventBridge bus. I was hoping to avoid a scenario like this, but sounds like we may have no other choice. Just to be clear, what you are suggesting is that all Location events for geofence ENTER/EXIT will go to the default bus, and from there we can route traffic to the proper environment EventBridge bus (dev/qa/production/etc...)?

0

On the last sentence, are you using the same AWS account for all your environments? This is not a recommended practice. Ideally, all environments should be in their own AWS accounts. Sometimes customers do use the same AWS account for lower environments such as Dev and Test, but then use separate accounts for Pre-prod and Prod. At the minimum, production accounts should be separate from non-production accounts. Even if you share the same AWS account between different environments, the workloads should be kept separate. That is however difficult if you are using Eventbridge default event bus because there can be only one default event bus in one AWS account. How would you know if an event on the default event bus is meant for the Dev environment or the Test environment? This needs to be thought through more.

profile pictureAWS
전문가
답변함 2년 전
  • We actually do have a separate account for production and one for lower environments. The account for lower environments includes development/qa/stage. We do currently use EDA for other use cases. The EventBridge API is used which includes the actual name of the target bus. Here is a sample setup:

        const entry: EventBridge.PutEventsRequestEntry = {
          Source: <domainName>,
          DetailType: <eventName>,
          EventBusName: <busName>,
          Detail: JSON.stringify(request),
        };
    
0
  1. Reacting to Amazon Location Service events with Amazon EventBridge : https://docs.aws.amazon.com/location/latest/developerguide/location-events.html
  2. Tracking using MQTT with Amazon Location Service : https://docs.aws.amazon.com/location/latest/developerguide/tracking-using-mqtt.html
AWS
Devesh
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠