---
title: "Use existing Amazon Location resources"
section: "build-a-backend/add-aws-services/geo"
platforms: ["javascript", "swift", "android", "angular", "nextjs", "react", "vue"]
gen: 2
last-updated: "2026-03-25T17:40:00.000Z"
url: "https://docs.amplify.aws/react/build-a-backend/add-aws-services/geo/existing-resources/"
---

To use existing Amazon Location Services resources with your Amplify backend or frontend application, use the `addOutput` method to surface backend resource outputs to the `amplify_outputs.json` file:

```ts title="amplify/backend.ts"
import { defineBackend } from "@aws-amplify/backend"

const backend = defineBackend({})

backend.addOutput({
  geo: {
    aws_region: "<your-aws-region>",
    maps: {
      items: {
        "<your-friendly-map-name>": {
          name: "<your-map-name>",
          style: "<your-map-style>",
        },
      },
      default: "<your-friendly-map-name>",
    },
  },
})
```

## Authorization permissions

To use your existing Amazon Location Service resources (i.e. maps and place indices) with Amplify Geo, you need to ensure your role has the right authorization permissions through Cognito.

**Note:** Here is a guide on [Creating an Amazon Cognito identity pool for use with Amazon Location Service](https://docs.aws.amazon.com/location/latest/developerguide/authenticating-using-cognito.html)

There are two roles created by Cognito: an "authenticated role" that grants signed-in-user-level access and an "unauthenticated role" that allows unauthenticated access to resources. Attach the following policies for the appropriate resources and roles (Auth and/or Unauth). Replace `{region}`, `{account-id}`, and `{enter Map/PlaceIndex name}` with the correct items. Note that certain actions cannot be performed with unauthenticated access. The list of actions allowed for the Unauth role is in the [Granting access to Amazon Location Service guide](https://docs.aws.amazon.com/location/latest/developerguide/how-to-access.html).

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "GetTiles",
      "Effect": "Allow",
      "Action": [
        "geo:GetMapTile",
        "geo:GetMapSprites",
        "geo:GetMapGlyphs",
        "geo:GetMapStyleDescriptor"
      ],
      "Resource": "arn:aws:geo:<your-geo-region>:<your-account-id>:map/<your-map-name>"
    },
    {
      "Sid": "Search",
      "Effect": "Allow",
      "Action": [
        "geo:SearchPlaceIndexForPosition",
        "geo:SearchPlaceIndexForText"
      ],
      "Resource": "arn:aws:geo:<your-geo-region>:<your-account-id>:place-index/<your-index-name>"
    },
    {
      "Sid": "Geofence",
      "Effect": "Allow",
      "Action": [
        "geo:GetGeofence",
        "geo:PutGeofence",
        "geo:BatchPutGeofence",
        "geo:BatchDeleteGeofence",
        "geo:ListGeofences",
      ],
      "Resource": "arn:aws:geo:<your-geo-region>:<your-account-id>:geofence-collection/<your-collection-name>"
    }
  ]
}
```

<!-- Platform: javascript, angular, react, vue, react-native, nextjs -->
## Configure client library directly

You can first import and parse the generated `amplify_outputs.json`. You can then manually configure Amplify Geo like this:

```js
import { Amplify } from 'aws-amplify';
import { parseAmplifyConfig } from "aws-amplify/utils";
import outputs from '../amplify_outputs.json';

const amplifyConfig = parseAmplifyConfig(outputs);

Amplify.configure({
  ...amplifyConfig,
  Geo: {
    LocationService: {
      maps: {
        items: {
          <your-map-name>: {
            // REQUIRED - Amazon Location Service Map resource name
            style: 'VectorEsriStreets' // REQUIRED - String representing the style of map resource
          }
        },
        default: '<your-preferred-default-map>' // REQUIRED - Amazon Location Service Map resource name to set as default
      },
      search_indices: {
        items: ['<your-geo-index>'], // REQUIRED - Amazon Location Service Place Index name
        default: '<your-default-index>' // REQUIRED - Amazon Location Service Place Index name to set as default
      },
      geofenceCollections: {
        items: ['<your-geo-collection>'], // REQUIRED - Amazon Location Service Geofence Collection name
        default: '<your-default-collection>' // REQUIRED - Amazon Location Service Geofence Collection name to set as default
      },
      region: '<your-geo-region>' // REQUIRED - Amazon Location Service Region
    }
  }
});
```

Now you can proceed to [displaying a map](/[platform]/frontend/geo/maps/) or [adding location search](/[platform]/frontend/geo/location-search/) to your app.
<!-- /Platform -->
