Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
371db56
adding output schemas
manavgurnani21 Jul 18, 2025
3f1f95a
creating changeset
manavgurnani21 Jul 18, 2025
ea9202d
API changes
manavgurnani21 Jul 18, 2025
a6916e4
adding package and required files with partial implementation
manavgurnani21 Jul 18, 2025
b11dc09
adding API changes with package
manavgurnani21 Jul 18, 2025
8af5a59
adding initial version of construct and API
manavgurnani21 Jul 18, 2025
d0d92bf
updating API and exposed endpoints
manavgurnani21 Jul 18, 2025
c438aaf
adding output definition
manavgurnani21 Jul 20, 2025
59e4301
split APi definition and outputs aspects defined
manavgurnani21 Jul 23, 2025
20bb37b
unit testing v1 and debugging
manavgurnani21 Jul 24, 2025
ecbf8ed
updating tsconfig
manavgurnani21 Jul 24, 2025
3053f40
fixing some expressions
manavgurnani21 Jul 24, 2025
25d296a
updating API from recent commits
manavgurnani21 Jul 24, 2025
6ca3046
removing all previous changesets
manavgurnani21 Jul 24, 2025
4bfb06f
Revert "removing all previous changesets"
manavgurnani21 Jul 24, 2025
d6b1f7a
removing changeset files instead of directory
manavgurnani21 Jul 24, 2025
616a934
Revert "removing changeset files instead of directory"
manavgurnani21 Jul 24, 2025
727423c
removing changeset files
manavgurnani21 Jul 24, 2025
21107af
adding changeset
manavgurnani21 Jul 24, 2025
f55239b
clean up
manavgurnani21 Jul 24, 2025
6a85f9a
geo client-output bug fixed
manavgurnani21 Jul 26, 2025
1f4ebcc
updating API and fixing policy name duplication bug
manavgurnani21 Jul 26, 2025
4b62242
adding changeset for changed packages and updated README
manavgurnani21 Jul 28, 2025
8e4ff91
first iteration of api key support for map and place resources
manavgurnani21 Jul 28, 2025
3ca21c9
small fixes
manavgurnani21 Jul 28, 2025
1cf96ce
bumping packages
manavgurnani21 Jul 28, 2025
66a402d
Merge branch 'mgurnani/geo-L3-construct' into mgurnani/geo-L3-constru…
manavgurnani21 Jul 28, 2025
d8b39ef
unit testing for backend-geo files complete
manavgurnani21 Jul 29, 2025
838ae03
updating API.md
manavgurnani21 Jul 29, 2025
ea6fc85
adding output schemas
manavgurnani21 Jul 18, 2025
31da214
creating changeset
manavgurnani21 Jul 18, 2025
2b5a614
API changes
manavgurnani21 Jul 18, 2025
6d4fa3d
adding package and required files with partial implementation
manavgurnani21 Jul 18, 2025
bff9356
adding initial version of construct and API
manavgurnani21 Jul 18, 2025
6c126da
updating API and exposed endpoints
manavgurnani21 Jul 18, 2025
ce664fe
adding output definition
manavgurnani21 Jul 20, 2025
432ffbf
split APi definition and outputs aspects defined
manavgurnani21 Jul 23, 2025
e031f1f
unit testing v1 and debugging
manavgurnani21 Jul 24, 2025
ae95b0a
updating tsconfig
manavgurnani21 Jul 24, 2025
e0ec174
fixing some expressions
manavgurnani21 Jul 24, 2025
7166ac0
updating API from recent commits
manavgurnani21 Jul 24, 2025
7b69fcc
removing all previous changesets
manavgurnani21 Jul 24, 2025
8aa5093
Revert "removing all previous changesets"
manavgurnani21 Jul 24, 2025
37c0c0f
removing changeset files instead of directory
manavgurnani21 Jul 24, 2025
22ddc4a
Revert "removing changeset files instead of directory"
manavgurnani21 Jul 24, 2025
25fd347
removing changeset files
manavgurnani21 Jul 24, 2025
5206ca1
adding changeset
manavgurnani21 Jul 24, 2025
2ad70f7
clean up
manavgurnani21 Jul 24, 2025
e140488
geo client-output bug fixed
manavgurnani21 Jul 26, 2025
7a3106c
updating API and fixing policy name duplication bug
manavgurnani21 Jul 26, 2025
133799a
adding changeset for changed packages and updated README
manavgurnani21 Jul 28, 2025
92512cb
small fixes
manavgurnani21 Jul 28, 2025
f6f05ca
bumping packages
manavgurnani21 Jul 28, 2025
3c1435d
regenerating package-lock with new cdk versions
manavgurnani21 Jul 29, 2025
e68ce7e
updating packages and adding v1.5 schema
manavgurnani21 Jul 30, 2025
4e5b907
stepping back, reverting last commit
manavgurnani21 Jul 30, 2025
3604e2e
new package-lock
manavgurnani21 Jul 30, 2025
7e9f821
small fixes v3
manavgurnani21 Jul 30, 2025
777a8ec
small fixes and merge from PR
manavgurnani21 Jul 30, 2025
668d5fc
adding new schema and api key integration v1
manavgurnani21 Jul 30, 2025
a28a75d
updating API
manavgurnani21 Jul 30, 2025
cd47283
fixing API
manavgurnani21 Jul 30, 2025
60eea0d
fixing unit test issues after fixes v3
manavgurnani21 Jul 30, 2025
ac1c797
adding unit testing for api key support(all except client config)
manavgurnani21 Jul 30, 2025
0451172
updating API
manavgurnani21 Jul 30, 2025
5effe4e
new output schema to accomodate for api keys
manavgurnani21 Jul 31, 2025
3653b4a
small fixes v4
manavgurnani21 Jul 31, 2025
a907f0a
small fixes v5
manavgurnani21 Jul 31, 2025
bb86d9d
merging main feature branch with PR into working branch
manavgurnani21 Jul 31, 2025
d923b8b
API key names outputted and configuring amplify outputs
manavgurnani21 Jul 31, 2025
8fb285b
small changes and test coverage
manavgurnani21 Jul 31, 2025
4d06e21
small changes
manavgurnani21 Jul 31, 2025
633c6fb
updating package-lock
manavgurnani21 Aug 1, 2025
7f618b8
updating package-lock
manavgurnani21 Aug 1, 2025
b116fbb
Merge remote-tracking branch 'origin/main' into mgurnani/geo-L3-const…
manavgurnani21 Aug 1, 2025
499583d
adding integration test for Geo construct and API key support testing
manavgurnani21 Aug 4, 2025
612a097
fixing package lock
manavgurnani21 Aug 4, 2025
d566812
update form data to fix dependabot alert (#2940)
Amplifiyer Aug 1, 2025
6b01022
fixing stringify issue from PR 1 and downgrading location alpha version
manavgurnani21 Aug 5, 2025
d2a01fb
adding new output stringify algorithm
manavgurnani21 Aug 5, 2025
45b2ffa
fix to bumping cdk-lib deps to 2.195
manavgurnani21 Aug 5, 2025
f76efaa
Merge remote-tracking branch 'origin/main' into mgurnani/geo-L3-const…
manavgurnani21 Aug 5, 2025
7a03148
bumping all baselines to 2.207
manavgurnani21 Aug 6, 2025
5e8e718
updating alpha package
manavgurnani21 Aug 7, 2025
4d809df
adding missing changesets
manavgurnani21 Aug 7, 2025
0d64e14
fixing e2e issues v1
manavgurnani21 Aug 7, 2025
7566d1b
updating API
manavgurnani21 Aug 7, 2025
1fa6ea3
Merge branch 'mgurnani/geo-L3-construct-api-key-support' into mgurnan…
manavgurnani21 Aug 7, 2025
dbe662d
following naming convention of integration test
manavgurnani21 Aug 7, 2025
8785332
small fix for node:crypto
manavgurnani21 Aug 8, 2025
ed7f937
adding changeset description and removing isdefault
manavgurnani21 Aug 11, 2025
9d562af
updating API
manavgurnani21 Aug 11, 2025
1ed8917
small fixes v2
manavgurnani21 Aug 11, 2025
ae1e188
updating API
manavgurnani21 Aug 11, 2025
8e594a3
fixing schema
manavgurnani21 Aug 12, 2025
6a843f1
naming conventions
manavgurnani21 Aug 13, 2025
cba548a
Merge branch 'mgurnani/geo-L3-construct-api-key-support' into mgurnan…
manavgurnani21 Aug 13, 2025
e5cab4e
Merge remote-tracking branch 'origin/main' into mgurnani/geo-L3-const…
manavgurnani21 Aug 13, 2025
380e08d
Merge remote-tracking branch 'origin/feature/geo-L3-construct' into m…
manavgurnani21 Aug 14, 2025
cb01465
tackling changeset version issues
manavgurnani21 Aug 14, 2025
fb80409
fixing node:crypto issues
manavgurnani21 Aug 15, 2025
1b36c48
updating APIs
manavgurnani21 Aug 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/wild-deer-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
1,033 changes: 695 additions & 338 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"@aws-sdk/client-cognito-identity-provider": "^3.750.0",
"@aws-sdk/client-dynamodb": "^3.750.0",
"@aws-sdk/client-iam": "^3.750.0",
"@aws-sdk/client-location": "^3.859.0",
"@aws-sdk/client-s3": "^3.750.0",
"@aws-sdk/client-ssm": "^3.750.0",
"@changesets/cli": "^2.26.1",
Expand Down
1 change: 1 addition & 0 deletions packages/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@aws-sdk/client-cognito-identity-provider": "^3.750.0",
"@aws-sdk/client-iam": "^3.750.0",
"@aws-sdk/client-lambda": "^3.750.0",
"@aws-sdk/client-location": "^3.859.0",
"@aws-sdk/client-s3": "^3.750.0",
"@aws-sdk/client-sqs": "^3.750.0",
"@aws-sdk/client-sts": "^3.750.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { defineDeploymentTest } from './deployment.test.template.js';
import { GeoAPIKeySupportTestProjectCreator } from '../../test-project-setup/geo_api_key_support_testing.js';

defineDeploymentTest(new GeoAPIKeySupportTestProjectCreator());
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { defineSandboxTest } from './sandbox.test.template.js';
import { GeoAPIKeySupportTestProjectCreator } from '../../test-project-setup/geo_api_key_support_testing.js';

defineSandboxTest(new GeoAPIKeySupportTestProjectCreator());
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,16 @@ export const createEmptyCdkProject = async (
force: true,
});

// Update tsconfig.json to include types for "node:" imports
const tsconfigPath = path.join(projectRoot, 'tsconfig.json');
const tsconfig = JSON.parse(await fsp.readFile(tsconfigPath, 'utf-8'));
if (!tsconfig.compilerOptions.types) {
tsconfig.compilerOptions.types = [];
}
if (!tsconfig.compilerOptions.types.includes('node')) {
tsconfig.compilerOptions.types.push('node');
}
await fsp.writeFile(tsconfigPath, JSON.stringify(tsconfig, null, 2));

return { projectName, projectRoot };
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
import { TestProjectBase } from './test_project_base.js';
import fs from 'fs/promises';
import { createEmptyAmplifyProject } from './create_empty_amplify_project.js';
import { CloudFormationClient } from '@aws-sdk/client-cloudformation';
import { TestProjectCreator } from './test_project_creator.js';
import { AmplifyClient } from '@aws-sdk/client-amplify';
import { e2eToolingClientConfig } from '../e2e_tooling_client_config.js';
import { BackendIdentifier } from '@aws-amplify/plugin-types';
import {
ListGeofenceCollectionsCommand,
ListKeysCommand,
Location,
LocationClient,
} from '@aws-sdk/client-location';
import { DeployedResourcesFinder } from '../find_deployed_resource.js';
import assert from 'node:assert';

/**
* Creates test project for testing new Geo backend functionality with API key support.
*/
export class GeoAPIKeySupportTestProjectCreator implements TestProjectCreator {
readonly name = 'geo-api-key-support';

/**
* Initializes project creator object
*/
constructor(
private readonly cfnClient: CloudFormationClient = new CloudFormationClient(
e2eToolingClientConfig,
),
private readonly amplifyClient: AmplifyClient = new AmplifyClient(
e2eToolingClientConfig,
),
private readonly locationClient: LocationClient = new Location(
e2eToolingClientConfig,
),
private readonly resourceFinder: DeployedResourcesFinder = new DeployedResourcesFinder(),
) {}

createProject = async (e2eProjectDir: string): Promise<TestProjectBase> => {
const { projectName, projectRoot, projectAmplifyDir } =
await createEmptyAmplifyProject(this.name, e2eProjectDir);

const project = new GeoAPIKeySupportTestProject(
projectName,
projectRoot,
projectAmplifyDir,
this.cfnClient,
this.amplifyClient,
this.locationClient,
this.resourceFinder,
);

await fs.cp(
project.sourceProjectAmplifyDirURL,
project.projectAmplifyDirPath,
{ recursive: true },
);

return project;
};
}

/**
* Creates project with geo and auth resources initialized
*/
export class GeoAPIKeySupportTestProject extends TestProjectBase {
readonly sourceProjectDirPath = '../../src/test-projects/geo-api-key-support';
readonly sourceProjectAmplifyDirURL = new URL(
`${this.sourceProjectDirPath}/amplify`,
import.meta.url,
);

/**
* Creates an instance of a test project with Geofence Collections and API keys provisioned
*/
constructor(
name: string,
projectDirPath: string,
projectAmplifyDirPath: string,
cfnClient: CloudFormationClient,
amplifyClient: AmplifyClient,
private readonly locationClient: LocationClient,
private readonly resourceFinder: DeployedResourcesFinder,
) {
super(
name,
projectDirPath,
projectAmplifyDirPath,
cfnClient,
amplifyClient,
);
}

/**
* Override implementation of post deployment assertions specific to Amplify Geo tests
*/
override async assertPostDeployment(
backendId: BackendIdentifier,
): Promise<void> {
await super.assertPostDeployment(backendId); // perform regular post-deployment tests

const testCollection = await this.resourceFinder.findByBackendIdentifier(
backendId,
'AWS::Location::GeofenceCollection',
(name) => name.includes('amplifyTestCollection'),
);

const testAPIKey = await this.resourceFinder.findByBackendIdentifier(
backendId,
'AWS::Location::APIKey',
(name) => name.includes('amplifyTestIndexKey'),
);

assert.equal(testCollection.length, 1);
assert.equal(testAPIKey.length, 1);

const expectedCollectionResponse = {
Entries: [
{
CollectionName: 'amplifyTestCollection',
Description:
'This is a geofence collection setup for integration testing purposes.',
CreateTime: new Date(),
UpdateTime: new Date(),
},
],
};

const collectionResponse = await this.locationClient.send(
new ListGeofenceCollectionsCommand(),
);

const hasCollection = collectionResponse.Entries?.some(
(entry) =>
entry.CollectionName ===
expectedCollectionResponse.Entries[0].CollectionName &&
entry.Description === expectedCollectionResponse.Entries[0].Description,
);

assert.ok(
hasCollection,
'Expected collection not found in client response.',
);

const expectedKeysResponse = {
Entries: {
KeyName: 'amplifyTestIndexKey',
CreateTime: new Date(),
UpdateTime: new Date(),
Restrictions: {
AllowActions: ['geo-places:Autocomplete'],
},
},
};

const keyResponse = await this.locationClient.send(new ListKeysCommand());

const hasKey = keyResponse.Entries?.some(
(entry) =>
entry.KeyName === expectedKeysResponse.Entries.KeyName &&
JSON.stringify(entry.Restrictions?.AllowActions) ===
JSON.stringify(
expectedKeysResponse.Entries.Restrictions.AllowActions,
),
);

assert.ok(hasKey, 'Expected key not found in client response.');
}

private verifyCollectionResponse = async (expectedResponse: unknown) => {
const locationResponse = await this.locationClient.send(
new ListGeofenceCollectionsCommand(),
);
assert.equal(locationResponse, expectedResponse);
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineAuth } from '@aws-amplify/backend';

export const auth = defineAuth({
loginWith: {
email: true,
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineBackend } from '@aws-amplify/backend';
import { map, place, collection } from './geo/resource.js';
import { auth } from './auth/resource.js';

defineBackend({
auth,
map,
place,
collection,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import {
defineMap,
defineCollection,
definePlace,
} from '@aws-amplify/backend-geo';

export const map = defineMap({
name: 'amplifyTestMap',
access: (allow) => [allow.authenticated.to(['get'])],
});

export const place = definePlace({
name: 'amplifyTestPlaceIndex',
access: (allow) => [
allow.authenticated.to(['search']),
allow.guest.to(['geocode']),
allow.apiKey.to(['autocomplete']),
],
apiKeyProps: {
apiKeyName: 'amplifyTestIndexKey',
},
});

export const collection = defineCollection({
name: 'amplifyTestCollection',
description:
'This is a geofence collection setup for integration testing purposes.',
access: (allow) => [
allow.authenticated.to(['create', 'read', 'update', 'delete']),
allow.guest.to(['read', 'list']),
],
});
7 changes: 6 additions & 1 deletion packages/integration-tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": { "rootDir": "src", "outDir": "lib", "allowJs": true },
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"allowJs": true,
"types": ["node"]
},
"references": [
{ "path": "../ai-constructs" },
{ "path": "../auth-construct" },
Expand Down
Loading