Generated banner for Amazon Location Service
Generated logo for Amazon Location Service

Amazon Location Service

AWS LabsOfficialCreated by aws-geospatialDistributed by AWS Labs

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • No issues found

From the author

Integrates Amazon Location Service APIs for AWS applications. Use this skill when users want to add maps (interactive MapLibre or static images); geocode addresses to coordinates or reverse geocode coordinates to addresses; calculate routes, travel times, or service areas; find places and businesses through text search, nearby search, or autocomplete suggestions; retrieve detailed place information including hours, contacts, and addresses; monitor geographical boundaries with geofences; or track device locations. Covers authentication, SDK integration, and all Amazon Location Service capabilities.
— the description by aws-geospatial

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

Amazon Location Service provides a suite of geospatial APIs for web and mobile applications. This skill covers the integration of maps, geocoding, routing, places search, geofencing, and device tracking. It emphasizes the use of the bundled JavaScript client for web development and promotes resourceless API operations to simplify deployment. The skill also provides guidance on authentication via IAM or API keys, and distinguishes between interactive address input and bulk postal address validation using the Jobs API.

What it does

  • Provides interactive maps using MapLibre and static map images.
  • Converts addresses to coordinates (geocoding) and coordinates to addresses (reverse geocoding).
  • Calculates routes, travel times, and service areas with traffic estimation.
  • Searches for places, businesses, and points of interest with autocomplete functionality.
  • Monitors geographical boundaries with geofences and tracks device locations.
  • Validates and standardizes addresses in bulk against authoritative postal data.

When to use it

  • When building location-aware web or mobile applications on AWS.
  • When you need to implement maps, routing, or place search functionality.
  • When you need to verify and standardize large datasets of addresses in the US, CA, UK, or AU.
  • When you need to track device locations or monitor entry/exit from geofenced areas.
  • When migrating from other mapping providers to Amazon Location Service.

Advantages

  • Supports resourceless API operations to reduce infrastructure management.
  • Provides a bundled JavaScript client for simplified web integration.
  • Offers flexible authentication options including API keys for public applications.
  • Includes specialized APIs for bulk address validation and postal standardization.
  • Integrates seamlessly with other AWS services and SDKs.

Usage examples

“How do I implement an address autocomplete field in my React app using Amazon Location Service?”
The agent provides a guide on using the Autocomplete API, emphasizing the use of Address.Label for display and GetPlace for retrieving full details upon selection.
“I need to validate a large database of customer addresses in the UK. How should I do this?”
The agent explains the use of the asynchronous Jobs API (StartJob with ValidateAddress) for bulk processing, noting that it provides postal-authority verdicts.
“How do I initialize a map in my web application?”
The agent provides instructions on using MapLibre with a direct URL to the map style descriptor and setting validateStyle to false for performance.
“What are the best practices for securing my map implementation on a public website?”
The agent recommends using API Keys with restricted AllowActions and AllowResources, rather than exposing IAM credentials.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/awslabs/amazon-location-service/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip amazon-location-service.zip -d .agents/skills

Documentation by aws-geospatial

Overview

Amazon Location Service provides geospatial APIs for maps, geocoding, routing, places search, geofencing, and tracking. Prefer the bundled JavaScript client (@aws/amazon-location-client) for web development and use resourceless API operations to avoid managing AWS resources.

When to Use This Skill

Use this skill when:

  • Building location-aware web or mobile applications

  • Working with Amazon Location Service projects

  • Implementing maps, geocoding, routing, or places search

  • Adding geofencing or device tracking functionality

  • Integrating geospatial features into AWS applications

Do NOT use this skill for:

  • Google Maps, Mapbox, or Leaflet-with-OSM projects (unless migrating to Amazon Location)

  • Generic GIS operations without AWS context

  • Non-AWS geospatial services

Amazon Location Service API Overview

Places (SDK: geo-places, JS: @aws-sdk/client-geo-places)

  • Geocode (Forward/Reverse): Convert addresses to coordinates and vice versa

  • Search (Text/Nearby): Find points of interest with contact and hours info

  • Autocomplete: Predict addresses based on user input

  • Suggest: Predict places and points of interest based on partial or misspelled user input

  • Get Place: Retrieve place details by place ID

Jobs (SDK: location, JS: @aws-sdk/client-location)

  • Address Validation: Verify and standardize addresses in bulk with the asynchronous Jobs API (StartJob with Action ValidateAddress, then GetJob/ListJobs/CancelJob). It adds what Geocode lacks — a postal-authority verdict (ValidationGranularity, Mailable/Locatable, per-component StatusDetail), not just coordinates. Coverage is US, CA, UK, and AU only; for other countries use Geocode.

Maps (SDK: geo-maps, JS: @aws-sdk/client-geo-maps)

  • Dynamic Maps: Interactive maps using tiles with MapLibre rendering

  • Static Maps: Pre-rendered, non-interactive map images, good for including an image into a web page, or for thumbnail images

Routes (SDK: geo-routes, JS: @aws-sdk/client-geo-routes)

  • Route calculation with traffic and distance estimation

  • Service area/isoline creation

  • Matrix calculations for multiple origins/destinations

  • GPS trace alignment to road segments

  • Route optimization (traveling salesman problem)

Geofences & Trackers (SDK: location, JS: @aws-sdk/client-location)

  • Geofences: Detect entry/exit from geographical boundaries

  • Trackers: Current and historical device location tracking

API Keys (SDK: location, JS: @aws-sdk/client-location)

  • API Keys: Grant access to public applications without exposing AWS credentials

Common Mistakes

Avoid these frequent errors:

  1. Using Title instead of Address.Label for display: In Autocomplete results, always display Address.Label. The Title field may show components in reverse order and is not suitable for user-facing text.

  2. Using GetStyleDescriptor API for map initialization: MUST use direct URL passing to MapLibre (https://maps.geo.{region}.amazonaws.com/v2/styles/Standard/descriptor?key={apiKey}) instead of making GetStyleDescriptor API calls. The direct URL method is required for proper map rendering.

  3. Forgetting validateStyle: false in MapLibre config: Always set validateStyle: false in the MapLibre Map constructor for faster map load times with Amazon Location styles.

  4. Mixing resource-based and resourceless operations: When possible, prefer resourceless operations (direct API calls without pre-created resources) for simpler deployment and permissions.

  5. Inconsistent API operation naming: Use the format service:Operation when referencing APIs (e.g., geo-places:Geocode, geo-maps:GetStyleDescriptor). SDK clients use @aws-sdk/client-* format.

  6. Not handling nested Address objects correctly: The Address object from GetPlace contains nested objects (Region.Code, Region.Name, Country.Code2, etc.), not flat strings. Access nested properties correctly.

  7. Wrong action names in API Key permissions: API key AllowActions use geo-maps:, geo-places:, geo-routes: prefixes (e.g., geo-places:Geocode, geo-routes:CalculateRoutes). Do NOT use SDK client names (@aws-sdk/client-geo-places) or IAM-style actions. See the Authentication and Permissions section for the complete list.

Defaults

Use these default choices unless the user explicitly requests otherwise:

  • JavaScript SDK: Bundled client (CDN) for browser-only apps; npm modular SDKs (@aws-sdk/client-geo-*) for React and build tool apps

  • API operations: Resourceless for Maps/Places/Routes (Geofencing/Tracking always require pre-created resources)

  • Authentication: API Key for Maps/Places/Routes; Cognito for Geofencing/Tracking

  • Map style: Standard

  • Coordinate format: [longitude, latitude] (GeoJSON order)

Override: User can specify "use Cognito for Maps/Places/Routes" or "use bundled client for React".

API Selection Guidance

Choose the right API for your use case:

Address Input (interactive forms)
  • Autocomplete → Type-ahead in address forms (partial input: "123 Main")

  • GetPlace → Get full details after user selects autocomplete result (by PlaceId)

  • Geocode → Resolve a complete user-typed address to coordinates. Returns coordinates, a matched label, and match quality (MatchScores overall + per-component, AddressNumberCorrected) synchronously in one call — but no postal-deliverability verdict or standardized output.

Address Validation (verify & standardize)
  • StartJob (Action ValidateAddress) → Verify and standardize addresses in bulk against authoritative postal data; async Jobs API with Parquet input/output in Amazon S3. Coverage: US, CA, UK, AU only; for other countries use Geocode.

  • GetJob / ListJobs / CancelJob → Track, enumerate, and cancel validation jobs

  • Choose the Jobs API when you need a postal-authority verdict (ValidationGranularity, Mailable/Locatable, per-component StatusDetail) or bulk throughput. For a single ad-hoc check of whether one address resolves and how well it matched, the synchronous Geocode MatchScores is the right tool — do not stand up a job. See the address-verification reference.

Finding Locations
  • SearchText → General text search ("pizza near Seattle")

  • SearchNearby → Find places near a coordinate (restaurants within 5km)

  • Suggest → Predict places/POIs from partial or misspelled input

  • Autocomplete → Address-specific predictions (not for general POI search)

Geocoding
  • Geocode (Forward) → Address string → Coordinates

  • ReverseGeocode → Coordinates → Address

Maps
  • Dynamic Maps (tiles + MapLibre) → Interactive maps requiring pan, zoom, markers

  • Static Maps (image) → Non-interactive map images for thumbnails or email

Routing
  • CalculateRoutes → Single route between origin and destination

  • CalculateRouteMatrix → Multiple origins/destinations travel times

  • CalculateIsolines → Service areas (all locations reachable within time/distance)

LLM Context Files

When you need detailed API parameter specifications or service capabilities not covered in the reference files, fetch these llms.txt resources:

Key Guidance for Better Recommendations

Prefer the Bundled JavaScript Client for Web Development

For convenient web application development, Amazon Location Service provides a bundled JavaScript client that simplifies integration and provides optimized functionality without custom bundling. This bundled client includes all libraries required to build client side web applications with Amazon Location Service.

Features included in the bundled client:

  • Enables direct pre-bundled dependency inclusion without custom bundle / build

  • Simplified authentication and API integration

  • TypeScript support with comprehensive type definitions

  • Support for all Amazon Location SDKs

Included SDKs and Libraries:

Resources:

Prefer Resourceless Operations

Amazon Location Places, Maps and Routes services offer both resource-based and resourceless API operations. Resourceless operations are often simpler and more appropriate for many use cases.

Resource-based operations require you to:

  • Create and configure Amazon Location Service resources (maps, place indexes, route calculators)

  • Manage resource lifecycle and permissions

  • Handle resource naming and organization

Resourceless operations allow you to:

  • Make API calls directly without pre-creating resources

  • Reduce deployment complexity

  • Simplify IAM permissions and API Key permissions

Authentication and Permissions

When discussing permissions for Amazon Location Places, Maps and Routes services, always include both IAM permissions and API Key permissions in your guidance. If the type of application being developed is clear, recommend the appropriate authorization tool as described below:

IAM Permissions - Recommended for server-side applications and AWS SDK usage:

  • Used with AWS credentials (access keys, roles, etc.)

  • Provide fine-grained access control

  • Required for resource management operations

API Key Permissions - Alternative authentication method, especially useful for client-side applications or applications deployed to unauthenticated (public) users:

  • Simplified authentication without exposing AWS credentials

  • Can be configured with specific allowed operations

  • Useful for web and mobile applications

  • Supports both resource-based and resourceless operations

  • Enables faster subsequent map loads through CDN caching

API Key Action Names - API keys use their own action naming convention. Do NOT use SDK client names or IAM action names — they will be rejected.

Resourceless API key actions (recommended):

ServiceAllowActionsAllowResources
Mapsgeo-maps:GetTile, geo-maps:GetStaticMaparn:aws:geo-maps:REGION::provider/default
Placesgeo-places:Autocomplete, geo-places:Geocode, geo-places:ReverseGeocode, geo-places:SearchText, geo-places:SearchNearby, geo-places:Suggest, geo-places:GetPlacearn:aws:geo-places:REGION::provider/default
Routesgeo-routes:CalculateRoutes, geo-routes:CalculateRouteMatrix, geo-routes:CalculateIsolines, geo-routes:OptimizeWaypoints, geo-routes:SnapToRoadsarn:aws:geo-routes:REGION::provider/default

Do NOT use legacy geo: prefixed actions (e.g., geo:GetMap*, geo:CalculateRoute) — these are for pre-created resources only and will not work with resourceless APIs.

LocationClient Setup

Geofencing and Tracking use LocationClient (@aws-sdk/client-location). These are resource-based operations — you MUST create resources (trackers, geofence collections) before using them.

import { LocationClient } from "@aws-sdk/client-location";

// Server-side: uses IAM credentials from environment/role
const client = new LocationClient({ region: "us-east-1" });
// Client-side: uses Amazon Cognito
import { LocationClient } from "@aws-sdk/client-location";
import { fromCognitoIdentityPool } from "@aws-sdk/credential-providers";

const client = new LocationClient({
  region: "us-east-1",
  credentials: fromCognitoIdentityPool({
    identityPoolId: "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    clientConfig: { region: "us-east-1" },
  }),
});

MCP Server Integration

Integrates with the AWS MCP Server (Apache-2.0 license) which provides access to AWS documentation, API references, and direct API interactions. See the Getting Started Guide for setup and credential configuration. To use a non-default region, add "--metadata", "AWS_REGION=<your-region>" to your MCP config args.

Additional Resources

Reference Files

Load these resources as needed for specific implementation guidance:

  • Address Input - Create effective address input forms for users with address type ahead completion improving input speed and accuracy

  • Address Verification - Verify and standardize addresses in bulk against authoritative postal data using the asynchronous Jobs API (StartJob with Action ValidateAddress), before persisting to databases or taking downstream actions

  • Calculate Routes - Calculate routes between locations with customizable travel options and display them on maps

  • Device Tracking - Track device locations in real time and query position history

  • Dynamic Map Rendering - Render dynamic maps with MapLibre

  • Google Maps Migration (Android) - Migrate Android application from Google Maps SDK for Android to Amazon Location Service

  • Google Maps Migration (iOS) - Migrate iOS application from Google Maps SDK for iOS to Amazon Location Service

  • Google Maps Migration (JavaScript) - Migrate JavaScript web application from Google Maps API to Amazon Location Service

  • Places Search - Search for places or points of interest

  • Web JavaScript - Integrate Amazon Location services into web browser applications

  • Zone Alerts - Monitor device positions against geographic boundaries and react to zone entry or exit

Files

references/address-verification.md

Address Verification

Audience Note: Keywords MUST, SHOULD, MAY in this document indicate requirements for agent recommendations to users, following RFC 2119.

Verify and standardize addresses in bulk against authoritative postal data using the Amazon Location Service Jobs API (StartJob with Action ValidateAddress).

Distinction from Address Input: The address-input reference covers the interactive UI/UX of collecting a single address from a user (autocomplete, type-ahead, and resolving a typed address to coordinates with Geocode). This reference covers postal address validation — verifying and standardizing addresses against authoritative postal reference data (USPS, Royal Mail, Australia Post, Canada Post) in bulk.

What Geocode does NOT give you. Geocode (geo-places:Geocode) does return match quality — a MatchScores object with an overall score (1.0 = all input tokens matched) plus per-component scores, and an AddressNumberCorrected flag — with no opt-in required. So "match confidence" and "did a component change" are not the dividing line. What Geocode lacks, and what ValidateAddress adds, is postal-authority verification and standardization:

  • ValidationGranularity — an explicit Premise/Street/LocalityAndPostalCode/Locality verdict for how deep the match validated.

  • Delivery indicators — Mailable / Locatable from postal-carrier data.

  • Per-component StatusDetail — Corrected / Appended / Alias / StandardizedNoMatch / OutOfRange, telling you how each component was resolved against the postal dataset.

  • Standardized Output_* components formatted to official postal standards.

When to use which. For a single interactive or ad-hoc address ("does this typed address resolve, and how well?"), Geocode's one synchronous call — including its MatchScores — is the correct answer; do NOT stand up a job for it. Reach for the Jobs API (StartJob with Action ValidateAddress, then GetJob/ListJobs/CancelJob) when you need a postal-deliverability verdict, standardized output, or bulk throughput. Note the Jobs API covers only the US, Canada, UK, and Australia (see Supported Countries); for addresses elsewhere, Geocode is the available option for address resolution.

Table of Contents

  • Overview

  • When to Validate Addresses

  • Supported Countries

  • Job Workflow

  • Input Schema

  • Starting a Validation Job

  • Tracking a Job

  • Interpreting Results

  • Handling Partial Matches

  • Listing and Canceling Jobs

  • Error Handling

  • Pricing

  • Best Practices

Overview

Address validation jobs process address data to verify and standardize addresses. The service:

  1. Validates - Confirms the address exists and is deliverable by checking it against authoritative postal datasets

  2. Standardizes - Formats the address according to official postal standards (consistent abbreviations, casing, punctuation)

  3. Corrects and completes - Fixes spelling mistakes and appends missing components such as postal codes or street names

  4. Enriches (optional) - Adds geographic coordinates and country-specific postal attributes when requested

Validation runs as an asynchronous bulk job: you stage input in Amazon S3 as Apache Parquet, submit a job with StartJob, poll GetJob (or subscribe via EventBridge) until it completes, then read Parquet results from your S3 output location. This is designed for processing many addresses in a single operation, not for real-time single-address lookups during form entry.

When to Validate Addresses

Use address validation jobs in these scenarios:

  • Database cleansing: Clean and standardize existing address databases in bulk

  • Data migration: One-time address cleanup during system transitions

  • Before shipping/logistics: Validate delivery addresses to reduce failed deliveries

  • Identity and risk workflows: Standardize customer addresses for verification, risk assessment, and fraud prevention

  • Analytics and entity resolution: Standardize addresses for location-based analytics, demographic analysis, and CRM deduplication

  • Regulatory reporting: Validate patient/provider or customer addresses to meet compliance requirements

For interactive, single-address entry during a form session, use Autocomplete + GetPlace instead (see the address-input reference). Do NOT stand up a validation job on every keystroke or form submit.

Supported Countries

Address validation supports addresses from: United States, Canada, United Kingdom, and Australia. The optional Position feature (coordinates) is available only in the United States, Canada, and Australia.

Job Workflow

1. Prepare input   → Write addresses to a Parquet file in Amazon S3
2. StartJob        → Action=ValidateAddress, ExecutionRoleArn, Input/Output S3 locations
3. Track           → Poll GetJob (or listen on EventBridge) until Status is terminal
4. Retrieve        → Read Parquet result files from the S3 output location

Job status transitions: Pending → Running → Completed (or Failed), and Cancelling → Cancelled if you cancel it.

The Jobs API operations use LocationClient (@aws-sdk/client-location) with SigV4 (IAM) credentials — these are server-side/back-office operations, not API-key client-side calls.

Input Schema

Input data MUST be Apache Parquet stored in Amazon S3 (limit: 10 GB per file, 1 GB per Parquet row-group). The schema supports free-form address lines, structured components, or a combination:

FieldDescription
IdOptional per-record identifier. Mirrored in output as Input_Id so you can correlate results to inputs.
AddressLines_1 … AddressLines_5Free-form address lines. Put single-line input in AddressLines_1; order multi-line input as it would appear on mail.
AddressComponents_CountryAlpha-2, alpha-3 code, or full country name.
AddressComponents_RegionState, province, or territory.
AddressComponents_SubRegionCounty or equivalent.
AddressComponents_LocalityCity or town.
AddressComponents_PostalCodePostal / ZIP code.
AddressComponents_StreetStreet name.
AddressComponents_AddressNumberHouse / building number.
AddressComponents_Unit / AddressComponents_UnitDesignatorUnit value and designator (e.g. Apt, Suite, #).

Note: When combining AddressLines with AddressComponents, put first-line components (AddressNumber, Street, Unit, UnitDesignator) in AddressLines, and last-line components (Locality, Region, SubRegion, Country, PostalCode) in AddressComponents.

Example: create a Parquet input file with PyArrow.

import pyarrow as pa
import pyarrow.parquet as pq

data = [
    {"Id": "record-001", "AddressLines_1": "Pike Place", "AddressLines_2": "Apartment 4B",
     "AddressComponents_Country": "USA", "AddressComponents_PostalCode": "98101"},
    {"Id": "record-002", "AddressLines_1": "2901 E Madison St",
     "AddressComponents_Country": "USA", "AddressComponents_PostalCode": "98112"},
]

schema = pa.schema([
    ("Id", pa.string()),
    ("AddressLines_1", pa.string()),
    ("AddressLines_2", pa.string()),
    ("AddressComponents_Country", pa.string()),
    ("AddressComponents_PostalCode", pa.string()),
])

pq.write_table(pa.Table.from_pylist(data, schema=schema), "addresses.parquet")
# Upload addresses.parquet to your input S3 bucket/prefix.

Starting a Validation Job

StartJob requires the action, an ExecutionRoleArn that Amazon Location assumes to read your input and write your output S3 locations, and the input/output configuration. AdditionalFeatures is optional.

Request shape:

{
  "Action": "ValidateAddress",
  "Name": "customer-db-cleanup-2025-06",
  "ExecutionRoleArn": "arn:aws:iam::YOUR_ACCOUNT_ID:role/LocationServiceJobExecutionRole",
  "InputOptions": {
    "Format": "Parquet",
    "Location": "arn:aws:s3:::YOUR_INPUT_BUCKET/addresses.parquet"
  },
  "OutputOptions": {
    "Format": "Parquet",
    "Location": "arn:aws:s3:::YOUR_OUTPUT_BUCKET/results/"
  },
  "ActionOptions": {
    "ValidateAddress": {
      "AdditionalFeatures": ["Position", "CountrySpecificAttributes"]
    }
  }
}

AdditionalFeatures (optional, choose 1–2):

  • Position - Return WGS 84 longitude/latitude for validated addresses. US, Canada, and Australia only; incurs additional cost.

  • CountrySpecificAttributes - Return country-specific postal/census data (e.g. USPS carrier route and delivery point for US; Australia Post / G-NAF identifiers for Australia; Royal Mail UDPRN for UK; Canada Post record type for Canada).

JavaScript SDK:

import { LocationClient, StartJobCommand } from "@aws-sdk/client-location";

// Server-side: IAM credentials from environment/role
const client = new LocationClient({ region: "us-east-1" });

const response = await client.send(
  new StartJobCommand({
    Action: "ValidateAddress",
    Name: "customer-db-cleanup-2025-06",
    ExecutionRoleArn:
      "arn:aws:iam::YOUR_ACCOUNT_ID:role/LocationServiceJobExecutionRole",
    InputOptions: {
      Format: "Parquet",
      Location: "arn:aws:s3:::YOUR_INPUT_BUCKET/addresses.parquet",
    },
    OutputOptions: {
      Format: "Parquet",
      Location: "arn:aws:s3:::YOUR_OUTPUT_BUCKET/results/",
    },
    ActionOptions: {
      ValidateAddress: { AdditionalFeatures: ["Position"] },
    },
  }),
);

// Response: { JobId, JobArn, Status: "Pending", CreatedAt }
console.log("Started job:", response.JobId, response.Status);

AWS CLI:

aws location start-job \
  --action ValidateAddress \
  --execution-role-arn "arn:aws:iam::YOUR_ACCOUNT_ID:role/LocationServiceJobExecutionRole" \
  --input-options Location=arn:aws:s3:::YOUR_INPUT_BUCKET/addresses.parquet,Format=Parquet \
  --output-options Location=arn:aws:s3:::YOUR_OUTPUT_BUCKET/results/,Format=Parquet \
  --action-options '{"ValidateAddress":{"AdditionalFeatures":["Position"]}}' \
  --region us-east-1

The ExecutionRoleArn MUST be an IAM role in the same account that Amazon Location assumes during processing, so you do not pass long-term credentials for S3 access. Two requirements are easy to miss — omit either and StartJob succeeds, reports Pending, then flips to Failed:

1. Trust policy — the role must let geo.amazonaws.com assume it. The permission policy alone is not enough; without this trust relationship the AssumeRole fails. Scope it to your account with an aws:SourceAccount condition:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": { "Service": "geo.amazonaws.com" },
      "Action": "sts:AssumeRole",
      "Condition": {
        "StringEquals": { "aws:SourceAccount": "YOUR_ACCOUNT_ID" }
      }
    }
  ]
}

2. Bucket versioning must be enabled on the input and output buckets — Amazon Location requires it, which is why the input policy needs s3:GetObjectVersion. Grant list/version actions on the input bucket, and PutObject/AbortMultipartUpload (for cleaning up failed multipart uploads of large output files) on the output bucket:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:GetObjectVersion",
        "s3:ListBucket",
        "s3:GetBucketVersioning"
      ],
      "Resource": [
        "arn:aws:s3:::YOUR_INPUT_BUCKET",
        "arn:aws:s3:::YOUR_INPUT_BUCKET/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": ["s3:PutObject", "s3:AbortMultipartUpload"],
      "Resource": "arn:aws:s3:::YOUR_OUTPUT_BUCKET/*"
    }
  ]
}

Enable versioning with aws s3api put-bucket-versioning --bucket YOUR_INPUT_BUCKET --versioning-configuration Status=Enabled (repeat for the output bucket).

Tracking a Job

Poll GetJob with the JobId until Status is terminal (Completed, Failed, or Cancelled). For event-driven workflows, subscribe to job status changes via Amazon EventBridge instead of polling.

import { GetJobCommand } from "@aws-sdk/client-location";

async function waitForJob(client, jobId) {
  const terminal = new Set(["Completed", "Failed", "Cancelled"]);
  while (true) {
    const job = await client.send(new GetJobCommand({ JobId: jobId }));
    if (terminal.has(job.Status)) return job;
    // Back off between polls; jobs are asynchronous and may run for a while.
    await new Promise((r) => setTimeout(r, 30000));
  }
}

const job = await waitForJob(client, jobId);
if (job.Status === "Failed") {
  // GetJob returns Error.Code and Error.Messages for failed jobs
  console.error("Job failed:", job.Error?.Code, job.Error?.Messages);
} else if (job.Status === "Completed") {
  // Results are in the OutputOptions.Location S3 prefix
  console.log("Results at:", job.OutputOptions.Location);
}

GetJob also returns the full job configuration (Action, ActionOptions, ExecutionRoleArn, InputOptions, OutputOptions), timestamps (CreatedAt, UpdatedAt, EndedAt), and Error details if it failed.

Interpreting Results

When a job completes, read the Parquet result files from the S3 output prefix. Output preserves all input fields with an Input_ prefix (so Id → Input_Id) and adds Output_-prefixed result fields. Records that failed to process include ErrorType and ErrorMessage.

Overall verdict (per record):

  • Output_ValidationResults_MatchConfidence - High, MediumHigh, Medium, MediumLow, or Low

  • Output_ValidationResults_MatchConfidenceScore - Precise score from 0 to 1.0 (1.0 = perfect match)

  • Output_ValidationResults_ValidationGranularity - How deep the match validated:

    • Premise - Validated to the address-number level

    • Street - Validated to the street level

    • LocalityAndPostalCode - Locality, postal code, and country validated

    • Locality - Locality and country validated

Standardized address (Output_Address_* and Output_AddressLines_*): canonical, postal-formatted components — Output_Address_Label, Output_Address_Street, Output_Address_AddressNumber, Output_Address_Locality, Output_Address_Region_Code/_Name, Output_Address_PostalCode, country codes, secondary-address (unit/floor) components, and per-line output.

Delivery indicators: Output_AddressMetadata_DeliveryIndicators_Mailable and _Locatable (true/false).

Per-component status: each component's status lives in a fully-qualified column of the form Output_ValidationResults_Components_Address_<Component>_Status (and ..._StatusDetail) — the Components_Address_ infix is part of the real column name. For example, the address-number status is Output_ValidationResults_Components_Address_AddressNumber_Status, and the street status is Output_ValidationResults_Components_Address_Street_Status. For each component (Country, Region, Locality, Street, AddressNumber, PostalCodeDetails_Base, unit, floor, …):

  • _Status: Validated or Unconfirmed

  • _StatusDetail: Exact (validated unchanged), Corrected (fixed from reference data), Appended (added from reference data), Alias (validated via alias), StandardizedNoMatch (parsed/standardized but not found), OutOfRange (e.g. address number outside known range), NotFound (empty or not found)

Optional feature output: Output_Position_Longitude/_Latitude (if Position requested) and Output_CountrySpecificAttributes_* (if CountrySpecificAttributes requested).

// After reading a result record (e.g. via a Parquet reader):
function summarizeRecord(rec) {
  return {
    inputId: rec.Input_Id,
    confidence: rec.Output_ValidationResults_MatchConfidence,
    score: rec.Output_ValidationResults_MatchConfidenceScore,
    granularity: rec.Output_ValidationResults_ValidationGranularity,
    standardized: rec.Output_Address_Label,
    mailable: rec.Output_AddressMetadata_DeliveryIndicators_Mailable,
    coordinates: rec.Output_Position_Longitude != null
      ? {
          lon: rec.Output_Position_Longitude,
          lat: rec.Output_Position_Latitude,
        }
      : null,
    error: rec.ErrorType ? rec.ErrorMessage : null,
  };
}

Handling Partial Matches

Some addresses come back with lower MatchConfidence and coarser ValidationGranularity. Use the overall verdict together with per-component Status/StatusDetail to decide whether to accept, correct, or reject each record:

  • Accept: MatchConfidence is High/MediumHigh, ValidationGranularity is Premise (or Street if street-level is sufficient), delivery indicators are Mailable, and components are Validated with StatusDetail of Exact/Corrected/Alias/Appended. Store the standardized Output_* values.

  • Correct / review: Medium confidence, or key components Unconfirmed with StandardizedNoMatch or OutOfRange (e.g. a valid street but an out-of-range house number). Route these to a review queue or attempt a corrected re-submission.

  • Reject / re-collect: Low confidence, Locality-only granularity, NotFound on street/address number, or not Mailable. Ask the source (or user) for a corrected address.

Prefer the standardized Output_* components over the raw input when a record is accepted, and record the confidence/granularity alongside the stored address for auditability.

function triage(rec) {
  const conf = rec.Output_ValidationResults_MatchConfidence;
  const gran = rec.Output_ValidationResults_ValidationGranularity;
  const mailable = rec.Output_AddressMetadata_DeliveryIndicators_Mailable;
  // Per-component status columns carry the `Components_Address_` infix — the
  // bare `AddressNumber_Status` column does not exist in the output.
  const numberStatus =
    rec.Output_ValidationResults_Components_Address_AddressNumber_Status;
  const numberDetail =
    rec.Output_ValidationResults_Components_Address_AddressNumber_StatusDetail;

  if (
    (conf === "High" || conf === "MediumHigh") &&
    gran === "Premise" &&
    mailable
  ) {
    return "accept";
  }
  if (
    conf === "Low" ||
    gran === "Locality" ||
    !mailable ||
    (numberStatus === "Unconfirmed" && numberDetail === "NotFound")
  ) {
    return "reject";
  }
  return "review";
}

Listing and Canceling Jobs

  • ListJobs - Enumerate your jobs and their statuses (supports filtering and pagination).

  • CancelJob - Cancel a job that is Pending or Running; it transitions through Cancelling to Cancelled.

import { ListJobsCommand, CancelJobCommand } from "@aws-sdk/client-location";

const { Entries } = await client.send(new ListJobsCommand({}));
Entries.forEach((j) => console.log(j.JobId, j.Status, j.CreatedAt));

await client.send(new CancelJobCommand({ JobId: jobId }));

Error Handling

  • Job-submission errors (StartJob): ValidationException (bad request / input constraints, including the 10 GB per-file and 1 GB per-row-group limits), AccessDeniedException (caller or execution role lacks permission), ThrottlingException (retry with backoff; StartJob is rate-limited), InternalServerException.

  • Job-lookup errors (GetJob): ResourceNotFoundException if the JobId does not exist.

  • Failed jobs: a job can reach Status: Failed after starting successfully. Call GetJob and read Error.Code and Error.Messages for the cause.

  • Per-record errors: individual records that could not be processed carry ErrorType/ErrorMessage in the output file while the rest of the job succeeds. Always scan output for these.

  • Common setup mistakes (each makes the job go Pending then Failed, not error at StartJob): the ExecutionRoleArn must (a) trust geo.amazonaws.com for sts:AssumeRole in its trust policy, (b) grant s3:GetObject/GetObjectVersion/ListBucket/GetBucketVersioning on the input bucket and s3:PutObject/AbortMultipartUpload on the output bucket, and (c) target buckets that have versioning enabled. See Starting a Validation Job for the full trust and permission policies.

Pricing

Address validation is billed as a Jobs API operation, priced per record processed. The optional Position feature incurs additional cost and is available only in the US, Canada, and Australia. Review the Amazon Location Service pricing page and the Jobs pricing section of the developer guide before running large jobs.

Best Practices

Choosing the right tool
  • Use the Jobs API for a postal-deliverability verdict or bulk standardization: StartJob with Action ValidateAddress is the API that returns ValidationGranularity, Mailable/Locatable, and per-component StatusDetail against postal-authority data. SearchText/SearchPlaceIndexForText return places, not a validation verdict, and are not substitutes.

  • Use Geocode for a single ad-hoc resolve-and-score: to check whether one typed address resolves and how well it matched, Geocode's synchronous call (with MatchScores) is the right tool — do not stand up a job for it. It is also the available option outside the four Jobs-API countries.

  • Use Autocomplete + GetPlace for interactive entry: for a live form, help users pick a real address as they type (see address-input) rather than running a job per submission.

Input and jobs
  • Batch generously: the Jobs API is built for bulk — process thousands to millions of addresses per job rather than many tiny jobs.

  • Respect file limits: 10 GB per Parquet file, 1 GB per row-group; split larger datasets across files.

  • Keep Id on every record: it comes back as Input_Id, which is how you correlate output to input.

  • Set Name: name jobs meaningfully so ListJobs and audits stay readable.

Results and data quality
  • Store the standardized components: prefer Output_* values over raw input for accepted records.

  • Record the verdict: persist MatchConfidence, MatchConfidenceScore, and ValidationGranularity alongside the address for auditability and downstream triage.

  • Handle partial matches explicitly: use per-component Status/StatusDetail to accept, review, or reject — don't treat every completed record as valid.

  • Request only the features you need: Position and CountrySpecificAttributes add cost; request them only when used.

Security and operations
  • Least-privilege execution role: scope the ExecutionRoleArn to only the specific input/output buckets and prefixes — while still including the required GetObjectVersion/ListBucket/GetBucketVersioning actions on input, PutObject/AbortMultipartUpload on output, the geo.amazonaws.com trust relationship, and versioning-enabled buckets (see Starting a Validation Job).

  • Prefer EventBridge over tight polling: for long-running jobs, subscribe to status changes instead of polling GetJob aggressively.

  • Retry throttling with backoff: StartJob is rate-limited; use exponential backoff on ThrottlingException.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs an MCP server, Needs an API key

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
aws-geospatial
Publisher
AWS Labs (Official)
Distributed by
AWS Labs
Source
awslabs/agent-plugins · plugins/amazon-location-service/skills/amazon-location-service · commit fbefb37
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • NOTICE (added by AutoGineer from NOTICE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by aws-geospatial or AWS Labs.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download amazon-location-service.zip