I was recently accepted into the AWS Community Builders program and have been blown away by how geographically diverse the group is. The program is split up into different technology-based cohorts--although this is very loose coupling and members are free to join discussions and sessions for any set of technology they are interested in--but there is no location based grouping.
This led to many asking the same question: are there any other AWS Community Builders near me?
The manager of the program, Jason Dunn, agreed to share some anonymized location data with me and I volunteered to draft a quick proof-of-concept map that would display the locations.
Amazon Location Service is a new set of resources to support maps and location-based use cases such as geocoding, routing, asset/device tracking and geo-fence events.
As of the writing of this, the AWS Location Service has been GA for less than 2 weeks. I look forward to new features and integrations that will inevitably come in the future as the service continues to get some exercise.
Here are my initial impressions. I have only really experimented with maps and geocoding to support this simple use case.
The routing, tracking and geofencing components look very interesting but I don't have any direct experience with them yet.
If you are already in the AWS eco-system, using Amazon Location Services will be very easy as you can continue to use the tools and SDKs you are already using. You can control access and security via IAM, automate deployments via CloudFormation, monitor with CloudWatch, be notified of location-based events via Amazon EventBridge, etc.
Amazon currently supports its clients using Esri or HERE data sets and services. When you create Amazon resources for maps, places, etc you choose which provider you want to supply the data. Each provider has their own strengths and weakness but you can now switch easily without needing to integrate with each unique location provider API. As new providers are added, you can continue to leverage the same interface.
AWS does not have rights to sell your data or use it for advertising purposes (can Google say that?). They also anonymize all your requests before submitting them to vendors. Any tracking and geofence data is stored only in your AWS account (not 3rd parties) which gives you the power to control and secure that information.
AWS offers a free tier but it is only a 3-month trial. After 3 months, you are on the hook for your requests based usage. Google Maps free-tier equivalent (free mobile usage and $200 maps credit each month) does not expire and is much more generous. The maps and geocoding prices are competitive with other services but Amazon charges on a per-tile basis when many other providers charge on a per map-load basis. This means if your users are zooming and panning frequently, you will likely be paying more for Amazon Location Services.
This pricing makes Amazon Location Services a little less desirable for individuals, small prototyping efforts, and mobile map applications that are extremely price sensitive as you'll probably end up paying when other providers (i.e. Google) you can do a lot more with their free tier.
I hope that Amazon creates a more permanent free-tier for the mapping service at least.
#### Not so good: Lacking access controls for anonymous access to public maps. Someone pointed me in the right direction here and this is possible: check out my article here on how to lock down AWS Location Service by referer or IP, similar to Google Maps API keys.
To complete this proof of concept, I needed the following:
Given a list of locations, I needed to 1) geocode the locations to get their latitudes and longitudes and then 2) create a static map webpage to display the locations as markers on a map. Bonus points if we can add some metadata on the markers.
There was not much innovation for the map part of the project and just a quick proof of concept was the goal. It was accomplished by walking through the following sections of the AWS Location Service Developer Guide which is a great resource to get started! :
- Page 27: Allowing unauthenticated guest access to your application using Amazon Cognito
- Page 33: Creating a Map Resource
- Page 34: Authenticating your requests
- Page 35: Using MapLibre GL JS with Amazon Location Service
I also used some MapLibre tutorials below to help create the markers, icons and pop ups on the map:
We need to create a Place Index resource to support the geocoding.
To do the geocoding and create the GeoJSON that is displayed by the map, I wrote a quick Python script to perform that. This was fairly easy since the geocoding actions have been added to boto3 (i.e. the Python AWS SDK).
Unfortunately, the only location information that we had for Amazon Community Builders was Country. This resulted in many duplicate markers being generated which the mapping library was not happy about. In the end, I adjusted the logic of the geocoding script to create a single point for each country but then add properties to the point that indicated the number of people in that country. This member count property could then be displayed as a pop up on the map when the user hovered over the map marker.
To see the final code and the geocoding script, check out the acbmap-aws repo on GitHub. I tried to add more details to that README with the specifics if you want to try and run this locally.
You can find the a hosted version of the AWS Community Builders map, powered by Amazon Location Services, at the following location: