# How to integrate with AWS IOT Core Device Location

**URL:** <https://community.tago.io/t/how-to-integrate-with-aws-iot-core-device-location/1635>\
**Category:** Tutorials\
**Tags:** tutorials\
**Created:** [July 16, 2024, 6:50pm UTC](https://community.tago.io/t/how-to-integrate-with-aws-iot-core-device-location/1635 "2024-07-16T18:50:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipe.gutierre](https://yyz2.discourse-cdn.com/flex034/user_avatar/community.tago.io/felipe.gutierre/32/1596_2.png) [@felipe.gutierre](https://community.tago.io/u/felipe.gutierre)\
**Post date:** [July 16, 2024, 6:50pm UTC](https://community.tago.io/t/how-to-integrate-with-aws-iot-core-device-location/1635/1 "2024-07-16T18:50:52Z")

</div>

AWS IoT Core Device Location is a service from AWS that allows you to estimate the location of your device using third-party solvers, eliminating the need for a GPS device. You can find more information in the [documentation](https://docs.aws.amazon.com/iot/latest/developerguide/device-location.html).

 ![](https://canada1.discourse-cdn.com/flex034/uploads/tagoio1/original/2X/5/5c600dfe6e13d564176fbd609379b1ab97883ae8.png)

This guide will walk you through the process of integrating any device with the AWS IOT Core Device Location and TagoIO. By following the steps outlined below, you will be able to set up your device to get an estimated location.

## 1) AWS Setup

1. Go to Identity and Access Management (IAM) on AWS.
2. Create a policy with the access “Allow” to the service “_iotwireless:GetPositionEstimate_”.
3. Create a user for this policy.
4. When a user is created, generate an access key for that user and copy the Access Key ID and Secret Access Key. For more information, refer to the AWS documentation: [IAM users - AWS Identity and Access Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html?icmpid=docs_iam_help_panel)

## 2) TAGOIO Setup

1. Configure 2 Secrets for AWS access

2. Import the [Analysis](https://help.tago.io/portal/en/kb/articles/120-creating-analysis) template for integration with AWS IOT Core Device Location from this [link](https://admin.tago.io/template/6696b44c57c78a0009193ff3) or get the analysis code from our [GitHub](https://github.com/tago-io/analysis-example-aws-iot-device-location).

3. Create the following [environment variables](https://help.tago.io/portal/en/kb/articles/65-environment-variables) for the analysis:

4. Create an [Action](https://help.tago.io/portal/en/kb/articles/30-actions#Type_of_trigger) to trigger the Analysis based on variable of the device that will receive the data from estimated location

5. Create a [Policy](https://help.tago.io/portal/en/kb/articles/184-creating-a-policy) for your analysis using the information provided below.

## 3) Result

When the analysis is triggered, that analysis will write the following data on the device:

```jsonc
{
  variable: "estimated_location",
  value: "lat;lng",
  location: {
    lat,
    lng,
  },
  metadata: {
    horizontalAccuracy: horizontalAccuracy,
    verticalAccuracy: verticalAccuracy,
    color: horizontalAccuracy <= DESIREABLE_ACCURACY_PERCENT ? "green" : "red",
  },
  group: group, // same as the device data received on analysis trigger
  time: time, // same as the device data received on analysis trigger
}

```
