Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.
Gen1 DocsLegacy

Page updated Mar 26, 2026

既存の Amazon Location リソースを使用する

既存の Amazon Location Services リソースを Amplify バックエンドまたはフロントエンドアプリケーションで使用するには、addOutput メソッドを使用して、バックエンドリソースの出力を amplify_outputs.json ファイルに表示します:

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>",
},
},
})

認可権限

Amplify Geo で既存の Amazon Location Service リソース(マップとプレイスインデックスなど)を使用するには、Cognito を通じて、ロールに適切な認可権限があることを確認する必要があります。

注: Amazon Location Service で使用する Amazon Cognito アイデンティティプールの作成に関するガイド

Cognito によって 2 つのロールが作成されます。サインインしたユーザーレベルのアクセスを付与する「認証済みロール」と、リソースへの認証なしでのアクセスを許可する「認証なしロール」です。適切なリソースとロール (Auth または Unauth) に対して、次のポリシーをアタッチします。{region}{account-id}{enter Map/PlaceIndex name} を正しい項目に置き換えます。特定のアクションは認証なしアクセスでは実行できないことに注意してください。Unauth ロールで許可されるアクションのリストは、Amazon Location Service へのアクセス権の付与ガイドを参照してください。

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