Install the dependencies:
npm ciAuthenticate the AWS CLI, environment variables are recommended using direnv.
Then, deploy the map resources to your account.
npx cdk bootstrap
npx cdk deployAdd the outputs mapName and placesIndexName as environment variables for the web application:
export MAP_NAME=aws-map-demo-map
export PLACES_INDEX_NAME=aws-map-demo-indexNavigate to your map on the AWS Console and create an API key for the map.
Note: Unfortunately API Keys cannot be created using CloudFormation today.
- Add the map and the place index to the resources.
- Grant the
GetMap*action permission. - Grant the
SearchPlaceIndexForTextandSearchPlaceIndexForSuggestionspermissions. - In the referrers settings allow these domains
http://localhost:*/*(for local development)- your domain name, e.g.
https://coderbyheart.github.io/*
Add it to the environment variables:
export MAP_API_KEY=v1.public....Run npm start to launch the web app.