Registry /
aws / aws-cdk-aws-location-alpha
Install & Compatibility
Where this runs
tested against v2.259.0a0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 359.5MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 17.6s · import 0.000s · 360MB
397MB installed
● package 397MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
aws_location_alpha
✓ import aws_cdk.aws_location_alpha as location
✗ import aws_cdk.aws_location as location
L2 constructs (e.g., `Tracker`) for Location Service are typically found in the `_alpha` module. The non-alpha `aws_cdk.aws_location` module usually contains only L1 (Cfn) constructs.
Stack
✓ from aws_cdk import Stack
Standard import for defining a CDK Stack.
This example demonstrates how to define a basic AWS CDK Stack that provisions an AWS Location Service Tracker and a Geofence Collection using the `aws-cdk-aws-location-alpha` module. Ensure `CDK_DEFAULT_ACCOUNT` and `CDK_DEFAULT_REGION` environment variables are set or explicitly provided for deployment.
import os
from aws_cdk import (
Stack,
App,
Environment,
)
import aws_cdk.aws_location_alpha as location
from constructs import Construct
class MyLocationStack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
# Create an AWS Location Tracker
tracker = location.Tracker(
self, "MySimpleTracker",
tracker_name="MyExampleTracker",
description="A simple tracker for demonstration"
)
# Optional: Create a Geofence Collection
geofence_collection = location.GeofenceCollection(
self, "MySimpleGeofenceCollection",
geofence_collection_name="MyExampleGeofenceCollection",
description="A simple geofence collection"
)
app = App()
MyLocationStack(app, "MyLocationServiceStack",
env=Environment(
account=os.environ.get("CDK_DEFAULT_ACCOUNT"),
region=os.environ.get("CDK_DEFAULT_REGION"),
)
)
app.synth()
Debug
Known issues
breakingAs an 'alpha' module (`a0` suffix in version, `_alpha` in module name), APIs are subject to breaking changes without major version bumps. This module is not recommended for production workloads.fixReview release notes for `aws-cdk-lib` and `aws-cdk-aws-location-alpha` with each update. For production, consider using L1 (Cfn) constructs from `aws_cdk.aws_location` if L2 constructs are not available in a stable module.
affects: All alpha versions (e.g., 2.x.x.a0)
gotchaAlpha modules (`aws-cdk-aws-location-alpha`) must be strictly version-locked with the core `aws-cdk-lib` package. Mismatched versions can lead to `ModuleNotFoundError`, `AttributeError`, or `TypeError` due to underlying JSII compatibility issues.fixAlways install `aws-cdk-aws-location-alpha` with the same major.minor.patch version prefix as your `aws-cdk-lib`. For example, if `aws-cdk-lib==2.250.0`, install `aws-cdk-aws-location-alpha==2.250.0a0`.
affects: All versions where `aws-cdk-lib` and `aws-cdk-aws-location-alpha` versions do not match (e.g., `aws-cdk-lib==2.200.0` and `aws-cdk-aws-location-alpha==2.250.0a0`).
gotchaDeploying AWS CDK applications requires the AWS CDK CLI (`aws-cdk`) to be installed globally and configured with valid AWS credentials and a default region/account.fixInstall the CLI via `npm install -g aws-cdk`. Configure your AWS credentials (e.g., `aws configure` or environment variables `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`). Ensure `CDK_DEFAULT_ACCOUNT` and `CDK_DEFAULT_REGION` are set or specified in your `App`.
affects: All versions of AWS CDK.
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'aws_cdk.aws_location_alpha'
The `aws-cdk-aws-location-alpha` Python package is not installed, or there's a version mismatch with `aws-cdk-lib`.
fixRun `pip install aws-cdk-aws-location-alpha`. Ensure `aws-cdk-aws-location-alpha` and `aws-cdk-lib` share the same major.minor.patch version prefix.
AttributeError: module 'aws_cdk.aws_location' has no attribute 'Tracker'
Attempting to import L2 constructs (like `Tracker`) from the non-alpha `aws_cdk.aws_location` module, while they only exist in the `_alpha` module.
fixChange your import statement to `import aws_cdk.aws_location_alpha as location` and then use `location.Tracker(...)`.
jsii.errors.JavaScriptError: TypeError: Class constructor Location cannot be invoked without 'new'
This often indicates a deep incompatibility issue, frequently caused by a mismatch between the `aws-cdk-lib` and `aws-cdk-aws-location-alpha` package versions, or an outdated `jsii` runtime.
fixEnsure `aws-cdk-lib` and `aws-cdk-aws-location-alpha` are installed with matching major.minor.patch versions. You may need to update `jsii` or reinstall your `node_modules` if you are working in a JSII-enabled environment.
Error: There are no 'context' values defined for this stack.
CDK expects an AWS environment (account and region) to synthesize or deploy the stack, but it was not provided in the `App` or via environment variables.
fixPass an `env` object to your Stack, e.g., `env=Environment(account=os.environ.get('CDK_DEFAULT_ACCOUNT'), region=os.environ.get('CDK_DEFAULT_REGION'))`. Ensure `CDK_DEFAULT_ACCOUNT` and `CDK_DEFAULT_REGION` are set in your shell environment. Upgrade
Version history
2.259.0a0latest on PyPI · released Jun 12, 2026
Audit
Dependencies
aws-cdk-librequiredCore AWS CDK library, required for any CDK project. Version must match.
constructsrequiredDependency for all CDK constructs.