diff --git a/amplify-migration-apps/_test-common/package.json b/amplify-migration-apps/_test-common/package.json index 61df7c0f5eb..ce2abc42121 100644 --- a/amplify-migration-apps/_test-common/package.json +++ b/amplify-migration-apps/_test-common/package.json @@ -2,6 +2,7 @@ "name": "shared-test-utils", "private": true, "version": "0.0.0", + "type": "module", "dependencies": { "@aws-sdk/client-cognito-identity-provider": "^3.936.0", "aws-amplify": "^6.15.8" diff --git a/amplify-migration-apps/snapshot.ts b/amplify-migration-apps/snapshot.ts index be48b273688..9729d7bd933 100644 --- a/amplify-migration-apps/snapshot.ts +++ b/amplify-migration-apps/snapshot.ts @@ -128,7 +128,7 @@ function stackNameFromArn(arnOrName: string): string { return arnOrName; } -async function downloadRecursive(stackNameOrArn: string, targetDir: string, appId: string, appName: string): Promise { +async function downloadRecursive(stackNameOrArn: string, targetDir: string): Promise { const stackName = stackNameFromArn(stackNameOrArn); const template = await fetchTemplate(stackName); @@ -148,7 +148,7 @@ async function downloadRecursive(stackNameOrArn: string, targetDir: string, appI const nestedIds = await fetchNestedStacks(stackName); for (const nestedId of nestedIds) { - await downloadRecursive(nestedId, targetDir, appId, appName); + await downloadRecursive(nestedId, targetDir); } } @@ -165,8 +165,8 @@ async function capturePreRefactor(appName: string, amplifyAppName?: string, gen2 const targetDir = path.resolve(path.join(__dirname, appName, '_snapshot.pre.refactor')); resetDir(targetDir); - await downloadRecursive(gen2RootStack, targetDir, app.appId!, app.name!); - await downloadRecursive(gen1RootStack, targetDir, app.appId!, app.name!); + await downloadRecursive(gen2RootStack, targetDir); + await downloadRecursive(gen1RootStack, targetDir); } async function capturePostRefactor(appName: string, deployedAppPath: string): Promise { diff --git a/amplify-migration-apps/store-locator/README.md b/amplify-migration-apps/store-locator/README.md new file mode 100644 index 00000000000..e2d944da3b1 --- /dev/null +++ b/amplify-migration-apps/store-locator/README.md @@ -0,0 +1,310 @@ +# Store Locator (Amplify Gen1) + +![](./images/app.png) + +A store locator app that displays store locations on an interactive map powered by AWS Amplify Geo and Amazon Location Service. It uses Maps for rendering store locations, Place Index (Location Search) for address search, and Geofence Collections for users to define virtual perimeters around store areas. + +## Install Dependencies + +```console +npm install +``` + +## Initialize Environment + +```console +amplify init +``` + +```console +⚠️ For new projects, we recommend starting with AWS Amplify Gen 2, our new code-first developer experience. Get started at https://docs.amplify.aws/react/start/quickstart/ +✔ Do you want to continue with Amplify Gen 1? (y/N) · yes +✔ Why would you like to use Amplify Gen 1? · Prefer not to answer +Note: It is recommended to run this command from the root of your app directory +? Enter a name for the project storeLocator +The following configuration will be applied: + +Project information +| Name: storeLocator +| Environment: main +| Default editor: Visual Studio Code +| App type: javascript +| Javascript framework: react +| Source Directory Path: src +| Distribution Directory Path: dist +| Build Command: npm run-script build +| Start Command: npm run-script start + +? Initialize the project with the above configuration? No +? Enter a name for the environment main +? Choose your default editor: Visual Studio Code +✔ Choose the type of app that you're building · javascript +Please tell us about your project +? What javascript framework are you using react +? Source Directory Path: src +? Distribution Directory Path: dist +? Build Command: npm run-script build +? Start Command: npm run-script start +Using default provider awscloudformation +? Select the authentication method you want to use: AWS profile + +For more information on AWS Profiles, see: +https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html + +? Please choose the profile you want to use default +``` + +## Add Categories + +### Auth + +Cognito-based auth using email. Create Cognito user pool groups for Geofences and add post confirmation lambda trigger to add users to the group. + +```console +amplify add auth +``` + +```console +? Do you want to use the default authentication and security configuration? Manual configuration +? Select the authentication/authorization services that you want to use: User Sign-Up, Sign-In, connected with AWS IAM controls (Enables per-user Storage features for i +mages or other content, Analytics, and more) +? Provide a friendly name for your resource that will be used to label this category in the project: (accept default value) +? Enter a name for your identity pool. (accept default value) +? Allow unauthenticated logins? (Provides scoped down permissions that you can control via AWS IAM) No +? Do you want to enable 3rd party authentication providers in your identity pool? No +? Provide a name for your user pool: (accept default value) +? How do you want users to be able to sign in? Email +? Do you want to add User Pool Groups? Yes +? Provide a name for your user pool group: storeLocatorAdmin +? Do you want to add another User Pool Group No +? Sort the user pool groups in order of preference · storeLocatorAdmin +? Do you want to add an admin queries API? No +? Multifactor authentication (MFA) user login options: OFF +? Email based user registration/forgot password: Enabled (Requires per-user email entry at registration) +? Specify an email verification subject: Your verification code +? Specify an email verification message: Your verification code is {####} +? Do you want to override the default password policy for this User Pool? No +? What attributes are required for signing up? Email +? Specify the app's refresh token expiration period (in days): 100 +? Do you want to specify the user attributes this app can read and write? No +? Do you want to enable any of the following capabilities? Add User to Group +? Do you want to use an OAuth flow? No +? Do you want to configure Lambda Triggers for Cognito? Yes +? Which triggers do you want to enable for Cognito Post Confirmation +? What functionality do you want to use for Post Confirmation Add User To Group +? Enter the name of the group to which users will be added. · storeLocatorAdmin +``` + +### Geo - Map + +Map resource for displaying store locations using Amazon Location Service. + +```console +amplify add geo +``` + +```console +? Select which capability you want to add: Map (visualize the geospatial data) +✔ Provide a name for the Map: · storeLocatorMap +✔ Restrict access by? · Both +✔ Who can access this Map? · Authorized and Guest users +Must pick at least 1 of 1 options. Selecting all options [storeLocatorAdmin] +Available advanced settings: +- Map style & Map data provider (default: Streets provided by Esri) + +✔ Do you want to configure advanced settings? (y/N) · no +``` + +### Geo - Location Search + +Search index for searching places and addresses. + +```console +amplify add geo +``` + +```console +? Select which capability you want to add: Location search (search by places, addresses, coordinates) +✔ Provide a name for the location search index (place index): · storeLocatorSearch +✔ Restrict access by? · Both +✔ Who can access this search index? · Authorized and Guest users +Must pick at least 1 of 1 options. Selecting all options [storeLocatorAdmin] +Available advanced settings: +- Search data provider (default: HERE) +- Search result storage location (default: no result storage) + +✔ Do you want to configure advanced settings? (y/N) · no +``` + +### Geo - Geofence + +```console +amplify add geo +``` + +```console +? Select which capability you want to add: Geofencing (visualize virtual perimeters) +✔ Provide a name for the Geofence Collection: · storeLocatorGeofence +Must pick at least 1 of 1 options. Selecting all options [storeLocatorAdmin] +✔ What kind of access do you want for storeLocatorAdmin users? Select ALL that apply: · Read geofence, Create/Update geofence, Delete geofence, List geofences +``` + +```console +amplify push +``` + +```console + Current Environment: main + +┌──────────┬──────────────────────────────────────────┬───────────┬───────────────────┐ +│ Category │ Resource name │ Operation │ Provider plugin │ +├──────────┼──────────────────────────────────────────┼───────────┼───────────────────┤ +│ Auth │ storelocatorcff4360f │ Create │ awscloudformation │ +├──────────┼──────────────────────────────────────────┼───────────┼───────────────────┤ +│ Geo │ storeLocatorMap │ Create │ awscloudformation │ +├──────────┼──────────────────────────────────────────┼───────────┼───────────────────┤ +│ Auth │ userPoolGroups │ Create │ awscloudformation │ +├──────────┼──────────────────────────────────────────┼───────────┼───────────────────┤ +│ Function │ storelocatorcff4360fPostConfirmation │ Create │ awscloudformation │ +├──────────┼──────────────────────────────────────────┼───────────┼───────────────────┤ +│ Geo │ storeLocatorGeofence │ Create │ awscloudformation │ +├──────────┼──────────────────────────────────────────┼───────────┼───────────────────┤ +│ Geo │ storeLocatorSearch │ Create │ awscloudformation │ +└──────────┴──────────────────────────────────────────┴───────────┴───────────────────┘ + +✔ Are you sure you want to continue? (Y/n) · yes +``` + +## Publish Frontend + +To publish the frontend, leverage the Amplify hosting console. First push everything to the `main` branch: + +```console +git add . +git commit -m "feat: gen1" +git push origin main +``` + +Next, accept all the default values and follow the getting started wizard to connect your repo and branch. Wait for the deployment to finish successfully. + +![](./images/hosting-get-started.png) +![](./images/add-main-branch.png) +![](./images/deploying-main-branch.png) + +Wait for the deployment to finish successfully. + +## Migrating to Gen2 + +> Based on https://github.com/aws-amplify/amplify-cli/blob/gen2-migration/GEN2_MIGRATION_GUIDE.md + +> [!WARNING] +> Migration is not fully supported for this app because the geo category doesn't support refactoring yet. +> This guide ends at the `generate` step. + +First install the experimental amplify CLI package that provides the migration commands. + +```console +npm install @aws-amplify/cli-internal-gen2-migration-experimental-alpha +``` + +Now run them: + +```console +npx amplify gen2-migration lock +``` + +```console +git checkout -b gen2-main +npx amplify gen2-migration generate +``` + +**Edit in `./src/main.tsx`:** + +```diff +- import amplifyconfig from './amplifyconfiguration.json'; ++ import amplifyconfig from '../amplify_outputs.json'; +``` + +```console +git add . +git commit -m "feat: migrate to gen2" +git push origin gen2-main +``` + +**Edit in `./amplify/auth/storelocatorcff4360fPostConfirmation/resource.ts`:** + +```diff +- memoryMB: 128, +- runtime: 22 ++ memoryMB: 512, ++ runtime: 22, ++ resourceGroupName: 'auth' +``` + +**Edit in `./amplify/auth/storelocatorcff4360fPostConfirmation/index.js`:** + +The Gen1 dynamic `require(`./${name}`)` doesn't work with esbuild bundling in the Amplify build pipeline (`Module not found in bundle: ./add-to-group`). Replace with a static import: + +```diff +- const moduleNames = process.env.MODULES.split(','); +- /** +- * The array of imported modules. +- */ +- const modules = moduleNames.map((name) => require(`./${name}`)); ++ import * as addToGroup from './add-to-group'; ++ ++ const modules = [addToGroup]; +``` + +```diff +- exports.handler = async (event, context) => { ++ export async function handler(event, context) { +``` + +**Edit in `./amplify/auth/storelocatorcff4360fPostConfirmation/add-to-group.js`:** + +```diff +- const { +- CognitoIdentityProviderClient, +- AdminAddUserToGroupCommand, +- GetGroupCommand, +- CreateGroupCommand, +- } = require('@aws-sdk/client-cognito-identity-provider'); ++ import { ++ CognitoIdentityProviderClient, ++ AdminAddUserToGroupCommand, ++ GetGroupCommand, ++ CreateGroupCommand, ++ } from '@aws-sdk/client-cognito-identity-provider'; +``` + +```diff +- exports.handler = async (event) => { ++ export const handler = async (event) => { +``` + +**Edit in `./amplify/auth/resource.ts`:** + +```diff +- triggers: { +- postConfirmation: storelocatorcff4360fPostConfirmation +- }, ++ triggers: { ++ postConfirmation: storelocatorcff4360fPostConfirmation ++ }, ++ access: (allow) => [ ++ allow.resource(storelocatorcff4360fPostConfirmation).to([ ++ "addUserToGroup", ++ "manageGroups", ++ ]), ++ ], +``` + +Now connect the `gen2-main` branch to the hosting service: + +![](./images/add-gen2-main-branch.png) +![](./images/deploying-gen2-main-branch.png) + +Wait for the deployment to finish successfully. + +**The guide ends here because the geo category doesn't support refactoring yet.** diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/.gitignore b/amplify-migration-apps/store-locator/_snapshot.post.generate/.gitignore new file mode 100644 index 00000000000..c71cd6d6b4b --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/.gitignore @@ -0,0 +1,8 @@ +# amplify +.amplify +amplify_outputs* +amplifyconfiguration* +aws-exports* +node_modules +build +dist diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify.yml b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify.yml new file mode 100644 index 00000000000..52c312768f5 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify.yml @@ -0,0 +1,23 @@ +version: 1 +backend: + phases: + build: + commands: + - "# Execute Amplify CLI with the helper script" + - npm ci --cache .npm --prefer-offline + - npx ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID +frontend: + phases: + preBuild: + commands: + - npm install + build: + commands: + - npm run build + artifacts: + baseDirectory: dist + files: + - "**/*" + cache: + paths: + - node_modules/**/* diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/resource.ts b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/resource.ts new file mode 100644 index 00000000000..4763d3fe892 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/resource.ts @@ -0,0 +1,24 @@ +import { defineAuth } from '@aws-amplify/backend'; +import { storelocator41a9495f41a9495fPostConfirmation } from './storelocator41a9495f41a9495fPostConfirmation/resource'; + +export const auth = defineAuth({ + loginWith: { + email: { + verificationEmailSubject: 'Your verification code', + verificationEmailBody: () => 'Your verification code is {####}', + }, + }, + userAttributes: { + email: { + required: true, + mutable: true, + }, + }, + groups: ['storeLocatorAdmin'], + triggers: { + postConfirmation: storelocator41a9495f41a9495fPostConfirmation, + }, + multifactor: { + mode: 'OFF', + }, +}); diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/storelocator41a9495f41a9495fPostConfirmation/add-to-group.js b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/storelocator41a9495f41a9495fPostConfirmation/add-to-group.js new file mode 100644 index 00000000000..b8920ac2104 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/storelocator41a9495f41a9495fPostConfirmation/add-to-group.js @@ -0,0 +1,37 @@ +const { + CognitoIdentityProviderClient, + AdminAddUserToGroupCommand, + GetGroupCommand, + CreateGroupCommand, +} = require('@aws-sdk/client-cognito-identity-provider'); + +const cognitoIdentityServiceProvider = new CognitoIdentityProviderClient({}); + +/** + * @type {import('@types/aws-lambda').PostConfirmationTriggerHandler} + */ +exports.handler = async (event) => { + const groupParams = { + GroupName: process.env.GROUP, + UserPoolId: event.userPoolId, + }; + const addUserParams = { + GroupName: process.env.GROUP, + UserPoolId: event.userPoolId, + Username: event.userName, + }; + /** + * Check if the group exists; if it doesn't, create it. + */ + try { + await cognitoIdentityServiceProvider.send(new GetGroupCommand(groupParams)); + } catch (e) { + await cognitoIdentityServiceProvider.send(new CreateGroupCommand(groupParams)); + } + /** + * Then, add the user to the group. + */ + await cognitoIdentityServiceProvider.send(new AdminAddUserToGroupCommand(addUserParams)); + + return event; +}; diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/storelocator41a9495f41a9495fPostConfirmation/event.json b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/storelocator41a9495f41a9495fPostConfirmation/event.json new file mode 100644 index 00000000000..5eafe06ea53 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/storelocator41a9495f41a9495fPostConfirmation/event.json @@ -0,0 +1,7 @@ +{ + "request": { + "userPoolId": "testID", + "userName": "testUser" + }, + "response": {} +} diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/storelocator41a9495f41a9495fPostConfirmation/index.js b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/storelocator41a9495f41a9495fPostConfirmation/index.js new file mode 100644 index 00000000000..876a0cedec6 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/storelocator41a9495f41a9495fPostConfirmation/index.js @@ -0,0 +1,33 @@ +/** + * @fileoverview + * + * This CloudFormation Trigger creates a handler which awaits the other handlers + * specified in the `MODULES` env var, located at `./${MODULE}`. + */ + +/** + * The names of modules to load are stored as a comma-delimited string in the + * `MODULES` env var. + */ +const moduleNames = process.env.MODULES.split(','); +/** + * The array of imported modules. + */ +const modules = moduleNames.map((name) => require(`./${name}`)); + +/** + * This async handler iterates over the given modules and awaits them. + * + * @see https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html#nodejs-handler-async + * @type {import('@types/aws-lambda').APIGatewayProxyHandler} + * + */ +exports.handler = async (event, context) => { + /** + * Instead of naively iterating over all handlers, run them concurrently with + * `await Promise.all(...)`. This would otherwise just be determined by the + * order of names in the `MODULES` var. + */ + await Promise.all(modules.map((module) => module.handler(event, context))); + return event; +}; diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/storelocator41a9495f41a9495fPostConfirmation/resource.ts b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/storelocator41a9495f41a9495fPostConfirmation/resource.ts new file mode 100644 index 00000000000..3c8d49b0e0a --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/auth/storelocator41a9495f41a9495fPostConfirmation/resource.ts @@ -0,0 +1,17 @@ +import { defineFunction } from '@aws-amplify/backend'; + +const branchName = process.env.AWS_BRANCH ?? 'sandbox'; + +export const storelocator41a9495f41a9495fPostConfirmation = defineFunction({ + entry: './index.js', + name: `storelocator41a9495f41a9495fPostConfirmation-${branchName}`, + timeoutSeconds: 25, + memoryMB: 128, + environment: { + ENV: `${branchName}`, + MODULES: 'add-to-group', + REGION: 'us-east-1', + GROUP: 'storeLocatorAdmin', + }, + runtime: 22, +}); diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/backend.ts b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/backend.ts new file mode 100644 index 00000000000..d199ec482f3 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/backend.ts @@ -0,0 +1,34 @@ +import { auth } from './auth/resource'; +import { storelocator41a9495f41a9495fPostConfirmation } from './auth/storelocator41a9495f41a9495fPostConfirmation/resource'; +import { defineGeo } from './geo/resource'; +import { defineBackend } from '@aws-amplify/backend'; +import { Duration } from 'aws-cdk-lib'; + +const backend = defineBackend({ + auth, + storelocator41a9495f41a9495fPostConfirmation, +}); +const geo = defineGeo(backend); +const cfnUserPool = backend.auth.resources.cfnResources.cfnUserPool; +cfnUserPool.usernameAttributes = ['email']; +cfnUserPool.policies = { + passwordPolicy: { + minimumLength: 8, + requireUppercase: false, + requireLowercase: false, + requireNumbers: false, + requireSymbols: false, + temporaryPasswordValidityDays: 7, + }, +}; +const userPool = backend.auth.resources.userPool; +userPool.addClient('NativeAppClient', { + refreshTokenValidity: Duration.days(100), + enableTokenRevocation: true, + enablePropagateAdditionalUserContextData: false, + authSessionValidity: Duration.minutes(3), + disableOAuth: true, + generateSecret: false, +}); +const branchName = process.env.AWS_BRANCH ?? 'sandbox'; +backend.storelocator41a9495f41a9495fPostConfirmation.resources.cfnResources.cfnFunction.functionName = `storelocator41a9495f41a9495fPostConfirmation-${branchName}`; diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/resource.ts b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/resource.ts new file mode 100644 index 00000000000..329d22bfbbb --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/resource.ts @@ -0,0 +1,29 @@ +import { defineStoreLocatorMap } from './storeLocatorMap/resource'; +import { defineStoreLocatorSearch } from './storeLocatorSearch/resource'; +import { defineStoreLocatorGeofence } from './storeLocatorGeofence/resource'; +import { Backend } from '@aws-amplify/backend'; + +export const defineGeo = (backend: Backend) => { + const storeLocatorMap = defineStoreLocatorMap(backend); + const storeLocatorSearch = defineStoreLocatorSearch(backend); + const storeLocatorGeofence = defineStoreLocatorGeofence(backend); + backend.addOutput({ + geo: { + aws_region: storeLocatorMap.region, + maps: { + items: { + [storeLocatorMap.name]: { style: storeLocatorMap.style }, + }, + default: storeLocatorMap.name, + }, + search_indices: { + items: [storeLocatorSearch.name], + default: storeLocatorSearch.name, + }, + geofence_collections: { + items: [storeLocatorGeofence.name], + default: storeLocatorGeofence.name, + }, + }, + }); +}; diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorGeofence/resource.ts b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorGeofence/resource.ts new file mode 100644 index 00000000000..c832107c15c --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorGeofence/resource.ts @@ -0,0 +1,24 @@ +import { geostoreLocatorGeofence } from './storeLocatorGeofence-construct'; +import { Backend } from '@aws-amplify/backend'; + +const branchName = process.env.AWS_BRANCH ?? 'sandbox'; + +export const defineStoreLocatorGeofence = (backend: Backend) => { + const storeLocatorGeofenceStack = backend.createStack( + 'geostoreLocatorGeofence' + ); + const storeLocatorGeofence = new geostoreLocatorGeofence( + storeLocatorGeofenceStack, + 'storeLocatorGeofence', + { + authstorelocator41a9495f41a9495fUserPoolId: + backend.auth.resources.userPool.userPoolId, + authuserPoolGroupsstoreLocatorAdminGroupRole: + backend.auth.resources.groups['storeLocatorAdmin'].role.roleName, + collectionName: 'storeLocatorGeofence', + branchName, + isDefault: 'true', + } + ); + return storeLocatorGeofence; +}; diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorGeofence/storeLocatorGeofence-construct.ts b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorGeofence/storeLocatorGeofence-construct.ts new file mode 100644 index 00000000000..b2ce35289cb --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorGeofence/storeLocatorGeofence-construct.ts @@ -0,0 +1,274 @@ +import * as cdk from 'aws-cdk-lib'; +import * as iam from 'aws-cdk-lib/aws-iam'; +import * as lambda from 'aws-cdk-lib/aws-lambda'; +import { Construct } from 'constructs'; + +export interface geostoreLocatorGeofenceProps { + /** + */ + readonly authuserPoolGroupsstoreLocatorAdminGroupRole: string; + /** + */ + readonly authstorelocator41a9495f41a9495fUserPoolId: string; + /** + */ + readonly collectionName: string; + /** + */ + readonly isDefault: string; + /** + */ + readonly branchName: string; +} + +/** + * {"createdOn":"Mac","createdBy":"Amplify","createdWith":"14.2.5","stackType":"geo-GeofenceCollection","metadata":{"whyContinueWithGen1":"Prefer not to answer"}} + */ +export class geostoreLocatorGeofence extends Construct { + public readonly name; + public readonly region; + public readonly arn; + + public constructor( + scope: Construct, + id: string, + props: geostoreLocatorGeofenceProps + ) { + super(scope, id); + + // Mappings + const regionMapping = new cdk.CfnMapping(this, 'RegionMapping', { + mapping: { + 'us-east-1': { + locationServiceRegion: 'us-east-1', + }, + 'us-east-2': { + locationServiceRegion: 'us-east-2', + }, + 'us-west-2': { + locationServiceRegion: 'us-west-2', + }, + 'ap-southeast-1': { + locationServiceRegion: 'ap-southeast-1', + }, + 'ap-southeast-2': { + locationServiceRegion: 'ap-southeast-2', + }, + 'ap-northeast-1': { + locationServiceRegion: 'ap-northeast-1', + }, + 'eu-central-1': { + locationServiceRegion: 'eu-central-1', + }, + 'eu-north-1': { + locationServiceRegion: 'eu-north-1', + }, + 'eu-west-1': { + locationServiceRegion: 'eu-west-1', + }, + 'sa-east-1': { + locationServiceRegion: 'us-east-1', + }, + 'ca-central-1': { + locationServiceRegion: 'us-east-1', + }, + 'us-west-1': { + locationServiceRegion: 'us-west-2', + }, + 'cn-north-1': { + locationServiceRegion: 'us-west-2', + }, + 'cn-northwest-1': { + locationServiceRegion: 'us-west-2', + }, + 'ap-south-1': { + locationServiceRegion: 'us-west-2', + }, + 'ap-northeast-3': { + locationServiceRegion: 'us-west-2', + }, + 'ap-northeast-2': { + locationServiceRegion: 'us-west-2', + }, + 'eu-west-2': { + locationServiceRegion: 'eu-west-1', + }, + 'eu-west-3': { + locationServiceRegion: 'eu-west-1', + }, + 'me-south-1': { + locationServiceRegion: 'ap-southeast-1', + }, + }, + }); + + // Resources + const customGeofenceCollectionLambdaServiceRole9040D551 = new iam.CfnRole( + this, + 'CustomGeofenceCollectionLambdaServiceRole9040D551', + { + assumeRolePolicyDocument: { + Statement: [ + { + Action: 'sts:AssumeRole', + Effect: 'Allow', + Principal: { + Service: 'lambda.amazonaws.com', + }, + }, + ], + Version: '2012-10-17', + }, + managedPolicyArns: [ + [ + 'arn:', + cdk.Stack.of(this).partition, + ':iam::aws:policy/service-role/AWSLambdaBasicExecutionRole', + ].join(''), + ], + } + ); + + const customGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18b369 = + new iam.CfnPolicy( + this, + 'CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369', + { + policyDocument: { + Statement: [ + { + Action: 'geo:CreateGeofenceCollection', + Effect: 'Allow', + Resource: '*', + }, + { + Action: [ + 'geo:UpdateGeofenceCollection', + 'geo:DeleteGeofenceCollection', + ], + Effect: 'Allow', + Resource: `arn:aws:geo:${regionMapping.findInMap( + cdk.Stack.of(this).region, + 'locationServiceRegion' + )}:${cdk.Stack.of(this).account}:geofence-collection/${[ + props.collectionName!, + props.branchName!, + ].join('-')}`, + }, + ], + Version: '2012-10-17', + }, + policyName: + 'CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369', + roles: [customGeofenceCollectionLambdaServiceRole9040D551.ref], + } + ); + + const customGeofenceCollectionLambdaCa3d002b = new lambda.CfnFunction( + this, + 'CustomGeofenceCollectionLambdaCA3D002B', + { + code: { + zipFile: + "const response = require('cfn-response');\nconst {\n LocationClient,\n CreateGeofenceCollectionCommand,\n DeleteGeofenceCollectionCommand,\n UpdateGeofenceCollectionCommand,\n} = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateGeofenceCollectionCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.CollectionName && res.CollectionArn) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateGeofenceCollectionCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.CollectionName) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteGeofenceCollectionCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.collectionName);\n throw err;\n }\n};\n", + }, + handler: 'index.handler', + role: customGeofenceCollectionLambdaServiceRole9040D551.attrArn, + runtime: 'nodejs22.x', + timeout: 300, + } + ); + customGeofenceCollectionLambdaCa3d002b.addDependency( + customGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18b369 + ); + customGeofenceCollectionLambdaCa3d002b.addDependency( + customGeofenceCollectionLambdaServiceRole9040D551 + ); + + const customGeofenceCollection = new cdk.CfnCustomResource( + this, + 'CustomGeofenceCollection', + { + serviceToken: customGeofenceCollectionLambdaCa3d002b.attrArn, + } + ); + customGeofenceCollection.addOverride('Type', 'Custom::LambdaCallout'); + customGeofenceCollection.addPropertyOverride( + 'collectionName', + [props.collectionName!, props.branchName!].join('-') + ); + customGeofenceCollection.addPropertyOverride( + 'region', + regionMapping.findInMap( + cdk.Stack.of(this).region, + 'locationServiceRegion' + ) + ); + customGeofenceCollection.addPropertyOverride('env', props.branchName!); + customGeofenceCollection.cfnOptions.deletionPolicy = + cdk.CfnDeletionPolicy.DELETE; + + const storeLocatorAdminGeofenceCollectionPolicy = new iam.CfnPolicy( + this, + 'storeLocatorAdminGeofenceCollectionPolicy', + { + policyDocument: { + Statement: [ + { + Action: [ + 'geo:GetGeofence', + 'geo:PutGeofence', + 'geo:BatchPutGeofence', + 'geo:BatchDeleteGeofence', + 'geo:ListGeofences', + ], + Effect: 'Allow', + Resource: `arn:aws:geo:${regionMapping.findInMap( + cdk.Stack.of(this).region, + 'locationServiceRegion' + )}:${ + cdk.Stack.of(this).account + }:geofence-collection/${customGeofenceCollection + .getAtt('CollectionName') + .toString()}`, + }, + ], + Version: '2012-10-17', + }, + policyName: [ + 'storeLocatorAdmin', + [props.collectionName!, props.branchName!].join('-'), + 'Policy', + ].join(''), + roles: [props.authuserPoolGroupsstoreLocatorAdminGroupRole!], + } + ); + + // Outputs + this.name = customGeofenceCollection.getAtt('CollectionName').toString(); + new cdk.CfnOutput(this, 'CfnOutputName', { + key: 'Name', + value: this.name!.toString(), + }); + this.region = regionMapping.findInMap( + cdk.Stack.of(this).region, + 'locationServiceRegion' + ); + new cdk.CfnOutput(this, 'CfnOutputRegion', { + key: 'Region', + value: this.region!.toString(), + }); + this.arn = `arn:aws:geo:${regionMapping.findInMap( + cdk.Stack.of(this).region, + 'locationServiceRegion' + )}:${ + cdk.Stack.of(this).account + }:geofence-collection/${customGeofenceCollection + .getAtt('CollectionName') + .toString()}`; + new cdk.CfnOutput(this, 'CfnOutputArn', { + key: 'Arn', + value: this.arn!.toString(), + }); + } +} diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorMap/resource.ts b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorMap/resource.ts new file mode 100644 index 00000000000..212b3d1c6f5 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorMap/resource.ts @@ -0,0 +1,26 @@ +import { geostoreLocatorMap } from './storeLocatorMap-construct'; +import { Backend } from '@aws-amplify/backend'; + +const branchName = process.env.AWS_BRANCH ?? 'sandbox'; + +export const defineStoreLocatorMap = (backend: Backend) => { + const storeLocatorMapStack = backend.createStack('geostoreLocatorMap'); + const storeLocatorMap = new geostoreLocatorMap( + storeLocatorMapStack, + 'storeLocatorMap', + { + authRoleName: backend.auth.resources.authenticatedUserIamRole.roleName, + unauthRoleName: + backend.auth.resources.unauthenticatedUserIamRole.roleName, + authstorelocator41a9495f41a9495fUserPoolId: + backend.auth.resources.userPool.userPoolId, + authuserPoolGroupsstoreLocatorAdminGroupRole: + backend.auth.resources.groups['storeLocatorAdmin'].role.roleName, + mapName: 'storeLocatorMap', + mapStyle: 'VectorEsriStreets', + branchName, + isDefault: 'true', + } + ); + return storeLocatorMap; +}; diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorMap/storeLocatorMap-construct.ts b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorMap/storeLocatorMap-construct.ts new file mode 100644 index 00000000000..f3aadded338 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorMap/storeLocatorMap-construct.ts @@ -0,0 +1,262 @@ +import * as cdk from 'aws-cdk-lib'; +import * as iam from 'aws-cdk-lib/aws-iam'; +import * as lambda from 'aws-cdk-lib/aws-lambda'; +import { Construct } from 'constructs'; + +export interface geostoreLocatorMapProps { + /** + */ + readonly authuserPoolGroupsstoreLocatorAdminGroupRole: string; + /** + */ + readonly authstorelocator41a9495f41a9495fUserPoolId: string; + /** + */ + readonly authRoleName: string; + /** + */ + readonly unauthRoleName: string; + /** + */ + readonly mapName: string; + /** + */ + readonly mapStyle: string; + /** + */ + readonly isDefault: string; + /** + */ + readonly branchName: string; +} + +/** + * {"createdOn":"Mac","createdBy":"Amplify","createdWith":"14.2.5","stackType":"geo-Map","metadata":{"whyContinueWithGen1":"Prefer not to answer"}} + */ +export class geostoreLocatorMap extends Construct { + public readonly name; + public readonly style; + public readonly region; + public readonly arn; + + public constructor( + scope: Construct, + id: string, + props: geostoreLocatorMapProps + ) { + super(scope, id); + + // Mappings + const regionMapping = new cdk.CfnMapping(this, 'RegionMapping', { + mapping: { + 'us-east-1': { + locationServiceRegion: 'us-east-1', + }, + 'us-east-2': { + locationServiceRegion: 'us-east-2', + }, + 'us-west-2': { + locationServiceRegion: 'us-west-2', + }, + 'ap-southeast-1': { + locationServiceRegion: 'ap-southeast-1', + }, + 'ap-southeast-2': { + locationServiceRegion: 'ap-southeast-2', + }, + 'ap-northeast-1': { + locationServiceRegion: 'ap-northeast-1', + }, + 'eu-central-1': { + locationServiceRegion: 'eu-central-1', + }, + 'eu-north-1': { + locationServiceRegion: 'eu-north-1', + }, + 'eu-west-1': { + locationServiceRegion: 'eu-west-1', + }, + 'sa-east-1': { + locationServiceRegion: 'us-east-1', + }, + 'ca-central-1': { + locationServiceRegion: 'us-east-1', + }, + 'us-west-1': { + locationServiceRegion: 'us-west-2', + }, + 'cn-north-1': { + locationServiceRegion: 'us-west-2', + }, + 'cn-northwest-1': { + locationServiceRegion: 'us-west-2', + }, + 'ap-south-1': { + locationServiceRegion: 'us-west-2', + }, + 'ap-northeast-3': { + locationServiceRegion: 'us-west-2', + }, + 'ap-northeast-2': { + locationServiceRegion: 'us-west-2', + }, + 'eu-west-2': { + locationServiceRegion: 'eu-west-1', + }, + 'eu-west-3': { + locationServiceRegion: 'eu-west-1', + }, + 'me-south-1': { + locationServiceRegion: 'ap-southeast-1', + }, + }, + }); + + // Resources + const customMapLambdaServiceRole4Ee7732c = new iam.CfnRole( + this, + 'CustomMapLambdaServiceRole4EE7732C', + { + assumeRolePolicyDocument: { + Statement: [ + { + Action: 'sts:AssumeRole', + Effect: 'Allow', + Principal: { + Service: 'lambda.amazonaws.com', + }, + }, + ], + Version: '2012-10-17', + }, + managedPolicyArns: [ + [ + 'arn:', + cdk.Stack.of(this).partition, + ':iam::aws:policy/service-role/AWSLambdaBasicExecutionRole', + ].join(''), + ], + } + ); + + const customMapLambdaServiceRoleDefaultPolicy983Fdd4e = new iam.CfnPolicy( + this, + 'CustomMapLambdaServiceRoleDefaultPolicy983FDD4E', + { + policyDocument: { + Statement: [ + { + Action: 'geo:CreateMap', + Effect: 'Allow', + Resource: '*', + }, + { + Action: ['geo:UpdateMap', 'geo:DeleteMap'], + Effect: 'Allow', + Resource: `arn:aws:geo:${regionMapping.findInMap( + cdk.Stack.of(this).region, + 'locationServiceRegion' + )}:${cdk.Stack.of(this).account}:map/${[ + props.mapName!, + props.branchName!, + ].join('-')}`, + }, + ], + Version: '2012-10-17', + }, + policyName: 'CustomMapLambdaServiceRoleDefaultPolicy983FDD4E', + roles: [customMapLambdaServiceRole4Ee7732c.ref], + } + ); + + const customMapLambda51D5d430 = new lambda.CfnFunction( + this, + 'CustomMapLambda51D5D430', + { + code: { + zipFile: + "const response = require('cfn-response');\nconst { LocationClient, CreateMapCommand, DeleteMapCommand, UpdateMapCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n Configuration: {\n Style: event.ResourceProperties.mapStyle,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateMapCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Update') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateMapCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Delete') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteMapCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.mapName);\n throw err;\n }\n};\n", + }, + handler: 'index.handler', + role: customMapLambdaServiceRole4Ee7732c.attrArn, + runtime: 'nodejs22.x', + timeout: 300, + } + ); + customMapLambda51D5d430.addDependency( + customMapLambdaServiceRoleDefaultPolicy983Fdd4e + ); + customMapLambda51D5d430.addDependency(customMapLambdaServiceRole4Ee7732c); + + const customMap = new cdk.CfnCustomResource(this, 'CustomMap', { + serviceToken: customMapLambda51D5d430.attrArn, + }); + customMap.addOverride('Type', 'Custom::LambdaCallout'); + customMap.addPropertyOverride( + 'mapName', + [props.mapName!, props.branchName!].join('-') + ); + customMap.addPropertyOverride('mapStyle', props.mapStyle!); + customMap.addPropertyOverride( + 'region', + regionMapping.findInMap( + cdk.Stack.of(this).region, + 'locationServiceRegion' + ) + ); + customMap.addPropertyOverride('env', props.branchName!); + customMap.cfnOptions.deletionPolicy = cdk.CfnDeletionPolicy.DELETE; + + const mapPolicy = new iam.CfnPolicy(this, 'MapPolicy', { + policyDocument: { + Statement: [ + { + Action: [ + 'geo:GetMapStyleDescriptor', + 'geo:GetMapGlyphs', + 'geo:GetMapSprites', + 'geo:GetMapTile', + ], + Effect: 'Allow', + Resource: customMap.getAtt('MapArn').toString(), + }, + ], + Version: '2012-10-17', + }, + policyName: [ + [props.mapName!, props.branchName!].join('-'), + 'Policy', + ].join(''), + roles: [ + props.authRoleName!, + props.unauthRoleName!, + props.authuserPoolGroupsstoreLocatorAdminGroupRole!, + ], + }); + + // Outputs + this.name = customMap.getAtt('MapName').toString(); + new cdk.CfnOutput(this, 'CfnOutputName', { + key: 'Name', + value: this.name!.toString(), + }); + this.style = props.mapStyle!; + new cdk.CfnOutput(this, 'CfnOutputStyle', { + key: 'Style', + value: this.style!.toString(), + }); + this.region = regionMapping.findInMap( + cdk.Stack.of(this).region, + 'locationServiceRegion' + ); + new cdk.CfnOutput(this, 'CfnOutputRegion', { + key: 'Region', + value: this.region!.toString(), + }); + this.arn = customMap.getAtt('MapArn').toString(); + new cdk.CfnOutput(this, 'CfnOutputArn', { + key: 'Arn', + value: this.arn!.toString(), + }); + } +} diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorSearch/resource.ts b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorSearch/resource.ts new file mode 100644 index 00000000000..6062b48f04a --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorSearch/resource.ts @@ -0,0 +1,27 @@ +import { geostoreLocatorSearch } from './storeLocatorSearch-construct'; +import { Backend } from '@aws-amplify/backend'; + +const branchName = process.env.AWS_BRANCH ?? 'sandbox'; + +export const defineStoreLocatorSearch = (backend: Backend) => { + const storeLocatorSearchStack = backend.createStack('geostoreLocatorSearch'); + const storeLocatorSearch = new geostoreLocatorSearch( + storeLocatorSearchStack, + 'storeLocatorSearch', + { + authRoleName: backend.auth.resources.authenticatedUserIamRole.roleName, + unauthRoleName: + backend.auth.resources.unauthenticatedUserIamRole.roleName, + authstorelocator41a9495f41a9495fUserPoolId: + backend.auth.resources.userPool.userPoolId, + authuserPoolGroupsstoreLocatorAdminGroupRole: + backend.auth.resources.groups['storeLocatorAdmin'].role.roleName, + indexName: 'storeLocatorSearch', + dataProvider: 'Here', + dataSourceIntendedUse: 'SingleUse', + branchName, + isDefault: 'true', + } + ); + return storeLocatorSearch; +}; diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorSearch/storeLocatorSearch-construct.ts b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorSearch/storeLocatorSearch-construct.ts new file mode 100644 index 00000000000..bde16c5fbbe --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/geo/storeLocatorSearch/storeLocatorSearch-construct.ts @@ -0,0 +1,270 @@ +import * as cdk from 'aws-cdk-lib'; +import * as iam from 'aws-cdk-lib/aws-iam'; +import * as lambda from 'aws-cdk-lib/aws-lambda'; +import { Construct } from 'constructs'; + +export interface geostoreLocatorSearchProps { + /** + */ + readonly authuserPoolGroupsstoreLocatorAdminGroupRole: string; + /** + */ + readonly authstorelocator41a9495f41a9495fUserPoolId: string; + /** + */ + readonly authRoleName: string; + /** + */ + readonly unauthRoleName: string; + /** + */ + readonly indexName: string; + /** + */ + readonly dataProvider: string; + /** + */ + readonly dataSourceIntendedUse: string; + /** + */ + readonly isDefault: string; + /** + */ + readonly branchName: string; +} + +/** + * {"createdOn":"Mac","createdBy":"Amplify","createdWith":"14.2.5","stackType":"geo-PlaceIndex","metadata":{"whyContinueWithGen1":"Prefer not to answer"}} + */ +export class geostoreLocatorSearch extends Construct { + public readonly name; + public readonly region; + public readonly arn; + + public constructor( + scope: Construct, + id: string, + props: geostoreLocatorSearchProps + ) { + super(scope, id); + + // Mappings + const regionMapping = new cdk.CfnMapping(this, 'RegionMapping', { + mapping: { + 'us-east-1': { + locationServiceRegion: 'us-east-1', + }, + 'us-east-2': { + locationServiceRegion: 'us-east-2', + }, + 'us-west-2': { + locationServiceRegion: 'us-west-2', + }, + 'ap-southeast-1': { + locationServiceRegion: 'ap-southeast-1', + }, + 'ap-southeast-2': { + locationServiceRegion: 'ap-southeast-2', + }, + 'ap-northeast-1': { + locationServiceRegion: 'ap-northeast-1', + }, + 'eu-central-1': { + locationServiceRegion: 'eu-central-1', + }, + 'eu-north-1': { + locationServiceRegion: 'eu-north-1', + }, + 'eu-west-1': { + locationServiceRegion: 'eu-west-1', + }, + 'sa-east-1': { + locationServiceRegion: 'us-east-1', + }, + 'ca-central-1': { + locationServiceRegion: 'us-east-1', + }, + 'us-west-1': { + locationServiceRegion: 'us-west-2', + }, + 'cn-north-1': { + locationServiceRegion: 'us-west-2', + }, + 'cn-northwest-1': { + locationServiceRegion: 'us-west-2', + }, + 'ap-south-1': { + locationServiceRegion: 'us-west-2', + }, + 'ap-northeast-3': { + locationServiceRegion: 'us-west-2', + }, + 'ap-northeast-2': { + locationServiceRegion: 'us-west-2', + }, + 'eu-west-2': { + locationServiceRegion: 'eu-west-1', + }, + 'eu-west-3': { + locationServiceRegion: 'eu-west-1', + }, + 'me-south-1': { + locationServiceRegion: 'ap-southeast-1', + }, + }, + }); + + // Resources + const customPlaceIndexLambdaServiceRoleFd2f3c9d = new iam.CfnRole( + this, + 'CustomPlaceIndexLambdaServiceRoleFD2F3C9D', + { + assumeRolePolicyDocument: { + Statement: [ + { + Action: 'sts:AssumeRole', + Effect: 'Allow', + Principal: { + Service: 'lambda.amazonaws.com', + }, + }, + ], + Version: '2012-10-17', + }, + managedPolicyArns: [ + [ + 'arn:', + cdk.Stack.of(this).partition, + ':iam::aws:policy/service-role/AWSLambdaBasicExecutionRole', + ].join(''), + ], + } + ); + + const customPlaceIndexLambdaServiceRoleDefaultPolicy818068B1 = + new iam.CfnPolicy( + this, + 'CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1', + { + policyDocument: { + Statement: [ + { + Action: 'geo:CreatePlaceIndex', + Effect: 'Allow', + Resource: '*', + }, + { + Action: ['geo:UpdatePlaceIndex', 'geo:DeletePlaceIndex'], + Effect: 'Allow', + Resource: `arn:aws:geo:${regionMapping.findInMap( + cdk.Stack.of(this).region, + 'locationServiceRegion' + )}:${cdk.Stack.of(this).account}:place-index/${[ + props.indexName!, + props.branchName!, + ].join('-')}`, + }, + ], + Version: '2012-10-17', + }, + policyName: 'CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1', + roles: [customPlaceIndexLambdaServiceRoleFd2f3c9d.ref], + } + ); + + const customPlaceIndexLambda79813Bb9 = new lambda.CfnFunction( + this, + 'CustomPlaceIndexLambda79813BB9', + { + code: { + zipFile: + "const response = require('cfn-response');\nconst { LocationClient, CreatePlaceIndexCommand, DeletePlaceIndexCommand, UpdatePlaceIndexCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSource: event.ResourceProperties.dataSource,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreatePlaceIndexCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdatePlaceIndexCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeletePlaceIndexCommand(params));\n event.PhysicalResourceId = event.ResourceProperties.indexName;\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.indexName);\n throw err;\n }\n};\n", + }, + handler: 'index.handler', + role: customPlaceIndexLambdaServiceRoleFd2f3c9d.attrArn, + runtime: 'nodejs22.x', + timeout: 300, + } + ); + customPlaceIndexLambda79813Bb9.addDependency( + customPlaceIndexLambdaServiceRoleDefaultPolicy818068B1 + ); + customPlaceIndexLambda79813Bb9.addDependency( + customPlaceIndexLambdaServiceRoleFd2f3c9d + ); + + const customPlaceIndex = new cdk.CfnCustomResource( + this, + 'CustomPlaceIndex', + { + serviceToken: customPlaceIndexLambda79813Bb9.attrArn, + } + ); + customPlaceIndex.addOverride('Type', 'Custom::LambdaCallout'); + customPlaceIndex.addPropertyOverride( + 'indexName', + [props.indexName!, props.branchName!].join('-') + ); + customPlaceIndex.addPropertyOverride('dataSource', props.dataProvider!); + customPlaceIndex.addPropertyOverride( + 'dataSourceIntendedUse', + props.dataSourceIntendedUse! + ); + customPlaceIndex.addPropertyOverride( + 'region', + regionMapping.findInMap( + cdk.Stack.of(this).region, + 'locationServiceRegion' + ) + ); + customPlaceIndex.addPropertyOverride('env', props.branchName!); + customPlaceIndex.cfnOptions.deletionPolicy = cdk.CfnDeletionPolicy.DELETE; + + const placeIndexPolicy = new iam.CfnPolicy(this, 'PlaceIndexPolicy', { + policyDocument: { + Statement: [ + { + Action: [ + 'geo:SearchPlaceIndexForPosition', + 'geo:SearchPlaceIndexForText', + 'geo:SearchPlaceIndexForSuggestions', + 'geo:GetPlace', + ], + Effect: 'Allow', + Resource: customPlaceIndex.getAtt('IndexArn').toString(), + }, + ], + Version: '2012-10-17', + }, + policyName: [ + [props.indexName!, props.branchName!].join('-'), + 'Policy', + ].join(''), + roles: [ + props.authRoleName!, + props.unauthRoleName!, + props.authuserPoolGroupsstoreLocatorAdminGroupRole!, + ], + }); + + // Outputs + this.name = customPlaceIndex.getAtt('IndexName').toString(); + new cdk.CfnOutput(this, 'CfnOutputName', { + key: 'Name', + value: this.name!.toString(), + }); + this.region = regionMapping.findInMap( + cdk.Stack.of(this).region, + 'locationServiceRegion' + ); + new cdk.CfnOutput(this, 'CfnOutputRegion', { + key: 'Region', + value: this.region!.toString(), + }); + this.arn = customPlaceIndex.getAtt('IndexArn').toString(); + new cdk.CfnOutput(this, 'CfnOutputArn', { + key: 'Arn', + value: this.arn!.toString(), + }); + } +} diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/package.json b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/package.json new file mode 100644 index 00000000000..3dbc1ca591c --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/tsconfig.json b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/tsconfig.json new file mode 100644 index 00000000000..fb4251ddaae --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/amplify/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "es2022", + "module": "es2022", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "paths": { + "$amplify/*": ["../.amplify/generated/*"] + } + } +} diff --git a/amplify-migration-apps/store-locator/_snapshot.post.generate/package.json b/amplify-migration-apps/store-locator/_snapshot.post.generate/package.json new file mode 100644 index 00000000000..60c4583620e --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.post.generate/package.json @@ -0,0 +1,53 @@ +{ + "name": "@amplify-migration-apps/store-locator", + "private": true, + "version": "0.0.0", + "type": "module", + "installConfig": { + "hoistingLimits": "workspaces" + }, + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview", + "sanitize": "tsx ../sanitize.ts", + "typecheck": "cd _snapshot.post.generate/amplify && npx tsc --noEmit" + }, + "dependencies": { + "@aws-amplify/geo": "^3.0.92", + "@aws-amplify/ui-react": "^6.13.2", + "@aws-amplify/ui-react-geo": "^2.2.13", + "@aws-sdk/client-cognito-identity-provider": "^3.1016.0", + "aws-amplify": "^6.16.0", + "axios": "latest", + "maplibre-gl": "^2.4.0", + "maplibre-gl-js-amplify": "^4.0.2", + "react": "^19.2.0", + "react-dom": "^19.2.0" + }, + "devDependencies": { + "@aws-amplify/backend": "^1.18.0", + "@aws-amplify/backend-cli": "^1.8.0", + "@aws-amplify/backend-data": "^1.6.2", + "@eslint/js": "^9.39.1", + "@types/aws-lambda": "^8.10.92", + "@types/node": "*", + "@types/react": "^19.2.5", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "aws-cdk": "^2", + "aws-cdk-lib": "^2", + "ci-info": "^4.3.1", + "constructs": "^10.0.0", + "esbuild": "^0.27.0", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "globals": "^16.5.0", + "tsx": "^4.20.6", + "typescript": "~5.9.3", + "typescript-eslint": "^8.46.4", + "vite": "^7.2.4" + } +} diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/.gitignore b/amplify-migration-apps/store-locator/_snapshot.pre.generate/.gitignore new file mode 100644 index 00000000000..ddc1f0fb628 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/.gitignore @@ -0,0 +1,21 @@ +#amplify-do-not-edit-begin +!amplify/\#current-cloud-backend +amplify/.config/local-* +!amplify/logs +!amplify/mock-data +!amplify/mock-api-resources +!amplify/backend/amplify-meta.json +!amplify/backend/.temp +!build/ +dist/ +node_modules/ +aws-exports.js +awsconfiguration.json +amplifyconfiguration.json +amplifyconfiguration.dart +amplify-build-config.json +amplify-gradle-config.json +amplifytools.xcconfig +.secret-* +**.sample +#amplify-do-not-edit-end \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/amplify-meta.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/amplify-meta.json new file mode 100644 index 00000000000..ead1cbf796c --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/amplify-meta.json @@ -0,0 +1,227 @@ +{ + "providers": { + "awscloudformation": { + "AuthRoleName": "amplify-storelocator-main-f9ca7-authRole", + "UnauthRoleArn": "arn:aws:iam::123456789012:role/amplify-storelocator-main-f9ca7-unauthRole", + "AuthRoleArn": "arn:aws:iam::123456789012:role/amplify-storelocator-main-f9ca7-authRole", + "Region": "us-east-1", + "DeploymentBucketName": "amplify-storelocator-main-f9ca7-deployment", + "UnauthRoleName": "amplify-storelocator-main-f9ca7-unauthRole", + "StackName": "amplify-storelocator-main-f9ca7", + "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/amplify-storelocator-main-f9ca7/06c2ecf0-279e-11f1-a161-0ea0286337e9", + "AmplifyAppId": "storelocator", + "AuthTriggerTemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/auth-trigger-cloudformation-template.json" + } + }, + "auth": { + "userPoolGroups": { + "service": "Cognito-UserPool-Groups", + "providerPlugin": "awscloudformation", + "dependsOn": [ + { + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f", + "attributes": [ + "UserPoolId", + "AppClientIDWeb", + "AppClientID", + "IdentityPoolId" + ] + } + ], + "lastPushTimeStamp": "2026-03-24T16:38:00.639Z", + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/userPoolGroups-cloudformation-template.json", + "logicalId": "authuserPoolGroups" + }, + "output": { + "storeLocatorAdminGroupRole": "arn:aws:iam::123456789012:role/us-east-1_R1pdziFVe-storeLocatorAdminGroupRole" + }, + "lastPushDirHash": "aY2fv0JwB9V2Pnq+Iavglw2oGVE=" + }, + "storelocator41a9495f41a9495f": { + "service": "Cognito", + "providerPlugin": "awscloudformation", + "dependsOn": [ + { + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "triggerProvider": "Cognito", + "attributes": [ + "Arn", + "Name" + ] + } + ], + "customAuth": false, + "frontendAuthConfig": { + "socialProviders": [], + "usernameAttributes": [ + "EMAIL" + ], + "signupAttributes": [ + "EMAIL" + ], + "passwordProtectionSettings": { + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [] + }, + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS" + ], + "verificationMechanisms": [ + "EMAIL" + ] + }, + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/storelocator41a9495f41a9495f-cloudformation-template.json", + "logicalId": "authstorelocator41a9495f41a9495f" + }, + "lastPushTimeStamp": "2026-03-24T16:38:00.639Z", + "output": { + "UserPoolId": "us-east-1_R1pdziFVe", + "AppClientIDWeb": "6am6ldh23n8ke819nuvk51cddq", + "AppClientID": "5ppvpdo9dmkrj55qi8h865lt34", + "IdentityPoolId": "us-east-1:4ea514e6-bc16-4990-a5ea-cefe84c3050d", + "UserPoolArn": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_R1pdziFVe", + "IdentityPoolName": "storelocator41a9495f_identitypool_41a9495f__main", + "UserPoolName": "storelocator41a9495f_userpool_41a9495f" + }, + "lastPushDirHash": "BhovtRkLGtk84r9ocO7d+lsB8TQ=" + } + }, + "function": { + "storelocator41a9495f41a9495fPostConfirmation": { + "build": true, + "providerPlugin": "awscloudformation", + "service": "Lambda", + "lastBuildTimeStamp": "2026-03-24T16:33:11.355Z", + "lastBuildType": "PROD", + "lastPackageTimeStamp": "2026-03-24T16:33:12.063Z", + "distZipFilename": "storelocator41a9495f41a9495fPostConfirmation-6a6c746d4739755a384a-build.zip", + "s3Bucket": { + "deploymentBucketName": "amplify-storelocator-main-f9ca7-deployment", + "s3Key": "amplify-builds/storelocator41a9495f41a9495fPostConfirmation-6a6c746d4739755a384a-build.zip" + }, + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/function/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json", + "logicalId": "functionstorelocator41a9495f41a9495fPostConfirmation" + }, + "lastPushTimeStamp": "2026-03-24T16:38:00.639Z", + "output": { + "LambdaExecutionRoleArn": "arn:aws:iam::123456789012:role/storelocator41a9495f41a9495fPostConfirmation-main", + "Region": "us-east-1", + "Arn": "arn:aws:lambda:us-east-1:123456789012:function:storelocator41a9495f41a9495fPostConfirmation-main", + "Name": "storelocator41a9495f41a9495fPostConfirmation-main", + "LambdaExecutionRole": "storelocator41a9495f41a9495fPostConfirmation-main" + }, + "lastPushDirHash": "6EQkwiPaTbkyYCg4JDkMQiOWz8g=" + } + }, + "geo": { + "storeLocatorMap": { + "isDefault": true, + "providerPlugin": "awscloudformation", + "service": "Map", + "mapStyle": "VectorEsriStreets", + "accessType": "AuthorizedAndGuestUsers", + "dependsOn": [ + { + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f", + "attributes": [ + "UserPoolId" + ] + }, + { + "category": "auth", + "resourceName": "userPoolGroups", + "attributes": [ + "storeLocatorAdminGroupRole" + ] + } + ], + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorMap-cloudformation-template.json", + "logicalId": "geostoreLocatorMap" + }, + "lastPushTimeStamp": "2026-03-24T16:38:00.639Z", + "output": { + "Style": "VectorEsriStreets", + "Region": "us-east-1", + "Arn": "arn:aws:geo:us-east-1:123456789012:map/storeLocatorMap-main", + "Name": "storeLocatorMap-main" + }, + "lastPushDirHash": "f6hS2nqVgBHpibNEdmumaRgBCRM=" + }, + "storeLocatorSearch": { + "isDefault": true, + "providerPlugin": "awscloudformation", + "service": "PlaceIndex", + "dataProvider": "HERE", + "dataSourceIntendedUse": "SingleUse", + "accessType": "AuthorizedAndGuestUsers", + "dependsOn": [ + { + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f", + "attributes": [ + "UserPoolId" + ] + }, + { + "category": "auth", + "resourceName": "userPoolGroups", + "attributes": [ + "storeLocatorAdminGroupRole" + ] + } + ], + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorSearch-cloudformation-template.json", + "logicalId": "geostoreLocatorSearch" + }, + "lastPushTimeStamp": "2026-03-24T16:38:00.639Z", + "output": { + "Region": "us-east-1", + "Arn": "arn:aws:geo:us-east-1:123456789012:place-index/storeLocatorSearch-main", + "Name": "storeLocatorSearch-main" + }, + "lastPushDirHash": "DcWb0RNLHGk1nlEWvQI8kcmIhuw=" + }, + "storeLocatorGeofence": { + "isDefault": true, + "providerPlugin": "awscloudformation", + "service": "GeofenceCollection", + "accessType": "CognitoGroups", + "dependsOn": [ + { + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f", + "attributes": [ + "UserPoolId" + ] + }, + { + "category": "auth", + "resourceName": "userPoolGroups", + "attributes": [ + "storeLocatorAdminGroupRole" + ] + } + ], + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorGeofence-cloudformation-template.json", + "logicalId": "geostoreLocatorGeofence" + }, + "lastPushTimeStamp": "2026-03-24T16:38:00.639Z", + "output": { + "Region": "us-east-1", + "Arn": "arn:aws:geo:us-east-1:123456789012:geofence-collection/storeLocatorGeofence-main", + "Name": "storeLocatorGeofence-main" + }, + "lastPushDirHash": "qBxz5+dofKzvXa0AVAS5tnATCqA=" + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/storelocator41a9495f41a9495f/build/auth-trigger-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/storelocator41a9495f41a9495f/build/auth-trigger-cloudformation-template.json new file mode 100644 index 00000000000..e6186c748d1 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/storelocator41a9495f41a9495f/build/auth-trigger-cloudformation-template.json @@ -0,0 +1,204 @@ +{ + "Description": "Custom Resource stack for Auth Trigger created using Amplify CLI", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "userpoolId": { + "Type": "String" + }, + "userpoolArn": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationLambdaExecutionRole": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "UserPoolPostConfirmationLambdaInvokePermission": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "functionstorelocator41a9495f41a9495fPostConfirmationName" + }, + "Principal": "cognito-idp.amazonaws.com", + "SourceArn": { + "Ref": "userpoolArn" + } + } + }, + "Amplifyfunctionstorelocator41a9495f41a9495fPostConfirmationNamePostConfirmationAddToGroupCognitoC0815C8F": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "cognito-idp:AdminAddUserToGroup", + "cognito-idp:GetGroup", + "cognito-idp:CreateGroup" + ], + "Effect": "Allow", + "Resource": { + "Ref": "userpoolArn" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AddToGroupCognito", + "Roles": [ + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "functionstorelocator41a9495f41a9495fPostConfirmationLambdaExecutionRole" + } + ] + } + ] + } + ] + } + ] + } + ] + } + }, + "authTriggerFnServiceRole08093B67": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "authTriggerFnServiceRoleDefaultPolicyEC9285A8": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "cognito-idp:DescribeUserPool", + "cognito-idp:UpdateUserPool" + ], + "Effect": "Allow", + "Resource": { + "Ref": "userpoolArn" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "authTriggerFnServiceRoleDefaultPolicyEC9285A8", + "Roles": [ + { + "Ref": "authTriggerFnServiceRole08093B67" + } + ] + } + }, + "authTriggerFn7FCFA449": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst {\n CognitoIdentityProviderClient,\n DescribeUserPoolCommand,\n UpdateUserPoolCommand,\n} = require('@aws-sdk/client-cognito-identity-provider');\n\nexports.handler = (event, context) => {\n // Don't return promise, response.send() marks context as done internally\n void tryHandleEvent(event, context);\n};\n\nasync function tryHandleEvent(event, context) {\n const physicalResourceId =\n event.RequestType === 'Update' ? event.PhysicalResourceId : `${event.LogicalResourceId}-${event.ResourceProperties.userpoolId}`;\n try {\n await handleEvent(event);\n response.send(event, context, response.SUCCESS, {}, physicalResourceId);\n } catch (err) {\n console.log(err.stack);\n response.send(event, context, response.FAILED, { err }, physicalResourceId);\n }\n}\n\nasync function handleEvent(event) {\n const userPoolId = event.ResourceProperties.userpoolId;\n const { lambdaConfig } = event.ResourceProperties;\n const config = {};\n const cognitoClient = new CognitoIdentityProviderClient({});\n const userPoolConfig = await cognitoClient.send(new DescribeUserPoolCommand({ UserPoolId: userPoolId }));\n const userPoolParams = userPoolConfig.UserPool;\n // update userPool params\n\n const updateUserPoolConfig = {\n UserPoolId: userPoolParams.Id,\n Policies: userPoolParams.Policies,\n SmsVerificationMessage: userPoolParams.SmsVerificationMessage,\n AccountRecoverySetting: userPoolParams.AccountRecoverySetting,\n AdminCreateUserConfig: userPoolParams.AdminCreateUserConfig,\n AutoVerifiedAttributes: userPoolParams.AutoVerifiedAttributes,\n EmailConfiguration: userPoolParams.EmailConfiguration,\n EmailVerificationMessage: userPoolParams.EmailVerificationMessage,\n EmailVerificationSubject: userPoolParams.EmailVerificationSubject,\n VerificationMessageTemplate: userPoolParams.VerificationMessageTemplate,\n SmsAuthenticationMessage: userPoolParams.SmsAuthenticationMessage,\n MfaConfiguration: userPoolParams.MfaConfiguration,\n DeviceConfiguration: userPoolParams.DeviceConfiguration,\n SmsConfiguration: userPoolParams.SmsConfiguration,\n UserPoolTags: userPoolParams.UserPoolTags,\n UserPoolAddOns: userPoolParams.UserPoolAddOns,\n };\n\n // removing undefined keys\n Object.keys(updateUserPoolConfig).forEach((key) => updateUserPoolConfig[key] === undefined && delete updateUserPoolConfig[key]);\n\n /* removing UnusedAccountValidityDays as deprecated\n InvalidParameterException: Please use TemporaryPasswordValidityDays in PasswordPolicy instead of UnusedAccountValidityDays\n */\n if (updateUserPoolConfig.AdminCreateUserConfig && updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays) {\n delete updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays;\n }\n lambdaConfig.forEach((lambda) => (config[`${lambda.triggerType}`] = lambda.lambdaFunctionArn));\n if (event.RequestType === 'Delete') {\n updateUserPoolConfig.LambdaConfig = {};\n console.log(`${event.RequestType}:`, JSON.stringify(updateUserPoolConfig));\n const result = await cognitoClient.send(new UpdateUserPoolCommand(updateUserPoolConfig));\n console.log(`delete response data ${JSON.stringify(result)}`);\n } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {\n updateUserPoolConfig.LambdaConfig = config;\n const result = await cognitoClient.send(new UpdateUserPoolCommand(updateUserPoolConfig));\n console.log(`createOrUpdate response data ${JSON.stringify(result)}`);\n }\n}\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "authTriggerFnServiceRole08093B67", + "Arn" + ] + }, + "Runtime": "nodejs22.x" + }, + "DependsOn": [ + "authTriggerFnServiceRoleDefaultPolicyEC9285A8", + "authTriggerFnServiceRole08093B67" + ] + }, + "CustomAuthTriggerResource": { + "Type": "Custom::CustomAuthTriggerResourceOutputs", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "authTriggerFn7FCFA449", + "Arn" + ] + }, + "userpoolId": { + "Ref": "userpoolId" + }, + "lambdaConfig": [ + { + "triggerType": "PostConfirmation", + "lambdaFunctionName": "storelocator41a9495f41a9495fPostConfirmation", + "lambdaFunctionArn": { + "Ref": "functionstorelocator41a9495f41a9495fPostConfirmationArn" + } + } + ], + "nonce": "a956ed2b-ea63-4747-acee-0f4cb27b3925" + }, + "DependsOn": [ + "authTriggerFn7FCFA449", + "authTriggerFnServiceRoleDefaultPolicyEC9285A8", + "authTriggerFnServiceRole08093B67" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/storelocator41a9495f41a9495f/build/parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/storelocator41a9495f41a9495f/build/parameters.json new file mode 100644 index 00000000000..cba9966059e --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/storelocator41a9495f41a9495f/build/parameters.json @@ -0,0 +1,82 @@ +{ + "identityPoolName": "storelocator41a9495f_identitypool_41a9495f", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "storel41a9495f", + "userPoolName": "storelocator41a9495f_userpool_41a9495f", + "autoVerifiedAttributes": [ + "email" + ], + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS Text Message" + ], + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [], + "requiredAttributes": [ + "email" + ], + "aliasAttributes": [], + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": "100", + "userpoolClientWriteAttributes": [ + "email" + ], + "userpoolClientReadAttributes": [ + "email" + ], + "userpoolClientLambdaRole": "storel41a9495f_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "41a9495f", + "resourceName": "storelocator41a9495f41a9495f", + "authSelections": "identityPoolAndUserPool", + "useDefault": "manual", + "thirdPartyAuth": false, + "usernameAttributes": [ + "email" + ], + "userPoolGroups": true, + "adminQueries": false, + "triggers": "{\"PostConfirmation\":[\"add-to-group\"]}", + "hostedUI": false, + "userPoolGroupList": [ + "storeLocatorAdmin" + ], + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": [ + { + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "triggerProvider": "Cognito", + "attributes": [ + "Arn", + "Name" + ] + } + ], + "permissions": [ + "{\"policyName\":\"AddToGroupCognito\",\"trigger\":\"PostConfirmation\",\"effect\":\"Allow\",\"actions\":[\"cognito-idp:AdminAddUserToGroup\",\"cognito-idp:GetGroup\",\"cognito-idp:CreateGroup\"],\"resource\":{\"paramType\":\"!GetAtt\",\"keys\":[\"UserPool\",\"Arn\"]}}" + ], + "authTriggerConnections": [ + "{\"triggerType\":\"PostConfirmation\",\"lambdaFunctionName\":\"storelocator41a9495f41a9495fPostConfirmation\"}" + ] +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/storelocator41a9495f41a9495f/build/storelocator41a9495f41a9495f-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/storelocator41a9495f41a9495f/build/storelocator41a9495f41a9495f-cloudformation-template.json new file mode 100644 index 00000000000..32f0ad747e9 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/storelocator41a9495f41a9495f/build/storelocator41a9495f41a9495f-cloudformation-template.json @@ -0,0 +1,486 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"auth-Cognito\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Type": "String", + "Default": "functionstorelocator41a9495f41a9495fPostConfirmationArn" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Type": "String", + "Default": "functionstorelocator41a9495f41a9495fPostConfirmationName" + }, + "identityPoolName": { + "Type": "String" + }, + "allowUnauthenticatedIdentities": { + "Type": "String" + }, + "resourceNameTruncated": { + "Type": "String" + }, + "userPoolName": { + "Type": "String" + }, + "autoVerifiedAttributes": { + "Type": "CommaDelimitedList" + }, + "mfaConfiguration": { + "Type": "String" + }, + "mfaTypes": { + "Type": "CommaDelimitedList" + }, + "smsAuthenticationMessage": { + "Type": "String" + }, + "smsVerificationMessage": { + "Type": "String" + }, + "emailVerificationSubject": { + "Type": "String" + }, + "emailVerificationMessage": { + "Type": "String" + }, + "defaultPasswordPolicy": { + "Type": "String" + }, + "passwordPolicyMinLength": { + "Type": "String" + }, + "passwordPolicyCharacters": { + "Type": "CommaDelimitedList" + }, + "requiredAttributes": { + "Type": "CommaDelimitedList" + }, + "aliasAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientGenerateSecret": { + "Type": "String" + }, + "userpoolClientRefreshTokenValidity": { + "Type": "String" + }, + "userpoolClientWriteAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientReadAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientLambdaRole": { + "Type": "String" + }, + "userpoolClientSetAttributes": { + "Type": "String" + }, + "sharedId": { + "Type": "String" + }, + "resourceName": { + "Type": "String" + }, + "authSelections": { + "Type": "String" + }, + "useDefault": { + "Type": "String" + }, + "thirdPartyAuth": { + "Type": "String" + }, + "usernameAttributes": { + "Type": "CommaDelimitedList" + }, + "userPoolGroups": { + "Type": "String" + }, + "adminQueries": { + "Type": "String" + }, + "triggers": { + "Type": "String" + }, + "hostedUI": { + "Type": "String" + }, + "userPoolGroupList": { + "Type": "CommaDelimitedList" + }, + "serviceName": { + "Type": "String" + }, + "usernameCaseSensitive": { + "Type": "String" + }, + "useEnabledMfas": { + "Type": "String" + }, + "authRoleArn": { + "Type": "String" + }, + "unauthRoleArn": { + "Type": "String" + }, + "breakCircularDependency": { + "Type": "String" + }, + "dependsOn": { + "Type": "CommaDelimitedList" + }, + "permissions": { + "Type": "CommaDelimitedList" + }, + "authTriggerConnections": { + "Type": "CommaDelimitedList" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "UserPool": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AutoVerifiedAttributes": [ + "email" + ], + "EmailVerificationMessage": { + "Ref": "emailVerificationMessage" + }, + "EmailVerificationSubject": { + "Ref": "emailVerificationSubject" + }, + "MfaConfiguration": { + "Ref": "mfaConfiguration" + }, + "Policies": { + "PasswordPolicy": { + "MinimumLength": { + "Ref": "passwordPolicyMinLength" + }, + "RequireLowercase": false, + "RequireNumbers": false, + "RequireSymbols": false, + "RequireUppercase": false + } + }, + "Schema": [ + { + "Mutable": true, + "Name": "email", + "Required": true + } + ], + "UserAttributeUpdateSettings": { + "AttributesRequireVerificationBeforeUpdate": [ + "email" + ] + }, + "UserPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userPoolName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "userPoolName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "UsernameAttributes": { + "Ref": "usernameAttributes" + }, + "UsernameConfiguration": { + "CaseSensitive": false + } + } + }, + "UserPoolClientWeb": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "storel41a9495f_app_clientWeb", + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClient": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "storel41a9495f_app_client", + "GenerateSecret": { + "Ref": "userpoolClientGenerateSecret" + }, + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClientRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + }, + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userpoolClientLambdaRole" + }, + { + "Fn::Join": [ + "", + [ + "upClientLambdaRole41a9495f", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPool": { + "Type": "AWS::Cognito::IdentityPool", + "Properties": { + "AllowUnauthenticatedIdentities": { + "Ref": "allowUnauthenticatedIdentities" + }, + "CognitoIdentityProviders": [ + { + "ClientId": { + "Ref": "UserPoolClient" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + }, + { + "ClientId": { + "Ref": "UserPoolClientWeb" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + } + ], + "IdentityPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f_identitypool_41a9495f", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f_identitypool_41a9495f__", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPoolRoleMap": { + "Type": "AWS::Cognito::IdentityPoolRoleAttachment", + "Properties": { + "IdentityPoolId": { + "Ref": "IdentityPool" + }, + "RoleMappings": { + "UserPoolClientRoleMapping": { + "AmbiguousRoleResolution": "AuthenticatedRole", + "IdentityProvider": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${userPool}:${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "userPool": { + "Ref": "UserPool" + }, + "client": { + "Ref": "UserPoolClient" + } + } + ] + }, + "Type": "Token" + }, + "UserPoolWebClientRoleMapping": { + "AmbiguousRoleResolution": "AuthenticatedRole", + "IdentityProvider": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${userPool}:${webClient}", + { + "region": { + "Ref": "AWS::Region" + }, + "userPool": { + "Ref": "UserPool" + }, + "webClient": { + "Ref": "UserPoolClientWeb" + } + } + ] + }, + "Type": "Token" + } + }, + "Roles": { + "unauthenticated": { + "Ref": "unauthRoleArn" + }, + "authenticated": { + "Ref": "authRoleArn" + } + } + }, + "DependsOn": [ + "IdentityPool", + "UserPoolClient", + "UserPoolClientWeb" + ] + } + }, + "Outputs": { + "IdentityPoolId": { + "Description": "Id for the identity pool", + "Value": { + "Ref": "IdentityPool" + } + }, + "IdentityPoolName": { + "Value": { + "Fn::GetAtt": [ + "IdentityPool", + "Name" + ] + } + }, + "UserPoolId": { + "Description": "Id for the user pool", + "Value": { + "Ref": "UserPool" + } + }, + "UserPoolArn": { + "Description": "Arn for the user pool", + "Value": { + "Fn::GetAtt": [ + "UserPool", + "Arn" + ] + } + }, + "UserPoolName": { + "Value": { + "Ref": "userPoolName" + } + }, + "AppClientIDWeb": { + "Description": "The user pool app client id for web", + "Value": { + "Ref": "UserPoolClientWeb" + } + }, + "AppClientID": { + "Description": "The user pool app client id", + "Value": { + "Ref": "UserPoolClient" + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/storelocator41a9495f41a9495f/cli-inputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/storelocator41a9495f41a9495f/cli-inputs.json new file mode 100644 index 00000000000..c66baffc70c --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/storelocator41a9495f41a9495f/cli-inputs.json @@ -0,0 +1,89 @@ +{ + "version": "1", + "cognitoConfig": { + "identityPoolName": "storelocator41a9495f_identitypool_41a9495f", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "storel41a9495f", + "userPoolName": "storelocator41a9495f_userpool_41a9495f", + "autoVerifiedAttributes": [ + "email" + ], + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS Text Message" + ], + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [], + "requiredAttributes": [ + "email" + ], + "aliasAttributes": [], + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": "100", + "userpoolClientWriteAttributes": [ + "email" + ], + "userpoolClientReadAttributes": [ + "email" + ], + "userpoolClientLambdaRole": "storel41a9495f_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "41a9495f", + "resourceName": "storelocator41a9495f41a9495f", + "authSelections": "identityPoolAndUserPool", + "useDefault": "manual", + "thirdPartyAuth": false, + "usernameAttributes": [ + "email" + ], + "userPoolGroups": true, + "adminQueries": false, + "triggers": { + "PostConfirmation": [ + "add-to-group" + ] + }, + "hostedUI": false, + "userPoolGroupList": [ + "storeLocatorAdmin" + ], + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": [ + { + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "triggerProvider": "Cognito", + "attributes": [ + "Arn", + "Name" + ] + } + ], + "permissions": [ + "{\"policyName\":\"AddToGroupCognito\",\"trigger\":\"PostConfirmation\",\"effect\":\"Allow\",\"actions\":[\"cognito-idp:AdminAddUserToGroup\",\"cognito-idp:GetGroup\",\"cognito-idp:CreateGroup\"],\"resource\":{\"paramType\":\"!GetAtt\",\"keys\":[\"UserPool\",\"Arn\"]}}" + ], + "authTriggerConnections": [ + "{\"triggerType\":\"PostConfirmation\",\"lambdaFunctionName\":\"storelocator41a9495f41a9495fPostConfirmation\"}" + ] + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/userPoolGroups/build/parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/userPoolGroups/build/parameters.json new file mode 100644 index 00000000000..48115bd5cd6 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/userPoolGroups/build/parameters.json @@ -0,0 +1,14 @@ +{ + "AuthRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "UnauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/userPoolGroups/build/userPoolGroups-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/userPoolGroups/build/userPoolGroups-cloudformation-template.json new file mode 100644 index 00000000000..5edc3def07d --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/userPoolGroups/build/userPoolGroups-cloudformation-template.json @@ -0,0 +1,109 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"auth-Cognito-UserPool-Groups\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "AuthRoleArn": { + "Type": "String" + }, + "UnauthRoleArn": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "authstorelocator41a9495f41a9495fIdentityPoolId": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fIdentityPoolId" + }, + "authstorelocator41a9495f41a9495fAppClientID": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fAppClientID" + }, + "authstorelocator41a9495f41a9495fAppClientIDWeb": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fAppClientIDWeb" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "storeLocatorAdminGroup": { + "Type": "AWS::Cognito::UserPoolGroup", + "Properties": { + "Description": "override success", + "GroupName": "storeLocatorAdmin", + "Precedence": 1, + "RoleArn": { + "Fn::GetAtt": [ + "storeLocatorAdminGroupRole", + "Arn" + ] + }, + "UserPoolId": { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + } + } + }, + "storeLocatorAdminGroupRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Allow", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity", + "Condition": { + "StringEquals": { + "cognito-identity.amazonaws.com:aud": { + "Ref": "authstorelocator41a9495f41a9495fIdentityPoolId" + } + }, + "ForAnyValue:StringLike": { + "cognito-identity.amazonaws.com:amr": "authenticated" + } + } + } + ] + }, + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "-storeLocatorAdminGroupRole" + ] + ] + } + } + } + }, + "Outputs": { + "storeLocatorAdminGroupRole": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorAdminGroupRole", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/userPoolGroups/user-pool-group-precedence.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/userPoolGroups/user-pool-group-precedence.json new file mode 100644 index 00000000000..bcc9738de65 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/auth/userPoolGroups/user-pool-group-precedence.json @@ -0,0 +1,6 @@ +[ + { + "groupName": "storeLocatorAdmin", + "precedence": 1 + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/auth/storelocator41a9495f41a9495f/build/storelocator41a9495f41a9495f-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/auth/storelocator41a9495f41a9495f/build/storelocator41a9495f41a9495f-cloudformation-template.json new file mode 100644 index 00000000000..32f0ad747e9 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/auth/storelocator41a9495f41a9495f/build/storelocator41a9495f41a9495f-cloudformation-template.json @@ -0,0 +1,486 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"auth-Cognito\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Type": "String", + "Default": "functionstorelocator41a9495f41a9495fPostConfirmationArn" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Type": "String", + "Default": "functionstorelocator41a9495f41a9495fPostConfirmationName" + }, + "identityPoolName": { + "Type": "String" + }, + "allowUnauthenticatedIdentities": { + "Type": "String" + }, + "resourceNameTruncated": { + "Type": "String" + }, + "userPoolName": { + "Type": "String" + }, + "autoVerifiedAttributes": { + "Type": "CommaDelimitedList" + }, + "mfaConfiguration": { + "Type": "String" + }, + "mfaTypes": { + "Type": "CommaDelimitedList" + }, + "smsAuthenticationMessage": { + "Type": "String" + }, + "smsVerificationMessage": { + "Type": "String" + }, + "emailVerificationSubject": { + "Type": "String" + }, + "emailVerificationMessage": { + "Type": "String" + }, + "defaultPasswordPolicy": { + "Type": "String" + }, + "passwordPolicyMinLength": { + "Type": "String" + }, + "passwordPolicyCharacters": { + "Type": "CommaDelimitedList" + }, + "requiredAttributes": { + "Type": "CommaDelimitedList" + }, + "aliasAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientGenerateSecret": { + "Type": "String" + }, + "userpoolClientRefreshTokenValidity": { + "Type": "String" + }, + "userpoolClientWriteAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientReadAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientLambdaRole": { + "Type": "String" + }, + "userpoolClientSetAttributes": { + "Type": "String" + }, + "sharedId": { + "Type": "String" + }, + "resourceName": { + "Type": "String" + }, + "authSelections": { + "Type": "String" + }, + "useDefault": { + "Type": "String" + }, + "thirdPartyAuth": { + "Type": "String" + }, + "usernameAttributes": { + "Type": "CommaDelimitedList" + }, + "userPoolGroups": { + "Type": "String" + }, + "adminQueries": { + "Type": "String" + }, + "triggers": { + "Type": "String" + }, + "hostedUI": { + "Type": "String" + }, + "userPoolGroupList": { + "Type": "CommaDelimitedList" + }, + "serviceName": { + "Type": "String" + }, + "usernameCaseSensitive": { + "Type": "String" + }, + "useEnabledMfas": { + "Type": "String" + }, + "authRoleArn": { + "Type": "String" + }, + "unauthRoleArn": { + "Type": "String" + }, + "breakCircularDependency": { + "Type": "String" + }, + "dependsOn": { + "Type": "CommaDelimitedList" + }, + "permissions": { + "Type": "CommaDelimitedList" + }, + "authTriggerConnections": { + "Type": "CommaDelimitedList" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "UserPool": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AutoVerifiedAttributes": [ + "email" + ], + "EmailVerificationMessage": { + "Ref": "emailVerificationMessage" + }, + "EmailVerificationSubject": { + "Ref": "emailVerificationSubject" + }, + "MfaConfiguration": { + "Ref": "mfaConfiguration" + }, + "Policies": { + "PasswordPolicy": { + "MinimumLength": { + "Ref": "passwordPolicyMinLength" + }, + "RequireLowercase": false, + "RequireNumbers": false, + "RequireSymbols": false, + "RequireUppercase": false + } + }, + "Schema": [ + { + "Mutable": true, + "Name": "email", + "Required": true + } + ], + "UserAttributeUpdateSettings": { + "AttributesRequireVerificationBeforeUpdate": [ + "email" + ] + }, + "UserPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userPoolName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "userPoolName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "UsernameAttributes": { + "Ref": "usernameAttributes" + }, + "UsernameConfiguration": { + "CaseSensitive": false + } + } + }, + "UserPoolClientWeb": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "storel41a9495f_app_clientWeb", + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClient": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "storel41a9495f_app_client", + "GenerateSecret": { + "Ref": "userpoolClientGenerateSecret" + }, + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClientRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + }, + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userpoolClientLambdaRole" + }, + { + "Fn::Join": [ + "", + [ + "upClientLambdaRole41a9495f", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPool": { + "Type": "AWS::Cognito::IdentityPool", + "Properties": { + "AllowUnauthenticatedIdentities": { + "Ref": "allowUnauthenticatedIdentities" + }, + "CognitoIdentityProviders": [ + { + "ClientId": { + "Ref": "UserPoolClient" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + }, + { + "ClientId": { + "Ref": "UserPoolClientWeb" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + } + ], + "IdentityPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f_identitypool_41a9495f", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f_identitypool_41a9495f__", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPoolRoleMap": { + "Type": "AWS::Cognito::IdentityPoolRoleAttachment", + "Properties": { + "IdentityPoolId": { + "Ref": "IdentityPool" + }, + "RoleMappings": { + "UserPoolClientRoleMapping": { + "AmbiguousRoleResolution": "AuthenticatedRole", + "IdentityProvider": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${userPool}:${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "userPool": { + "Ref": "UserPool" + }, + "client": { + "Ref": "UserPoolClient" + } + } + ] + }, + "Type": "Token" + }, + "UserPoolWebClientRoleMapping": { + "AmbiguousRoleResolution": "AuthenticatedRole", + "IdentityProvider": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${userPool}:${webClient}", + { + "region": { + "Ref": "AWS::Region" + }, + "userPool": { + "Ref": "UserPool" + }, + "webClient": { + "Ref": "UserPoolClientWeb" + } + } + ] + }, + "Type": "Token" + } + }, + "Roles": { + "unauthenticated": { + "Ref": "unauthRoleArn" + }, + "authenticated": { + "Ref": "authRoleArn" + } + } + }, + "DependsOn": [ + "IdentityPool", + "UserPoolClient", + "UserPoolClientWeb" + ] + } + }, + "Outputs": { + "IdentityPoolId": { + "Description": "Id for the identity pool", + "Value": { + "Ref": "IdentityPool" + } + }, + "IdentityPoolName": { + "Value": { + "Fn::GetAtt": [ + "IdentityPool", + "Name" + ] + } + }, + "UserPoolId": { + "Description": "Id for the user pool", + "Value": { + "Ref": "UserPool" + } + }, + "UserPoolArn": { + "Description": "Arn for the user pool", + "Value": { + "Fn::GetAtt": [ + "UserPool", + "Arn" + ] + } + }, + "UserPoolName": { + "Value": { + "Ref": "userPoolName" + } + }, + "AppClientIDWeb": { + "Description": "The user pool app client id for web", + "Value": { + "Ref": "UserPoolClientWeb" + } + }, + "AppClientID": { + "Description": "The user pool app client id", + "Value": { + "Ref": "UserPoolClient" + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/auth/userPoolGroups/build/userPoolGroups-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/auth/userPoolGroups/build/userPoolGroups-cloudformation-template.json new file mode 100644 index 00000000000..5edc3def07d --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/auth/userPoolGroups/build/userPoolGroups-cloudformation-template.json @@ -0,0 +1,109 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"auth-Cognito-UserPool-Groups\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "AuthRoleArn": { + "Type": "String" + }, + "UnauthRoleArn": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "authstorelocator41a9495f41a9495fIdentityPoolId": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fIdentityPoolId" + }, + "authstorelocator41a9495f41a9495fAppClientID": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fAppClientID" + }, + "authstorelocator41a9495f41a9495fAppClientIDWeb": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fAppClientIDWeb" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "storeLocatorAdminGroup": { + "Type": "AWS::Cognito::UserPoolGroup", + "Properties": { + "Description": "override success", + "GroupName": "storeLocatorAdmin", + "Precedence": 1, + "RoleArn": { + "Fn::GetAtt": [ + "storeLocatorAdminGroupRole", + "Arn" + ] + }, + "UserPoolId": { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + } + } + }, + "storeLocatorAdminGroupRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Allow", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity", + "Condition": { + "StringEquals": { + "cognito-identity.amazonaws.com:aud": { + "Ref": "authstorelocator41a9495f41a9495fIdentityPoolId" + } + }, + "ForAnyValue:StringLike": { + "cognito-identity.amazonaws.com:amr": "authenticated" + } + } + } + ] + }, + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "-storeLocatorAdminGroupRole" + ] + ] + } + } + } + }, + "Outputs": { + "storeLocatorAdminGroupRole": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorAdminGroupRole", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/awscloudformation/build/root-cloudformation-stack.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/awscloudformation/build/root-cloudformation-stack.json new file mode 100644 index 00000000000..1b8df321c23 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/awscloudformation/build/root-cloudformation-stack.json @@ -0,0 +1,653 @@ +{ + "Description": "Root Stack for AWS Amplify CLI", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "DeploymentBucketName": { + "Type": "String", + "Default": "DeploymentBucket", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "AuthRoleName": { + "Type": "String", + "Default": "AuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "UnauthRoleName": { + "Type": "String", + "Default": "UnAuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + } + }, + "Outputs": { + "Region": { + "Description": "CloudFormation provider root stack Region", + "Value": { + "Ref": "AWS::Region" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-Region" + } + } + }, + "StackName": { + "Description": "CloudFormation provider root stack ID", + "Value": { + "Ref": "AWS::StackName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackName" + } + } + }, + "StackId": { + "Description": "CloudFormation provider root stack name", + "Value": { + "Ref": "AWS::StackId" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackId" + } + } + }, + "AuthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + "UnauthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + }, + "DeploymentBucketName": { + "Description": "CloudFormation provider root stack deployment bucket name", + "Value": { + "Ref": "DeploymentBucketName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-DeploymentBucketName" + } + } + }, + "AuthRoleName": { + "Value": { + "Ref": "AuthRole" + } + }, + "UnauthRoleName": { + "Value": { + "Ref": "UnauthRole" + } + } + }, + "Resources": { + "DeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Ref": "DeploymentBucketName" + }, + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "DeploymentBucketBlockHTTP": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "DeploymentBucketName" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Effect": "Deny", + "Principal": "*", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "DeploymentBucketName" + }, + "/*" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "DeploymentBucketName" + } + ] + ] + } + ], + "Condition": { + "Bool": { + "aws:SecureTransport": false + } + } + } + ] + } + } + }, + "AuthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "AuthRoleName" + } + } + }, + "UnauthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "UnauthRoleName" + } + } + }, + "AuthTriggerCustomLambdaStack": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/auth-trigger-cloudformation-template.json", + "Parameters": { + "env": "main", + "userpoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "userpoolArn": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolArn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationLambdaExecutionRole": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.LambdaExecutionRoleArn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.Arn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.Name" + ] + } + } + }, + "DependsOn": [ + "authstorelocator41a9495f41a9495f", + "functionstorelocator41a9495f41a9495fPostConfirmation" + ] + }, + "authuserPoolGroups": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/userPoolGroups-cloudformation-template.json", + "Parameters": { + "AuthRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "UnauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authstorelocator41a9495f41a9495fAppClientIDWeb": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.AppClientIDWeb" + ] + }, + "authstorelocator41a9495f41a9495fAppClientID": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.AppClientID" + ] + }, + "authstorelocator41a9495f41a9495fIdentityPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.IdentityPoolId" + ] + }, + "env": "main" + } + } + }, + "authstorelocator41a9495f41a9495f": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/storelocator41a9495f41a9495f-cloudformation-template.json", + "Parameters": { + "identityPoolName": "storelocator41a9495f_identitypool_41a9495f", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "storel41a9495f", + "userPoolName": "storelocator41a9495f_userpool_41a9495f", + "autoVerifiedAttributes": "email", + "mfaConfiguration": "OFF", + "mfaTypes": "SMS Text Message", + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": "", + "requiredAttributes": "email", + "aliasAttributes": "", + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": "100", + "userpoolClientWriteAttributes": "email", + "userpoolClientReadAttributes": "email", + "userpoolClientLambdaRole": "storel41a9495f_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "41a9495f", + "resourceName": "storelocator41a9495f41a9495f", + "authSelections": "identityPoolAndUserPool", + "useDefault": "manual", + "thirdPartyAuth": false, + "usernameAttributes": "email", + "userPoolGroups": true, + "adminQueries": false, + "triggers": "{\"PostConfirmation\":[\"add-to-group\"]}", + "hostedUI": false, + "userPoolGroupList": "storeLocatorAdmin", + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": "[object Object]", + "permissions": "{\"policyName\":\"AddToGroupCognito\",\"trigger\":\"PostConfirmation\",\"effect\":\"Allow\",\"actions\":[\"cognito-idp:AdminAddUserToGroup\",\"cognito-idp:GetGroup\",\"cognito-idp:CreateGroup\"],\"resource\":{\"paramType\":\"!GetAtt\",\"keys\":[\"UserPool\",\"Arn\"]}}", + "authTriggerConnections": "{\"triggerType\":\"PostConfirmation\",\"lambdaFunctionName\":\"storelocator41a9495f41a9495fPostConfirmation\"}", + "env": "main" + } + } + }, + "functionstorelocator41a9495f41a9495fPostConfirmation": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/function/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json", + "Parameters": { + "modules": "add-to-group", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "GROUP": "storeLocatorAdmin", + "deploymentBucketName": "amplify-storelocator-main-f9ca7-deployment", + "s3Key": "amplify-builds/storelocator41a9495f41a9495fPostConfirmation-6a6c746d4739755a384a-build.zip", + "env": "main" + } + } + }, + "geostoreLocatorMap": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorMap-cloudformation-template.json", + "Parameters": { + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "mapName": "storeLocatorMap", + "mapStyle": "VectorEsriStreets", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "geostoreLocatorSearch": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorSearch-cloudformation-template.json", + "Parameters": { + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "indexName": "storeLocatorSearch", + "dataProvider": "Here", + "dataSourceIntendedUse": "SingleUse", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "geostoreLocatorGeofence": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorGeofence-cloudformation-template.json", + "Parameters": { + "collectionName": "storeLocatorGeofence", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "UpdateRolesWithIDPFunction": { + "DependsOn": [ + "AuthRole", + "UnauthRole", + "authstorelocator41a9495f41a9495f" + ], + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": { + "Fn::Join": [ + "\n", + [ + "const response = require('cfn-response');", + "const { IAMClient, GetRoleCommand, UpdateAssumeRolePolicyCommand } = require('@aws-sdk/client-iam');", + "exports.handler = function(event, context) {", + " // Don't return promise, response.send() marks context as done internally", + " const ignoredPromise = handleEvent(event, context)", + "};", + "async function handleEvent(event, context) {", + " try {", + " let authRoleName = event.ResourceProperties.authRoleName;", + " let unauthRoleName = event.ResourceProperties.unauthRoleName;", + " let idpId = event.ResourceProperties.idpId;", + " let authParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'authenticated'}", + " }", + " }]", + " };", + " let unauthParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'unauthenticated'}", + " }", + " }]", + " };", + " if (event.RequestType === 'Delete') {", + " try {", + " delete authParamsJson.Statement[0].Condition;", + " delete unauthParamsJson.Statement[0].Condition;", + " authParamsJson.Statement[0].Effect = 'Deny'", + " unauthParamsJson.Statement[0].Effect = 'Deny'", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let res = await Promise.all([", + " iam.send(new GetRoleCommand({RoleName: authParams.RoleName})),", + " iam.send(new GetRoleCommand({RoleName: unauthParams.RoleName}))", + " ]);", + " res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.SUCCESS, {Error: err});", + " }", + " } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " }", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.FAILED, {Error: err});", + " }", + "};" + ] + ] + } + }, + "Handler": "index.handler", + "Runtime": "nodejs22.x", + "Timeout": 300, + "Role": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunctionRole", + "Arn" + ] + } + } + }, + "UpdateRolesWithIDPFunctionOutputs": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunction", + "Arn" + ] + }, + "region": { + "Ref": "AWS::Region" + }, + "idpId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.IdentityPoolId" + ] + }, + "authRoleName": { + "Ref": "AuthRole" + }, + "unauthRoleName": { + "Ref": "UnauthRole" + } + } + }, + "UpdateRolesWithIDPFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "AuthRole" + }, + "-idp" + ] + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + }, + "Policies": [ + { + "PolicyName": "UpdateRolesWithIDPFunctionPolicy", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/function/storelocator41a9495f41a9495fPostConfirmation/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/function/storelocator41a9495f41a9495fPostConfirmation/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json new file mode 100644 index 00000000000..192bbea9292 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/function/storelocator41a9495f41a9495fPostConfirmation/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json @@ -0,0 +1,235 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"function-Lambda\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "Parameters": { + "GROUP": { + "Type": "String", + "Default": "" + }, + "modules": { + "Type": "String", + "Default": "", + "Description": "Comma-delimited list of modules to be executed by a lambda trigger. Sent to resource as an env variable." + }, + "resourceName": { + "Type": "String", + "Default": "" + }, + "trigger": { + "Type": "String", + "Default": "true" + }, + "functionName": { + "Type": "String", + "Default": "" + }, + "roleName": { + "Type": "String", + "Default": "" + }, + "parentResource": { + "Type": "String", + "Default": "" + }, + "parentStack": { + "Type": "String", + "Default": "" + }, + "env": { + "Type": "String" + }, + "deploymentBucketName": { + "Type": "String" + }, + "s3Key": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Metadata": { + "aws:asset:path": "./src", + "aws:asset:property": "Code" + }, + "Properties": { + "Handler": "index.handler", + "FunctionName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f41a9495fPostConfirmation", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f41a9495fPostConfirmation", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "Environment": { + "Variables": { + "ENV": { + "Ref": "env" + }, + "MODULES": { + "Ref": "modules" + }, + "REGION": { + "Ref": "AWS::Region" + }, + "GROUP": { + "Ref": "GROUP" + } + } + }, + "Role": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 25, + "Code": { + "S3Bucket": { + "Ref": "deploymentBucketName" + }, + "S3Key": { + "Ref": "s3Key" + } + } + } + }, + "LambdaExecutionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f41a9495fPostConfirmation", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f41a9495fPostConfirmation", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + } + } + }, + "lambdaexecutionpolicy": { + "DependsOn": [ + "LambdaExecutionRole" + ], + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "lambda-execution-policy", + "Roles": [ + { + "Ref": "LambdaExecutionRole" + } + ], + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": { + "Fn::Sub": [ + "arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*", + { + "region": { + "Ref": "AWS::Region" + }, + "account": { + "Ref": "AWS::AccountId" + }, + "lambda": { + "Ref": "LambdaFunction" + } + } + ] + } + } + ] + } + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Ref": "LambdaFunction" + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] + } + }, + "LambdaExecutionRole": { + "Value": { + "Ref": "LambdaExecutionRole" + } + }, + "LambdaExecutionRoleArn": { + "Value": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/geo/storeLocatorGeofence/storeLocatorGeofence-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/geo/storeLocatorGeofence/storeLocatorGeofence-cloudformation-template.json new file mode 100644 index 00000000000..17020d54719 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/geo/storeLocatorGeofence/storeLocatorGeofence-cloudformation-template.json @@ -0,0 +1,364 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "collectionName": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomGeofenceCollectionLambdaServiceRole9040D551": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreateGeofenceCollection", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdateGeofenceCollection", + "geo:DeleteGeofenceCollection" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369", + "Roles": [ + { + "Ref": "CustomGeofenceCollectionLambdaServiceRole9040D551" + } + ] + } + }, + "CustomGeofenceCollectionLambdaCA3D002B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst {\n LocationClient,\n CreateGeofenceCollectionCommand,\n DeleteGeofenceCollectionCommand,\n UpdateGeofenceCollectionCommand,\n} = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateGeofenceCollectionCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.CollectionName && res.CollectionArn) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateGeofenceCollectionCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.CollectionName) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteGeofenceCollectionCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.collectionName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomGeofenceCollectionLambdaServiceRole9040D551", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369", + "CustomGeofenceCollectionLambdaServiceRole9040D551" + ] + }, + "CustomGeofenceCollection": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomGeofenceCollectionLambdaCA3D002B", + "Arn" + ] + }, + "collectionName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "storeLocatorAdminGeofenceCollectionPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:GetGeofence", + "geo:PutGeofence", + "geo:BatchPutGeofence", + "geo:BatchDeleteGeofence", + "geo:ListGeofences" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + "storeLocatorAdmin", + { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + } + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-GeofenceCollection\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/geo/storeLocatorMap/storeLocatorMap-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/geo/storeLocatorMap/storeLocatorMap-cloudformation-template.json new file mode 100644 index 00000000000..bf53b69ff23 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/geo/storeLocatorMap/storeLocatorMap-cloudformation-template.json @@ -0,0 +1,347 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "authRoleName": { + "Type": "String" + }, + "unauthRoleName": { + "Type": "String" + }, + "mapName": { + "Type": "String" + }, + "mapStyle": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomMapLambdaServiceRole4EE7732C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreateMap", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdateMap", + "geo:DeleteMap" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:map/${mapName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "mapName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E", + "Roles": [ + { + "Ref": "CustomMapLambdaServiceRole4EE7732C" + } + ] + } + }, + "CustomMapLambda51D5D430": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst { LocationClient, CreateMapCommand, DeleteMapCommand, UpdateMapCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n Configuration: {\n Style: event.ResourceProperties.mapStyle,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateMapCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Update') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateMapCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Delete') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteMapCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.mapName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomMapLambdaServiceRole4EE7732C", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E", + "CustomMapLambdaServiceRole4EE7732C" + ] + }, + "CustomMap": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomMapLambda51D5D430", + "Arn" + ] + }, + "mapName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + }, + "mapStyle": { + "Ref": "mapStyle" + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "MapPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:GetMapStyleDescriptor", + "geo:GetMapGlyphs", + "geo:GetMapSprites", + "geo:GetMapTile" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CustomMap", + "MapArn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Ref": "authRoleName" + }, + { + "Ref": "unauthRoleName" + }, + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomMap", + "MapName" + ] + } + }, + "Style": { + "Value": { + "Ref": "mapStyle" + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "CustomMap", + "MapArn" + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-Map\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/geo/storeLocatorSearch/storeLocatorSearch-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/geo/storeLocatorSearch/storeLocatorSearch-cloudformation-template.json new file mode 100644 index 00000000000..1ef40f17717 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/geo/storeLocatorSearch/storeLocatorSearch-cloudformation-template.json @@ -0,0 +1,348 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "authRoleName": { + "Type": "String" + }, + "unauthRoleName": { + "Type": "String" + }, + "indexName": { + "Type": "String" + }, + "dataProvider": { + "Type": "String" + }, + "dataSourceIntendedUse": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreatePlaceIndex", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdatePlaceIndex", + "geo:DeletePlaceIndex" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:place-index/${indexName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "indexName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1", + "Roles": [ + { + "Ref": "CustomPlaceIndexLambdaServiceRoleFD2F3C9D" + } + ] + } + }, + "CustomPlaceIndexLambda79813BB9": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst { LocationClient, CreatePlaceIndexCommand, DeletePlaceIndexCommand, UpdatePlaceIndexCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSource: event.ResourceProperties.dataSource,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreatePlaceIndexCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdatePlaceIndexCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeletePlaceIndexCommand(params));\n event.PhysicalResourceId = event.ResourceProperties.indexName;\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.indexName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1", + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D" + ] + }, + "CustomPlaceIndex": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomPlaceIndexLambda79813BB9", + "Arn" + ] + }, + "indexName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + }, + "dataSource": { + "Ref": "dataProvider" + }, + "dataSourceIntendedUse": { + "Ref": "dataSourceIntendedUse" + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "PlaceIndexPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:SearchPlaceIndexForPosition", + "geo:SearchPlaceIndexForText", + "geo:SearchPlaceIndexForSuggestions", + "geo:GetPlace" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexArn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Ref": "authRoleName" + }, + { + "Ref": "unauthRoleName" + }, + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexName" + ] + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexArn" + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-PlaceIndex\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/root-cloudformation-stack.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/root-cloudformation-stack.json new file mode 100644 index 00000000000..1b8df321c23 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/awscloudformation/build/root-cloudformation-stack.json @@ -0,0 +1,653 @@ +{ + "Description": "Root Stack for AWS Amplify CLI", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "DeploymentBucketName": { + "Type": "String", + "Default": "DeploymentBucket", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "AuthRoleName": { + "Type": "String", + "Default": "AuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "UnauthRoleName": { + "Type": "String", + "Default": "UnAuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + } + }, + "Outputs": { + "Region": { + "Description": "CloudFormation provider root stack Region", + "Value": { + "Ref": "AWS::Region" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-Region" + } + } + }, + "StackName": { + "Description": "CloudFormation provider root stack ID", + "Value": { + "Ref": "AWS::StackName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackName" + } + } + }, + "StackId": { + "Description": "CloudFormation provider root stack name", + "Value": { + "Ref": "AWS::StackId" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackId" + } + } + }, + "AuthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + "UnauthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + }, + "DeploymentBucketName": { + "Description": "CloudFormation provider root stack deployment bucket name", + "Value": { + "Ref": "DeploymentBucketName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-DeploymentBucketName" + } + } + }, + "AuthRoleName": { + "Value": { + "Ref": "AuthRole" + } + }, + "UnauthRoleName": { + "Value": { + "Ref": "UnauthRole" + } + } + }, + "Resources": { + "DeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Ref": "DeploymentBucketName" + }, + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "DeploymentBucketBlockHTTP": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "DeploymentBucketName" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Effect": "Deny", + "Principal": "*", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "DeploymentBucketName" + }, + "/*" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "DeploymentBucketName" + } + ] + ] + } + ], + "Condition": { + "Bool": { + "aws:SecureTransport": false + } + } + } + ] + } + } + }, + "AuthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "AuthRoleName" + } + } + }, + "UnauthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "UnauthRoleName" + } + } + }, + "AuthTriggerCustomLambdaStack": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/auth-trigger-cloudformation-template.json", + "Parameters": { + "env": "main", + "userpoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "userpoolArn": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolArn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationLambdaExecutionRole": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.LambdaExecutionRoleArn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.Arn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.Name" + ] + } + } + }, + "DependsOn": [ + "authstorelocator41a9495f41a9495f", + "functionstorelocator41a9495f41a9495fPostConfirmation" + ] + }, + "authuserPoolGroups": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/userPoolGroups-cloudformation-template.json", + "Parameters": { + "AuthRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "UnauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authstorelocator41a9495f41a9495fAppClientIDWeb": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.AppClientIDWeb" + ] + }, + "authstorelocator41a9495f41a9495fAppClientID": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.AppClientID" + ] + }, + "authstorelocator41a9495f41a9495fIdentityPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.IdentityPoolId" + ] + }, + "env": "main" + } + } + }, + "authstorelocator41a9495f41a9495f": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/storelocator41a9495f41a9495f-cloudformation-template.json", + "Parameters": { + "identityPoolName": "storelocator41a9495f_identitypool_41a9495f", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "storel41a9495f", + "userPoolName": "storelocator41a9495f_userpool_41a9495f", + "autoVerifiedAttributes": "email", + "mfaConfiguration": "OFF", + "mfaTypes": "SMS Text Message", + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": "", + "requiredAttributes": "email", + "aliasAttributes": "", + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": "100", + "userpoolClientWriteAttributes": "email", + "userpoolClientReadAttributes": "email", + "userpoolClientLambdaRole": "storel41a9495f_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "41a9495f", + "resourceName": "storelocator41a9495f41a9495f", + "authSelections": "identityPoolAndUserPool", + "useDefault": "manual", + "thirdPartyAuth": false, + "usernameAttributes": "email", + "userPoolGroups": true, + "adminQueries": false, + "triggers": "{\"PostConfirmation\":[\"add-to-group\"]}", + "hostedUI": false, + "userPoolGroupList": "storeLocatorAdmin", + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": "[object Object]", + "permissions": "{\"policyName\":\"AddToGroupCognito\",\"trigger\":\"PostConfirmation\",\"effect\":\"Allow\",\"actions\":[\"cognito-idp:AdminAddUserToGroup\",\"cognito-idp:GetGroup\",\"cognito-idp:CreateGroup\"],\"resource\":{\"paramType\":\"!GetAtt\",\"keys\":[\"UserPool\",\"Arn\"]}}", + "authTriggerConnections": "{\"triggerType\":\"PostConfirmation\",\"lambdaFunctionName\":\"storelocator41a9495f41a9495fPostConfirmation\"}", + "env": "main" + } + } + }, + "functionstorelocator41a9495f41a9495fPostConfirmation": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/function/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json", + "Parameters": { + "modules": "add-to-group", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "GROUP": "storeLocatorAdmin", + "deploymentBucketName": "amplify-storelocator-main-f9ca7-deployment", + "s3Key": "amplify-builds/storelocator41a9495f41a9495fPostConfirmation-6a6c746d4739755a384a-build.zip", + "env": "main" + } + } + }, + "geostoreLocatorMap": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorMap-cloudformation-template.json", + "Parameters": { + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "mapName": "storeLocatorMap", + "mapStyle": "VectorEsriStreets", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "geostoreLocatorSearch": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorSearch-cloudformation-template.json", + "Parameters": { + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "indexName": "storeLocatorSearch", + "dataProvider": "Here", + "dataSourceIntendedUse": "SingleUse", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "geostoreLocatorGeofence": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorGeofence-cloudformation-template.json", + "Parameters": { + "collectionName": "storeLocatorGeofence", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "UpdateRolesWithIDPFunction": { + "DependsOn": [ + "AuthRole", + "UnauthRole", + "authstorelocator41a9495f41a9495f" + ], + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": { + "Fn::Join": [ + "\n", + [ + "const response = require('cfn-response');", + "const { IAMClient, GetRoleCommand, UpdateAssumeRolePolicyCommand } = require('@aws-sdk/client-iam');", + "exports.handler = function(event, context) {", + " // Don't return promise, response.send() marks context as done internally", + " const ignoredPromise = handleEvent(event, context)", + "};", + "async function handleEvent(event, context) {", + " try {", + " let authRoleName = event.ResourceProperties.authRoleName;", + " let unauthRoleName = event.ResourceProperties.unauthRoleName;", + " let idpId = event.ResourceProperties.idpId;", + " let authParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'authenticated'}", + " }", + " }]", + " };", + " let unauthParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'unauthenticated'}", + " }", + " }]", + " };", + " if (event.RequestType === 'Delete') {", + " try {", + " delete authParamsJson.Statement[0].Condition;", + " delete unauthParamsJson.Statement[0].Condition;", + " authParamsJson.Statement[0].Effect = 'Deny'", + " unauthParamsJson.Statement[0].Effect = 'Deny'", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let res = await Promise.all([", + " iam.send(new GetRoleCommand({RoleName: authParams.RoleName})),", + " iam.send(new GetRoleCommand({RoleName: unauthParams.RoleName}))", + " ]);", + " res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.SUCCESS, {Error: err});", + " }", + " } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " }", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.FAILED, {Error: err});", + " }", + "};" + ] + ] + } + }, + "Handler": "index.handler", + "Runtime": "nodejs22.x", + "Timeout": 300, + "Role": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunctionRole", + "Arn" + ] + } + } + }, + "UpdateRolesWithIDPFunctionOutputs": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunction", + "Arn" + ] + }, + "region": { + "Ref": "AWS::Region" + }, + "idpId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.IdentityPoolId" + ] + }, + "authRoleName": { + "Ref": "AuthRole" + }, + "unauthRoleName": { + "Ref": "UnauthRole" + } + } + }, + "UpdateRolesWithIDPFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "AuthRole" + }, + "-idp" + ] + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + }, + "Policies": [ + { + "PolicyName": "UpdateRolesWithIDPFunctionPolicy", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/backend-config.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/backend-config.json new file mode 100644 index 00000000000..6b7a962cd2d --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/backend-config.json @@ -0,0 +1,160 @@ +{ + "auth": { + "storelocator41a9495f41a9495f": { + "customAuth": false, + "dependsOn": [ + { + "attributes": [ + "Arn", + "Name" + ], + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "triggerProvider": "Cognito" + } + ], + "frontendAuthConfig": { + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS" + ], + "passwordProtectionSettings": { + "passwordPolicyCharacters": [], + "passwordPolicyMinLength": 8 + }, + "signupAttributes": [ + "EMAIL" + ], + "socialProviders": [], + "usernameAttributes": [ + "EMAIL" + ], + "verificationMechanisms": [ + "EMAIL" + ] + }, + "providerPlugin": "awscloudformation", + "service": "Cognito" + }, + "userPoolGroups": { + "dependsOn": [ + { + "attributes": [ + "UserPoolId", + "AppClientIDWeb", + "AppClientID", + "IdentityPoolId" + ], + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f" + } + ], + "providerPlugin": "awscloudformation", + "service": "Cognito-UserPool-Groups" + } + }, + "function": { + "storelocator41a9495f41a9495fPostConfirmation": { + "build": true, + "providerPlugin": "awscloudformation", + "service": "Lambda" + } + }, + "geo": { + "storeLocatorGeofence": { + "accessType": "CognitoGroups", + "dependsOn": [ + { + "attributes": [ + "UserPoolId" + ], + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f" + }, + { + "attributes": [ + "storeLocatorAdminGroupRole" + ], + "category": "auth", + "resourceName": "userPoolGroups" + } + ], + "isDefault": true, + "providerPlugin": "awscloudformation", + "service": "GeofenceCollection" + }, + "storeLocatorMap": { + "accessType": "AuthorizedAndGuestUsers", + "dependsOn": [ + { + "attributes": [ + "UserPoolId" + ], + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f" + }, + { + "attributes": [ + "storeLocatorAdminGroupRole" + ], + "category": "auth", + "resourceName": "userPoolGroups" + } + ], + "isDefault": true, + "mapStyle": "VectorEsriStreets", + "providerPlugin": "awscloudformation", + "service": "Map" + }, + "storeLocatorSearch": { + "accessType": "AuthorizedAndGuestUsers", + "dataProvider": "HERE", + "dataSourceIntendedUse": "SingleUse", + "dependsOn": [ + { + "attributes": [ + "UserPoolId" + ], + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f" + }, + { + "attributes": [ + "storeLocatorAdminGroupRole" + ], + "category": "auth", + "resourceName": "userPoolGroups" + } + ], + "isDefault": true, + "providerPlugin": "awscloudformation", + "service": "PlaceIndex" + } + }, + "parameters": { + "AMPLIFY_function_storelocator41a9495f41a9495fPostConfirmation_GROUP": { + "usedBy": [ + { + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation" + } + ] + }, + "AMPLIFY_function_storelocator41a9495f41a9495fPostConfirmation_deploymentBucketName": { + "usedBy": [ + { + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation" + } + ] + }, + "AMPLIFY_function_storelocator41a9495f41a9495fPostConfirmation_s3Key": { + "usedBy": [ + { + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation" + } + ] + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/amplify.state b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/amplify.state new file mode 100644 index 00000000000..0c3efe04706 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/amplify.state @@ -0,0 +1,6 @@ +{ + "pluginId": "amplify-nodejs-function-runtime-provider", + "functionRuntime": "nodejs", + "useLegacyBuild": true, + "defaultEditorFile": "src/index.js" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/custom-policies.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/custom-policies.json new file mode 100644 index 00000000000..528c94f2f26 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/custom-policies.json @@ -0,0 +1,6 @@ +[ + { + "Action": [], + "Resource": [] + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/function-parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/function-parameters.json new file mode 100644 index 00000000000..4c07c063c1d --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/function-parameters.json @@ -0,0 +1,16 @@ +{ + "trigger": true, + "modules": [ + "add-to-group" + ], + "parentResource": "storelocator41a9495f41a9495f", + "functionName": "storelocator41a9495f41a9495fPostConfirmation", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "parentStack": "auth", + "triggerEnvs": "[]", + "triggerDir": "/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/provider-utils/awscloudformation/triggers/PostConfirmation", + "triggerTemplate": "PostConfirmation.json.ejs", + "triggerEventPath": "PostConfirmation.event.json", + "roleName": "storelocator41a9495f41a9495fPostConfirmation", + "skipEdit": true +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/parameters.json new file mode 100644 index 00000000000..82c0ad73bb2 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/parameters.json @@ -0,0 +1,4 @@ +{ + "modules": "add-to-group", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/add-to-group.js b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/add-to-group.js new file mode 100644 index 00000000000..b8920ac2104 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/add-to-group.js @@ -0,0 +1,37 @@ +const { + CognitoIdentityProviderClient, + AdminAddUserToGroupCommand, + GetGroupCommand, + CreateGroupCommand, +} = require('@aws-sdk/client-cognito-identity-provider'); + +const cognitoIdentityServiceProvider = new CognitoIdentityProviderClient({}); + +/** + * @type {import('@types/aws-lambda').PostConfirmationTriggerHandler} + */ +exports.handler = async (event) => { + const groupParams = { + GroupName: process.env.GROUP, + UserPoolId: event.userPoolId, + }; + const addUserParams = { + GroupName: process.env.GROUP, + UserPoolId: event.userPoolId, + Username: event.userName, + }; + /** + * Check if the group exists; if it doesn't, create it. + */ + try { + await cognitoIdentityServiceProvider.send(new GetGroupCommand(groupParams)); + } catch (e) { + await cognitoIdentityServiceProvider.send(new CreateGroupCommand(groupParams)); + } + /** + * Then, add the user to the group. + */ + await cognitoIdentityServiceProvider.send(new AdminAddUserToGroupCommand(addUserParams)); + + return event; +}; diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/event.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/event.json new file mode 100644 index 00000000000..5eafe06ea53 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/event.json @@ -0,0 +1,7 @@ +{ + "request": { + "userPoolId": "testID", + "userName": "testUser" + }, + "response": {} +} diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/index.js b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/index.js new file mode 100644 index 00000000000..876a0cedec6 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/index.js @@ -0,0 +1,33 @@ +/** + * @fileoverview + * + * This CloudFormation Trigger creates a handler which awaits the other handlers + * specified in the `MODULES` env var, located at `./${MODULE}`. + */ + +/** + * The names of modules to load are stored as a comma-delimited string in the + * `MODULES` env var. + */ +const moduleNames = process.env.MODULES.split(','); +/** + * The array of imported modules. + */ +const modules = moduleNames.map((name) => require(`./${name}`)); + +/** + * This async handler iterates over the given modules and awaits them. + * + * @see https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html#nodejs-handler-async + * @type {import('@types/aws-lambda').APIGatewayProxyHandler} + * + */ +exports.handler = async (event, context) => { + /** + * Instead of naively iterating over all handlers, run them concurrently with + * `await Promise.all(...)`. This would otherwise just be determined by the + * order of names in the `MODULES` var. + */ + await Promise.all(modules.map((module) => module.handler(event, context))); + return event; +}; diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/package.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/package.json new file mode 100644 index 00000000000..97ed774298a --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/package.json @@ -0,0 +1,13 @@ +{ + "name": "storelocator41a9495f41a9495fPostConfirmation", + "version": "2.0.0", + "description": "Lambda function generated by Amplify", + "main": "index.js", + "license": "Apache-2.0", + "dependencies": { + "axios": "latest" + }, + "devDependencies": { + "@types/aws-lambda": "^8.10.92" + } +} diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/yarn.lock b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/yarn.lock new file mode 100644 index 00000000000..74757081d71 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/src/yarn.lock @@ -0,0 +1,169 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/aws-lambda@^8.10.92": + version "8.10.161" + resolved "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.161.tgz#36d95723ec46d3d555bf0684f83cf4d4369a28ad" + integrity sha512-rUYdp+MQwSFocxIOcSsYSF3YYYC/uUpMbCY/mbO21vGqfrEYvNSoPyKYDj6RhXXpPfS0KstW9RwG3qXh9sL7FQ== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +axios@latest: + version "1.13.6" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.6.tgz#c3f92da917dc209a15dd29936d20d5089b6b6c98" + integrity sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ== + dependencies: + follow-redirects "^1.15.11" + form-data "^4.0.5" + proxy-from-env "^1.1.0" + +call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + +es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + dependencies: + es-errors "^1.3.0" + +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== + dependencies: + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + +follow-redirects@^1.15.11: + version "1.15.11" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.11.tgz#777d73d72a92f8ec4d2e410eb47352a56b8e8340" + integrity sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ== + +form-data@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.5.tgz#b49e48858045ff4cbf6b03e1805cebcad3679053" + integrity sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" + hasown "^2.0.2" + mime-types "^2.1.12" + +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + +get-intrinsic@^1.2.6: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== + dependencies: + call-bind-apply-helpers "^1.0.2" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + function-bind "^1.1.2" + get-proto "^1.0.1" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + +get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" + +gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + +has-symbols@^1.0.3, has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json new file mode 100644 index 00000000000..192bbea9292 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/function/storelocator41a9495f41a9495fPostConfirmation/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json @@ -0,0 +1,235 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"function-Lambda\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "Parameters": { + "GROUP": { + "Type": "String", + "Default": "" + }, + "modules": { + "Type": "String", + "Default": "", + "Description": "Comma-delimited list of modules to be executed by a lambda trigger. Sent to resource as an env variable." + }, + "resourceName": { + "Type": "String", + "Default": "" + }, + "trigger": { + "Type": "String", + "Default": "true" + }, + "functionName": { + "Type": "String", + "Default": "" + }, + "roleName": { + "Type": "String", + "Default": "" + }, + "parentResource": { + "Type": "String", + "Default": "" + }, + "parentStack": { + "Type": "String", + "Default": "" + }, + "env": { + "Type": "String" + }, + "deploymentBucketName": { + "Type": "String" + }, + "s3Key": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Metadata": { + "aws:asset:path": "./src", + "aws:asset:property": "Code" + }, + "Properties": { + "Handler": "index.handler", + "FunctionName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f41a9495fPostConfirmation", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f41a9495fPostConfirmation", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "Environment": { + "Variables": { + "ENV": { + "Ref": "env" + }, + "MODULES": { + "Ref": "modules" + }, + "REGION": { + "Ref": "AWS::Region" + }, + "GROUP": { + "Ref": "GROUP" + } + } + }, + "Role": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 25, + "Code": { + "S3Bucket": { + "Ref": "deploymentBucketName" + }, + "S3Key": { + "Ref": "s3Key" + } + } + } + }, + "LambdaExecutionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f41a9495fPostConfirmation", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f41a9495fPostConfirmation", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + } + } + }, + "lambdaexecutionpolicy": { + "DependsOn": [ + "LambdaExecutionRole" + ], + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "lambda-execution-policy", + "Roles": [ + { + "Ref": "LambdaExecutionRole" + } + ], + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": { + "Fn::Sub": [ + "arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*", + { + "region": { + "Ref": "AWS::Region" + }, + "account": { + "Ref": "AWS::AccountId" + }, + "lambda": { + "Ref": "LambdaFunction" + } + } + ] + } + } + ] + } + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Ref": "LambdaFunction" + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] + } + }, + "LambdaExecutionRole": { + "Value": { + "Ref": "LambdaExecutionRole" + } + }, + "LambdaExecutionRoleArn": { + "Value": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorGeofence/cli-inputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorGeofence/cli-inputs.json new file mode 100644 index 00000000000..3bb50128864 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorGeofence/cli-inputs.json @@ -0,0 +1,10 @@ +{ + "groupPermissions": { + "storeLocatorAdmin": [ + "Read geofence", + "Create/Update geofence", + "Delete geofence", + "List geofences" + ] + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorGeofence/parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorGeofence/parameters.json new file mode 100644 index 00000000000..7ae714ed5ee --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorGeofence/parameters.json @@ -0,0 +1,4 @@ +{ + "collectionName": "storeLocatorGeofence", + "isDefault": true +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorGeofence/storeLocatorGeofence-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorGeofence/storeLocatorGeofence-cloudformation-template.json new file mode 100644 index 00000000000..17020d54719 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorGeofence/storeLocatorGeofence-cloudformation-template.json @@ -0,0 +1,364 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "collectionName": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomGeofenceCollectionLambdaServiceRole9040D551": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreateGeofenceCollection", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdateGeofenceCollection", + "geo:DeleteGeofenceCollection" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369", + "Roles": [ + { + "Ref": "CustomGeofenceCollectionLambdaServiceRole9040D551" + } + ] + } + }, + "CustomGeofenceCollectionLambdaCA3D002B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst {\n LocationClient,\n CreateGeofenceCollectionCommand,\n DeleteGeofenceCollectionCommand,\n UpdateGeofenceCollectionCommand,\n} = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateGeofenceCollectionCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.CollectionName && res.CollectionArn) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateGeofenceCollectionCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.CollectionName) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteGeofenceCollectionCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.collectionName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomGeofenceCollectionLambdaServiceRole9040D551", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369", + "CustomGeofenceCollectionLambdaServiceRole9040D551" + ] + }, + "CustomGeofenceCollection": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomGeofenceCollectionLambdaCA3D002B", + "Arn" + ] + }, + "collectionName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "storeLocatorAdminGeofenceCollectionPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:GetGeofence", + "geo:PutGeofence", + "geo:BatchPutGeofence", + "geo:BatchDeleteGeofence", + "geo:ListGeofences" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + "storeLocatorAdmin", + { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + } + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-GeofenceCollection\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorMap/cli-inputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorMap/cli-inputs.json new file mode 100644 index 00000000000..89c77968423 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorMap/cli-inputs.json @@ -0,0 +1,5 @@ +{ + "groupPermissions": [ + "storeLocatorAdmin" + ] +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorMap/parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorMap/parameters.json new file mode 100644 index 00000000000..00f849451a2 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorMap/parameters.json @@ -0,0 +1,11 @@ +{ + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "mapName": "storeLocatorMap", + "mapStyle": "VectorEsriStreets", + "isDefault": true +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorMap/storeLocatorMap-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorMap/storeLocatorMap-cloudformation-template.json new file mode 100644 index 00000000000..bf53b69ff23 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorMap/storeLocatorMap-cloudformation-template.json @@ -0,0 +1,347 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "authRoleName": { + "Type": "String" + }, + "unauthRoleName": { + "Type": "String" + }, + "mapName": { + "Type": "String" + }, + "mapStyle": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomMapLambdaServiceRole4EE7732C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreateMap", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdateMap", + "geo:DeleteMap" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:map/${mapName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "mapName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E", + "Roles": [ + { + "Ref": "CustomMapLambdaServiceRole4EE7732C" + } + ] + } + }, + "CustomMapLambda51D5D430": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst { LocationClient, CreateMapCommand, DeleteMapCommand, UpdateMapCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n Configuration: {\n Style: event.ResourceProperties.mapStyle,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateMapCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Update') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateMapCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Delete') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteMapCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.mapName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomMapLambdaServiceRole4EE7732C", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E", + "CustomMapLambdaServiceRole4EE7732C" + ] + }, + "CustomMap": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomMapLambda51D5D430", + "Arn" + ] + }, + "mapName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + }, + "mapStyle": { + "Ref": "mapStyle" + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "MapPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:GetMapStyleDescriptor", + "geo:GetMapGlyphs", + "geo:GetMapSprites", + "geo:GetMapTile" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CustomMap", + "MapArn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Ref": "authRoleName" + }, + { + "Ref": "unauthRoleName" + }, + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomMap", + "MapName" + ] + } + }, + "Style": { + "Value": { + "Ref": "mapStyle" + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "CustomMap", + "MapArn" + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-Map\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorSearch/cli-inputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorSearch/cli-inputs.json new file mode 100644 index 00000000000..89c77968423 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorSearch/cli-inputs.json @@ -0,0 +1,5 @@ +{ + "groupPermissions": [ + "storeLocatorAdmin" + ] +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorSearch/parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorSearch/parameters.json new file mode 100644 index 00000000000..a1ac3acce3c --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorSearch/parameters.json @@ -0,0 +1,12 @@ +{ + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "indexName": "storeLocatorSearch", + "dataProvider": "Here", + "dataSourceIntendedUse": "SingleUse", + "isDefault": true +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorSearch/storeLocatorSearch-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorSearch/storeLocatorSearch-cloudformation-template.json new file mode 100644 index 00000000000..1ef40f17717 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/geo/storeLocatorSearch/storeLocatorSearch-cloudformation-template.json @@ -0,0 +1,348 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "authRoleName": { + "Type": "String" + }, + "unauthRoleName": { + "Type": "String" + }, + "indexName": { + "Type": "String" + }, + "dataProvider": { + "Type": "String" + }, + "dataSourceIntendedUse": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreatePlaceIndex", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdatePlaceIndex", + "geo:DeletePlaceIndex" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:place-index/${indexName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "indexName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1", + "Roles": [ + { + "Ref": "CustomPlaceIndexLambdaServiceRoleFD2F3C9D" + } + ] + } + }, + "CustomPlaceIndexLambda79813BB9": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst { LocationClient, CreatePlaceIndexCommand, DeletePlaceIndexCommand, UpdatePlaceIndexCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSource: event.ResourceProperties.dataSource,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreatePlaceIndexCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdatePlaceIndexCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeletePlaceIndexCommand(params));\n event.PhysicalResourceId = event.ResourceProperties.indexName;\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.indexName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1", + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D" + ] + }, + "CustomPlaceIndex": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomPlaceIndexLambda79813BB9", + "Arn" + ] + }, + "indexName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + }, + "dataSource": { + "Ref": "dataProvider" + }, + "dataSourceIntendedUse": { + "Ref": "dataSourceIntendedUse" + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "PlaceIndexPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:SearchPlaceIndexForPosition", + "geo:SearchPlaceIndexForText", + "geo:SearchPlaceIndexForSuggestions", + "geo:GetPlace" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexArn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Ref": "authRoleName" + }, + { + "Ref": "unauthRoleName" + }, + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexName" + ] + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexArn" + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-PlaceIndex\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/tags.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/tags.json new file mode 100644 index 00000000000..b9321d71b83 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/#current-cloud-backend/tags.json @@ -0,0 +1,10 @@ +[ + { + "Key": "user:Stack", + "Value": "{project-env}" + }, + { + "Key": "user:Application", + "Value": "{project-name}" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/.config/project-config.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/.config/project-config.json new file mode 100644 index 00000000000..60030e74166 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/.config/project-config.json @@ -0,0 +1,18 @@ +{ + "whyContinueWithGen1": "Prefer not to answer", + "projectName": "storeLocator", + "version": "3.1", + "frontend": "javascript", + "javascript": { + "framework": "react", + "config": { + "SourceDir": "src", + "DistributionDir": "dist", + "BuildCommand": "npm run-script build", + "StartCommand": "npm run-script start" + } + }, + "providers": [ + "awscloudformation" + ] +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/README.md b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/README.md new file mode 100644 index 00000000000..46165a9c8c6 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/README.md @@ -0,0 +1,8 @@ +# Getting Started with Amplify CLI +This directory was generated by [Amplify CLI](https://docs.amplify.aws/cli). + +Helpful resources: +- Amplify documentation: https://docs.amplify.aws. +- Amplify CLI documentation: https://docs.amplify.aws/cli. +- More details on this folder & generated files: https://docs.amplify.aws/cli/reference/files. +- Join Amplify's community: https://amplify.aws/community/. diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/amplify-meta.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/amplify-meta.json new file mode 100644 index 00000000000..c2f93edd8b2 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/amplify-meta.json @@ -0,0 +1,227 @@ +{ + "providers": { + "awscloudformation": { + "AuthRoleName": "amplify-storelocator-main-f9ca7-authRole", + "UnauthRoleArn": "arn:aws:iam::123456789012:role/amplify-storelocator-main-f9ca7-unauthRole", + "AuthRoleArn": "arn:aws:iam::123456789012:role/amplify-storelocator-main-f9ca7-authRole", + "Region": "us-east-1", + "DeploymentBucketName": "amplify-storelocator-main-f9ca7-deployment", + "UnauthRoleName": "amplify-storelocator-main-f9ca7-unauthRole", + "StackName": "amplify-storelocator-main-f9ca7", + "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/amplify-storelocator-main-f9ca7/06c2ecf0-279e-11f1-a161-0ea0286337e9", + "AmplifyAppId": "storelocator", + "AuthTriggerTemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/auth-trigger-cloudformation-template.json" + } + }, + "auth": { + "userPoolGroups": { + "service": "Cognito-UserPool-Groups", + "providerPlugin": "awscloudformation", + "dependsOn": [ + { + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f", + "attributes": [ + "UserPoolId", + "AppClientIDWeb", + "AppClientID", + "IdentityPoolId" + ] + } + ], + "lastPushTimeStamp": "2026-03-24T16:38:00.639Z", + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/userPoolGroups-cloudformation-template.json", + "logicalId": "authuserPoolGroups" + }, + "output": { + "storeLocatorAdminGroupRole": "arn:aws:iam::123456789012:role/us-east-1_R1pdziFVe-storeLocatorAdminGroupRole" + }, + "lastPushDirHash": "aY2fv0JwB9V2Pnq+Iavglw2oGVE=" + }, + "storelocator41a9495f41a9495f": { + "service": "Cognito", + "providerPlugin": "awscloudformation", + "dependsOn": [ + { + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "triggerProvider": "Cognito", + "attributes": [ + "Arn", + "Name" + ] + } + ], + "customAuth": false, + "frontendAuthConfig": { + "socialProviders": [], + "usernameAttributes": [ + "EMAIL" + ], + "signupAttributes": [ + "EMAIL" + ], + "passwordProtectionSettings": { + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [] + }, + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS" + ], + "verificationMechanisms": [ + "EMAIL" + ] + }, + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/storelocator41a9495f41a9495f-cloudformation-template.json", + "logicalId": "authstorelocator41a9495f41a9495f" + }, + "lastPushTimeStamp": "2026-03-24T16:38:00.639Z", + "output": { + "UserPoolId": "us-east-1_R1pdziFVe", + "AppClientIDWeb": "6am6ldh23n8ke819nuvk51cddq", + "AppClientID": "5ppvpdo9dmkrj55qi8h865lt34", + "IdentityPoolId": "us-east-1:4ea514e6-bc16-4990-a5ea-cefe84c3050d", + "UserPoolArn": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_R1pdziFVe", + "IdentityPoolName": "storelocator41a9495f_identitypool_41a9495f__main", + "UserPoolName": "storelocator41a9495f_userpool_41a9495f" + }, + "lastPushDirHash": "BhovtRkLGtk84r9ocO7d+lsB8TQ=" + } + }, + "function": { + "storelocator41a9495f41a9495fPostConfirmation": { + "build": true, + "providerPlugin": "awscloudformation", + "service": "Lambda", + "lastBuildTimeStamp": "2026-03-24T16:33:11.355Z", + "lastBuildType": "PROD", + "lastPackageTimeStamp": "2026-03-24T16:33:12.063Z", + "distZipFilename": "storelocator41a9495f41a9495fPostConfirmation-6a6c746d4739755a384a-build.zip", + "s3Bucket": { + "deploymentBucketName": "amplify-storelocator-main-f9ca7-deployment", + "s3Key": "amplify-builds/storelocator41a9495f41a9495fPostConfirmation-6a6c746d4739755a384a-build.zip" + }, + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/function/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json", + "logicalId": "functionstorelocator41a9495f41a9495fPostConfirmation" + }, + "lastPushTimeStamp": "2026-03-24T16:38:00.639Z", + "output": { + "LambdaExecutionRoleArn": "arn:aws:iam::123456789012:role/storelocator41a9495f41a9495fPostConfirmation-main", + "Region": "us-east-1", + "Arn": "arn:aws:lambda:us-east-1:123456789012:function:storelocator41a9495f41a9495fPostConfirmation-main", + "Name": "storelocator41a9495f41a9495fPostConfirmation-main", + "LambdaExecutionRole": "storelocator41a9495f41a9495fPostConfirmation-main" + }, + "lastPushDirHash": "6EQkwiPaTbkyYCg4JDkMQiOWz8g=" + } + }, + "geo": { + "storeLocatorMap": { + "isDefault": true, + "providerPlugin": "awscloudformation", + "service": "Map", + "mapStyle": "VectorEsriStreets", + "accessType": "AuthorizedAndGuestUsers", + "dependsOn": [ + { + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f", + "attributes": [ + "UserPoolId" + ] + }, + { + "category": "auth", + "resourceName": "userPoolGroups", + "attributes": [ + "storeLocatorAdminGroupRole" + ] + } + ], + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorMap-cloudformation-template.json", + "logicalId": "geostoreLocatorMap" + }, + "lastPushTimeStamp": "2026-03-24T16:38:00.639Z", + "output": { + "Style": "VectorEsriStreets", + "Region": "us-east-1", + "Arn": "arn:aws:geo:us-east-1:123456789012:map/storeLocatorMap-main", + "Name": "storeLocatorMap-main" + }, + "lastPushDirHash": "f6hS2nqVgBHpibNEdmumaRgBCRM=" + }, + "storeLocatorSearch": { + "isDefault": true, + "providerPlugin": "awscloudformation", + "service": "PlaceIndex", + "dataProvider": "HERE", + "dataSourceIntendedUse": "SingleUse", + "accessType": "AuthorizedAndGuestUsers", + "dependsOn": [ + { + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f", + "attributes": [ + "UserPoolId" + ] + }, + { + "category": "auth", + "resourceName": "userPoolGroups", + "attributes": [ + "storeLocatorAdminGroupRole" + ] + } + ], + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorSearch-cloudformation-template.json", + "logicalId": "geostoreLocatorSearch" + }, + "lastPushTimeStamp": "2026-03-24T16:38:00.639Z", + "output": { + "Region": "us-east-1", + "Arn": "arn:aws:geo:us-east-1:123456789012:place-index/storeLocatorSearch-main", + "Name": "storeLocatorSearch-main" + }, + "lastPushDirHash": "DcWb0RNLHGk1nlEWvQI8kcmIhuw=" + }, + "storeLocatorGeofence": { + "isDefault": true, + "providerPlugin": "awscloudformation", + "service": "GeofenceCollection", + "accessType": "CognitoGroups", + "dependsOn": [ + { + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f", + "attributes": [ + "UserPoolId" + ] + }, + { + "category": "auth", + "resourceName": "userPoolGroups", + "attributes": [ + "storeLocatorAdminGroupRole" + ] + } + ], + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorGeofence-cloudformation-template.json", + "logicalId": "geostoreLocatorGeofence" + }, + "lastPushTimeStamp": "2026-03-24T16:38:00.639Z", + "output": { + "Region": "us-east-1", + "Arn": "arn:aws:geo:us-east-1:123456789012:geofence-collection/storeLocatorGeofence-main", + "Name": "storeLocatorGeofence-main" + }, + "lastPushDirHash": "qBxz5+dofKzvXa0AVAS5tnATCqA=" + } + } +} diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/storelocator41a9495f41a9495f/build/auth-trigger-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/storelocator41a9495f41a9495f/build/auth-trigger-cloudformation-template.json new file mode 100644 index 00000000000..e6186c748d1 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/storelocator41a9495f41a9495f/build/auth-trigger-cloudformation-template.json @@ -0,0 +1,204 @@ +{ + "Description": "Custom Resource stack for Auth Trigger created using Amplify CLI", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "userpoolId": { + "Type": "String" + }, + "userpoolArn": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationLambdaExecutionRole": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "UserPoolPostConfirmationLambdaInvokePermission": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "functionstorelocator41a9495f41a9495fPostConfirmationName" + }, + "Principal": "cognito-idp.amazonaws.com", + "SourceArn": { + "Ref": "userpoolArn" + } + } + }, + "Amplifyfunctionstorelocator41a9495f41a9495fPostConfirmationNamePostConfirmationAddToGroupCognitoC0815C8F": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "cognito-idp:AdminAddUserToGroup", + "cognito-idp:GetGroup", + "cognito-idp:CreateGroup" + ], + "Effect": "Allow", + "Resource": { + "Ref": "userpoolArn" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AddToGroupCognito", + "Roles": [ + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "functionstorelocator41a9495f41a9495fPostConfirmationLambdaExecutionRole" + } + ] + } + ] + } + ] + } + ] + } + ] + } + }, + "authTriggerFnServiceRole08093B67": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "authTriggerFnServiceRoleDefaultPolicyEC9285A8": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "cognito-idp:DescribeUserPool", + "cognito-idp:UpdateUserPool" + ], + "Effect": "Allow", + "Resource": { + "Ref": "userpoolArn" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "authTriggerFnServiceRoleDefaultPolicyEC9285A8", + "Roles": [ + { + "Ref": "authTriggerFnServiceRole08093B67" + } + ] + } + }, + "authTriggerFn7FCFA449": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst {\n CognitoIdentityProviderClient,\n DescribeUserPoolCommand,\n UpdateUserPoolCommand,\n} = require('@aws-sdk/client-cognito-identity-provider');\n\nexports.handler = (event, context) => {\n // Don't return promise, response.send() marks context as done internally\n void tryHandleEvent(event, context);\n};\n\nasync function tryHandleEvent(event, context) {\n const physicalResourceId =\n event.RequestType === 'Update' ? event.PhysicalResourceId : `${event.LogicalResourceId}-${event.ResourceProperties.userpoolId}`;\n try {\n await handleEvent(event);\n response.send(event, context, response.SUCCESS, {}, physicalResourceId);\n } catch (err) {\n console.log(err.stack);\n response.send(event, context, response.FAILED, { err }, physicalResourceId);\n }\n}\n\nasync function handleEvent(event) {\n const userPoolId = event.ResourceProperties.userpoolId;\n const { lambdaConfig } = event.ResourceProperties;\n const config = {};\n const cognitoClient = new CognitoIdentityProviderClient({});\n const userPoolConfig = await cognitoClient.send(new DescribeUserPoolCommand({ UserPoolId: userPoolId }));\n const userPoolParams = userPoolConfig.UserPool;\n // update userPool params\n\n const updateUserPoolConfig = {\n UserPoolId: userPoolParams.Id,\n Policies: userPoolParams.Policies,\n SmsVerificationMessage: userPoolParams.SmsVerificationMessage,\n AccountRecoverySetting: userPoolParams.AccountRecoverySetting,\n AdminCreateUserConfig: userPoolParams.AdminCreateUserConfig,\n AutoVerifiedAttributes: userPoolParams.AutoVerifiedAttributes,\n EmailConfiguration: userPoolParams.EmailConfiguration,\n EmailVerificationMessage: userPoolParams.EmailVerificationMessage,\n EmailVerificationSubject: userPoolParams.EmailVerificationSubject,\n VerificationMessageTemplate: userPoolParams.VerificationMessageTemplate,\n SmsAuthenticationMessage: userPoolParams.SmsAuthenticationMessage,\n MfaConfiguration: userPoolParams.MfaConfiguration,\n DeviceConfiguration: userPoolParams.DeviceConfiguration,\n SmsConfiguration: userPoolParams.SmsConfiguration,\n UserPoolTags: userPoolParams.UserPoolTags,\n UserPoolAddOns: userPoolParams.UserPoolAddOns,\n };\n\n // removing undefined keys\n Object.keys(updateUserPoolConfig).forEach((key) => updateUserPoolConfig[key] === undefined && delete updateUserPoolConfig[key]);\n\n /* removing UnusedAccountValidityDays as deprecated\n InvalidParameterException: Please use TemporaryPasswordValidityDays in PasswordPolicy instead of UnusedAccountValidityDays\n */\n if (updateUserPoolConfig.AdminCreateUserConfig && updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays) {\n delete updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays;\n }\n lambdaConfig.forEach((lambda) => (config[`${lambda.triggerType}`] = lambda.lambdaFunctionArn));\n if (event.RequestType === 'Delete') {\n updateUserPoolConfig.LambdaConfig = {};\n console.log(`${event.RequestType}:`, JSON.stringify(updateUserPoolConfig));\n const result = await cognitoClient.send(new UpdateUserPoolCommand(updateUserPoolConfig));\n console.log(`delete response data ${JSON.stringify(result)}`);\n } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {\n updateUserPoolConfig.LambdaConfig = config;\n const result = await cognitoClient.send(new UpdateUserPoolCommand(updateUserPoolConfig));\n console.log(`createOrUpdate response data ${JSON.stringify(result)}`);\n }\n}\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "authTriggerFnServiceRole08093B67", + "Arn" + ] + }, + "Runtime": "nodejs22.x" + }, + "DependsOn": [ + "authTriggerFnServiceRoleDefaultPolicyEC9285A8", + "authTriggerFnServiceRole08093B67" + ] + }, + "CustomAuthTriggerResource": { + "Type": "Custom::CustomAuthTriggerResourceOutputs", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "authTriggerFn7FCFA449", + "Arn" + ] + }, + "userpoolId": { + "Ref": "userpoolId" + }, + "lambdaConfig": [ + { + "triggerType": "PostConfirmation", + "lambdaFunctionName": "storelocator41a9495f41a9495fPostConfirmation", + "lambdaFunctionArn": { + "Ref": "functionstorelocator41a9495f41a9495fPostConfirmationArn" + } + } + ], + "nonce": "a956ed2b-ea63-4747-acee-0f4cb27b3925" + }, + "DependsOn": [ + "authTriggerFn7FCFA449", + "authTriggerFnServiceRoleDefaultPolicyEC9285A8", + "authTriggerFnServiceRole08093B67" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/storelocator41a9495f41a9495f/build/parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/storelocator41a9495f41a9495f/build/parameters.json new file mode 100644 index 00000000000..cba9966059e --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/storelocator41a9495f41a9495f/build/parameters.json @@ -0,0 +1,82 @@ +{ + "identityPoolName": "storelocator41a9495f_identitypool_41a9495f", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "storel41a9495f", + "userPoolName": "storelocator41a9495f_userpool_41a9495f", + "autoVerifiedAttributes": [ + "email" + ], + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS Text Message" + ], + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [], + "requiredAttributes": [ + "email" + ], + "aliasAttributes": [], + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": "100", + "userpoolClientWriteAttributes": [ + "email" + ], + "userpoolClientReadAttributes": [ + "email" + ], + "userpoolClientLambdaRole": "storel41a9495f_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "41a9495f", + "resourceName": "storelocator41a9495f41a9495f", + "authSelections": "identityPoolAndUserPool", + "useDefault": "manual", + "thirdPartyAuth": false, + "usernameAttributes": [ + "email" + ], + "userPoolGroups": true, + "adminQueries": false, + "triggers": "{\"PostConfirmation\":[\"add-to-group\"]}", + "hostedUI": false, + "userPoolGroupList": [ + "storeLocatorAdmin" + ], + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": [ + { + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "triggerProvider": "Cognito", + "attributes": [ + "Arn", + "Name" + ] + } + ], + "permissions": [ + "{\"policyName\":\"AddToGroupCognito\",\"trigger\":\"PostConfirmation\",\"effect\":\"Allow\",\"actions\":[\"cognito-idp:AdminAddUserToGroup\",\"cognito-idp:GetGroup\",\"cognito-idp:CreateGroup\"],\"resource\":{\"paramType\":\"!GetAtt\",\"keys\":[\"UserPool\",\"Arn\"]}}" + ], + "authTriggerConnections": [ + "{\"triggerType\":\"PostConfirmation\",\"lambdaFunctionName\":\"storelocator41a9495f41a9495fPostConfirmation\"}" + ] +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/storelocator41a9495f41a9495f/build/storelocator41a9495f41a9495f-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/storelocator41a9495f41a9495f/build/storelocator41a9495f41a9495f-cloudformation-template.json new file mode 100644 index 00000000000..32f0ad747e9 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/storelocator41a9495f41a9495f/build/storelocator41a9495f41a9495f-cloudformation-template.json @@ -0,0 +1,486 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"auth-Cognito\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Type": "String", + "Default": "functionstorelocator41a9495f41a9495fPostConfirmationArn" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Type": "String", + "Default": "functionstorelocator41a9495f41a9495fPostConfirmationName" + }, + "identityPoolName": { + "Type": "String" + }, + "allowUnauthenticatedIdentities": { + "Type": "String" + }, + "resourceNameTruncated": { + "Type": "String" + }, + "userPoolName": { + "Type": "String" + }, + "autoVerifiedAttributes": { + "Type": "CommaDelimitedList" + }, + "mfaConfiguration": { + "Type": "String" + }, + "mfaTypes": { + "Type": "CommaDelimitedList" + }, + "smsAuthenticationMessage": { + "Type": "String" + }, + "smsVerificationMessage": { + "Type": "String" + }, + "emailVerificationSubject": { + "Type": "String" + }, + "emailVerificationMessage": { + "Type": "String" + }, + "defaultPasswordPolicy": { + "Type": "String" + }, + "passwordPolicyMinLength": { + "Type": "String" + }, + "passwordPolicyCharacters": { + "Type": "CommaDelimitedList" + }, + "requiredAttributes": { + "Type": "CommaDelimitedList" + }, + "aliasAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientGenerateSecret": { + "Type": "String" + }, + "userpoolClientRefreshTokenValidity": { + "Type": "String" + }, + "userpoolClientWriteAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientReadAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientLambdaRole": { + "Type": "String" + }, + "userpoolClientSetAttributes": { + "Type": "String" + }, + "sharedId": { + "Type": "String" + }, + "resourceName": { + "Type": "String" + }, + "authSelections": { + "Type": "String" + }, + "useDefault": { + "Type": "String" + }, + "thirdPartyAuth": { + "Type": "String" + }, + "usernameAttributes": { + "Type": "CommaDelimitedList" + }, + "userPoolGroups": { + "Type": "String" + }, + "adminQueries": { + "Type": "String" + }, + "triggers": { + "Type": "String" + }, + "hostedUI": { + "Type": "String" + }, + "userPoolGroupList": { + "Type": "CommaDelimitedList" + }, + "serviceName": { + "Type": "String" + }, + "usernameCaseSensitive": { + "Type": "String" + }, + "useEnabledMfas": { + "Type": "String" + }, + "authRoleArn": { + "Type": "String" + }, + "unauthRoleArn": { + "Type": "String" + }, + "breakCircularDependency": { + "Type": "String" + }, + "dependsOn": { + "Type": "CommaDelimitedList" + }, + "permissions": { + "Type": "CommaDelimitedList" + }, + "authTriggerConnections": { + "Type": "CommaDelimitedList" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "UserPool": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AutoVerifiedAttributes": [ + "email" + ], + "EmailVerificationMessage": { + "Ref": "emailVerificationMessage" + }, + "EmailVerificationSubject": { + "Ref": "emailVerificationSubject" + }, + "MfaConfiguration": { + "Ref": "mfaConfiguration" + }, + "Policies": { + "PasswordPolicy": { + "MinimumLength": { + "Ref": "passwordPolicyMinLength" + }, + "RequireLowercase": false, + "RequireNumbers": false, + "RequireSymbols": false, + "RequireUppercase": false + } + }, + "Schema": [ + { + "Mutable": true, + "Name": "email", + "Required": true + } + ], + "UserAttributeUpdateSettings": { + "AttributesRequireVerificationBeforeUpdate": [ + "email" + ] + }, + "UserPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userPoolName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "userPoolName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "UsernameAttributes": { + "Ref": "usernameAttributes" + }, + "UsernameConfiguration": { + "CaseSensitive": false + } + } + }, + "UserPoolClientWeb": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "storel41a9495f_app_clientWeb", + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClient": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "storel41a9495f_app_client", + "GenerateSecret": { + "Ref": "userpoolClientGenerateSecret" + }, + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClientRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + }, + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userpoolClientLambdaRole" + }, + { + "Fn::Join": [ + "", + [ + "upClientLambdaRole41a9495f", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPool": { + "Type": "AWS::Cognito::IdentityPool", + "Properties": { + "AllowUnauthenticatedIdentities": { + "Ref": "allowUnauthenticatedIdentities" + }, + "CognitoIdentityProviders": [ + { + "ClientId": { + "Ref": "UserPoolClient" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + }, + { + "ClientId": { + "Ref": "UserPoolClientWeb" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + } + ], + "IdentityPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f_identitypool_41a9495f", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f_identitypool_41a9495f__", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPoolRoleMap": { + "Type": "AWS::Cognito::IdentityPoolRoleAttachment", + "Properties": { + "IdentityPoolId": { + "Ref": "IdentityPool" + }, + "RoleMappings": { + "UserPoolClientRoleMapping": { + "AmbiguousRoleResolution": "AuthenticatedRole", + "IdentityProvider": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${userPool}:${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "userPool": { + "Ref": "UserPool" + }, + "client": { + "Ref": "UserPoolClient" + } + } + ] + }, + "Type": "Token" + }, + "UserPoolWebClientRoleMapping": { + "AmbiguousRoleResolution": "AuthenticatedRole", + "IdentityProvider": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${userPool}:${webClient}", + { + "region": { + "Ref": "AWS::Region" + }, + "userPool": { + "Ref": "UserPool" + }, + "webClient": { + "Ref": "UserPoolClientWeb" + } + } + ] + }, + "Type": "Token" + } + }, + "Roles": { + "unauthenticated": { + "Ref": "unauthRoleArn" + }, + "authenticated": { + "Ref": "authRoleArn" + } + } + }, + "DependsOn": [ + "IdentityPool", + "UserPoolClient", + "UserPoolClientWeb" + ] + } + }, + "Outputs": { + "IdentityPoolId": { + "Description": "Id for the identity pool", + "Value": { + "Ref": "IdentityPool" + } + }, + "IdentityPoolName": { + "Value": { + "Fn::GetAtt": [ + "IdentityPool", + "Name" + ] + } + }, + "UserPoolId": { + "Description": "Id for the user pool", + "Value": { + "Ref": "UserPool" + } + }, + "UserPoolArn": { + "Description": "Arn for the user pool", + "Value": { + "Fn::GetAtt": [ + "UserPool", + "Arn" + ] + } + }, + "UserPoolName": { + "Value": { + "Ref": "userPoolName" + } + }, + "AppClientIDWeb": { + "Description": "The user pool app client id for web", + "Value": { + "Ref": "UserPoolClientWeb" + } + }, + "AppClientID": { + "Description": "The user pool app client id", + "Value": { + "Ref": "UserPoolClient" + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/storelocator41a9495f41a9495f/cli-inputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/storelocator41a9495f41a9495f/cli-inputs.json new file mode 100644 index 00000000000..c66baffc70c --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/storelocator41a9495f41a9495f/cli-inputs.json @@ -0,0 +1,89 @@ +{ + "version": "1", + "cognitoConfig": { + "identityPoolName": "storelocator41a9495f_identitypool_41a9495f", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "storel41a9495f", + "userPoolName": "storelocator41a9495f_userpool_41a9495f", + "autoVerifiedAttributes": [ + "email" + ], + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS Text Message" + ], + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [], + "requiredAttributes": [ + "email" + ], + "aliasAttributes": [], + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": "100", + "userpoolClientWriteAttributes": [ + "email" + ], + "userpoolClientReadAttributes": [ + "email" + ], + "userpoolClientLambdaRole": "storel41a9495f_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "41a9495f", + "resourceName": "storelocator41a9495f41a9495f", + "authSelections": "identityPoolAndUserPool", + "useDefault": "manual", + "thirdPartyAuth": false, + "usernameAttributes": [ + "email" + ], + "userPoolGroups": true, + "adminQueries": false, + "triggers": { + "PostConfirmation": [ + "add-to-group" + ] + }, + "hostedUI": false, + "userPoolGroupList": [ + "storeLocatorAdmin" + ], + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": [ + { + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "triggerProvider": "Cognito", + "attributes": [ + "Arn", + "Name" + ] + } + ], + "permissions": [ + "{\"policyName\":\"AddToGroupCognito\",\"trigger\":\"PostConfirmation\",\"effect\":\"Allow\",\"actions\":[\"cognito-idp:AdminAddUserToGroup\",\"cognito-idp:GetGroup\",\"cognito-idp:CreateGroup\"],\"resource\":{\"paramType\":\"!GetAtt\",\"keys\":[\"UserPool\",\"Arn\"]}}" + ], + "authTriggerConnections": [ + "{\"triggerType\":\"PostConfirmation\",\"lambdaFunctionName\":\"storelocator41a9495f41a9495fPostConfirmation\"}" + ] + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/userPoolGroups/build/parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/userPoolGroups/build/parameters.json new file mode 100644 index 00000000000..48115bd5cd6 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/userPoolGroups/build/parameters.json @@ -0,0 +1,14 @@ +{ + "AuthRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "UnauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/userPoolGroups/build/userPoolGroups-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/userPoolGroups/build/userPoolGroups-cloudformation-template.json new file mode 100644 index 00000000000..5edc3def07d --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/userPoolGroups/build/userPoolGroups-cloudformation-template.json @@ -0,0 +1,109 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"auth-Cognito-UserPool-Groups\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "AuthRoleArn": { + "Type": "String" + }, + "UnauthRoleArn": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "authstorelocator41a9495f41a9495fIdentityPoolId": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fIdentityPoolId" + }, + "authstorelocator41a9495f41a9495fAppClientID": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fAppClientID" + }, + "authstorelocator41a9495f41a9495fAppClientIDWeb": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fAppClientIDWeb" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "storeLocatorAdminGroup": { + "Type": "AWS::Cognito::UserPoolGroup", + "Properties": { + "Description": "override success", + "GroupName": "storeLocatorAdmin", + "Precedence": 1, + "RoleArn": { + "Fn::GetAtt": [ + "storeLocatorAdminGroupRole", + "Arn" + ] + }, + "UserPoolId": { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + } + } + }, + "storeLocatorAdminGroupRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Allow", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity", + "Condition": { + "StringEquals": { + "cognito-identity.amazonaws.com:aud": { + "Ref": "authstorelocator41a9495f41a9495fIdentityPoolId" + } + }, + "ForAnyValue:StringLike": { + "cognito-identity.amazonaws.com:amr": "authenticated" + } + } + } + ] + }, + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "-storeLocatorAdminGroupRole" + ] + ] + } + } + } + }, + "Outputs": { + "storeLocatorAdminGroupRole": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorAdminGroupRole", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/userPoolGroups/user-pool-group-precedence.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/userPoolGroups/user-pool-group-precedence.json new file mode 100644 index 00000000000..bcc9738de65 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/auth/userPoolGroups/user-pool-group-precedence.json @@ -0,0 +1,6 @@ +[ + { + "groupName": "storeLocatorAdmin", + "precedence": 1 + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/auth/storelocator41a9495f41a9495f/build/storelocator41a9495f41a9495f-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/auth/storelocator41a9495f41a9495f/build/storelocator41a9495f41a9495f-cloudformation-template.json new file mode 100644 index 00000000000..32f0ad747e9 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/auth/storelocator41a9495f41a9495f/build/storelocator41a9495f41a9495f-cloudformation-template.json @@ -0,0 +1,486 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"auth-Cognito\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Type": "String", + "Default": "functionstorelocator41a9495f41a9495fPostConfirmationArn" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Type": "String", + "Default": "functionstorelocator41a9495f41a9495fPostConfirmationName" + }, + "identityPoolName": { + "Type": "String" + }, + "allowUnauthenticatedIdentities": { + "Type": "String" + }, + "resourceNameTruncated": { + "Type": "String" + }, + "userPoolName": { + "Type": "String" + }, + "autoVerifiedAttributes": { + "Type": "CommaDelimitedList" + }, + "mfaConfiguration": { + "Type": "String" + }, + "mfaTypes": { + "Type": "CommaDelimitedList" + }, + "smsAuthenticationMessage": { + "Type": "String" + }, + "smsVerificationMessage": { + "Type": "String" + }, + "emailVerificationSubject": { + "Type": "String" + }, + "emailVerificationMessage": { + "Type": "String" + }, + "defaultPasswordPolicy": { + "Type": "String" + }, + "passwordPolicyMinLength": { + "Type": "String" + }, + "passwordPolicyCharacters": { + "Type": "CommaDelimitedList" + }, + "requiredAttributes": { + "Type": "CommaDelimitedList" + }, + "aliasAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientGenerateSecret": { + "Type": "String" + }, + "userpoolClientRefreshTokenValidity": { + "Type": "String" + }, + "userpoolClientWriteAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientReadAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientLambdaRole": { + "Type": "String" + }, + "userpoolClientSetAttributes": { + "Type": "String" + }, + "sharedId": { + "Type": "String" + }, + "resourceName": { + "Type": "String" + }, + "authSelections": { + "Type": "String" + }, + "useDefault": { + "Type": "String" + }, + "thirdPartyAuth": { + "Type": "String" + }, + "usernameAttributes": { + "Type": "CommaDelimitedList" + }, + "userPoolGroups": { + "Type": "String" + }, + "adminQueries": { + "Type": "String" + }, + "triggers": { + "Type": "String" + }, + "hostedUI": { + "Type": "String" + }, + "userPoolGroupList": { + "Type": "CommaDelimitedList" + }, + "serviceName": { + "Type": "String" + }, + "usernameCaseSensitive": { + "Type": "String" + }, + "useEnabledMfas": { + "Type": "String" + }, + "authRoleArn": { + "Type": "String" + }, + "unauthRoleArn": { + "Type": "String" + }, + "breakCircularDependency": { + "Type": "String" + }, + "dependsOn": { + "Type": "CommaDelimitedList" + }, + "permissions": { + "Type": "CommaDelimitedList" + }, + "authTriggerConnections": { + "Type": "CommaDelimitedList" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "UserPool": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AutoVerifiedAttributes": [ + "email" + ], + "EmailVerificationMessage": { + "Ref": "emailVerificationMessage" + }, + "EmailVerificationSubject": { + "Ref": "emailVerificationSubject" + }, + "MfaConfiguration": { + "Ref": "mfaConfiguration" + }, + "Policies": { + "PasswordPolicy": { + "MinimumLength": { + "Ref": "passwordPolicyMinLength" + }, + "RequireLowercase": false, + "RequireNumbers": false, + "RequireSymbols": false, + "RequireUppercase": false + } + }, + "Schema": [ + { + "Mutable": true, + "Name": "email", + "Required": true + } + ], + "UserAttributeUpdateSettings": { + "AttributesRequireVerificationBeforeUpdate": [ + "email" + ] + }, + "UserPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userPoolName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "userPoolName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "UsernameAttributes": { + "Ref": "usernameAttributes" + }, + "UsernameConfiguration": { + "CaseSensitive": false + } + } + }, + "UserPoolClientWeb": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "storel41a9495f_app_clientWeb", + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClient": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "storel41a9495f_app_client", + "GenerateSecret": { + "Ref": "userpoolClientGenerateSecret" + }, + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClientRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + }, + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userpoolClientLambdaRole" + }, + { + "Fn::Join": [ + "", + [ + "upClientLambdaRole41a9495f", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPool": { + "Type": "AWS::Cognito::IdentityPool", + "Properties": { + "AllowUnauthenticatedIdentities": { + "Ref": "allowUnauthenticatedIdentities" + }, + "CognitoIdentityProviders": [ + { + "ClientId": { + "Ref": "UserPoolClient" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + }, + { + "ClientId": { + "Ref": "UserPoolClientWeb" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + } + ], + "IdentityPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f_identitypool_41a9495f", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f_identitypool_41a9495f__", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPoolRoleMap": { + "Type": "AWS::Cognito::IdentityPoolRoleAttachment", + "Properties": { + "IdentityPoolId": { + "Ref": "IdentityPool" + }, + "RoleMappings": { + "UserPoolClientRoleMapping": { + "AmbiguousRoleResolution": "AuthenticatedRole", + "IdentityProvider": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${userPool}:${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "userPool": { + "Ref": "UserPool" + }, + "client": { + "Ref": "UserPoolClient" + } + } + ] + }, + "Type": "Token" + }, + "UserPoolWebClientRoleMapping": { + "AmbiguousRoleResolution": "AuthenticatedRole", + "IdentityProvider": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${userPool}:${webClient}", + { + "region": { + "Ref": "AWS::Region" + }, + "userPool": { + "Ref": "UserPool" + }, + "webClient": { + "Ref": "UserPoolClientWeb" + } + } + ] + }, + "Type": "Token" + } + }, + "Roles": { + "unauthenticated": { + "Ref": "unauthRoleArn" + }, + "authenticated": { + "Ref": "authRoleArn" + } + } + }, + "DependsOn": [ + "IdentityPool", + "UserPoolClient", + "UserPoolClientWeb" + ] + } + }, + "Outputs": { + "IdentityPoolId": { + "Description": "Id for the identity pool", + "Value": { + "Ref": "IdentityPool" + } + }, + "IdentityPoolName": { + "Value": { + "Fn::GetAtt": [ + "IdentityPool", + "Name" + ] + } + }, + "UserPoolId": { + "Description": "Id for the user pool", + "Value": { + "Ref": "UserPool" + } + }, + "UserPoolArn": { + "Description": "Arn for the user pool", + "Value": { + "Fn::GetAtt": [ + "UserPool", + "Arn" + ] + } + }, + "UserPoolName": { + "Value": { + "Ref": "userPoolName" + } + }, + "AppClientIDWeb": { + "Description": "The user pool app client id for web", + "Value": { + "Ref": "UserPoolClientWeb" + } + }, + "AppClientID": { + "Description": "The user pool app client id", + "Value": { + "Ref": "UserPoolClient" + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/auth/userPoolGroups/build/userPoolGroups-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/auth/userPoolGroups/build/userPoolGroups-cloudformation-template.json new file mode 100644 index 00000000000..5edc3def07d --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/auth/userPoolGroups/build/userPoolGroups-cloudformation-template.json @@ -0,0 +1,109 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"auth-Cognito-UserPool-Groups\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "AuthRoleArn": { + "Type": "String" + }, + "UnauthRoleArn": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "authstorelocator41a9495f41a9495fIdentityPoolId": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fIdentityPoolId" + }, + "authstorelocator41a9495f41a9495fAppClientID": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fAppClientID" + }, + "authstorelocator41a9495f41a9495fAppClientIDWeb": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fAppClientIDWeb" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "storeLocatorAdminGroup": { + "Type": "AWS::Cognito::UserPoolGroup", + "Properties": { + "Description": "override success", + "GroupName": "storeLocatorAdmin", + "Precedence": 1, + "RoleArn": { + "Fn::GetAtt": [ + "storeLocatorAdminGroupRole", + "Arn" + ] + }, + "UserPoolId": { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + } + } + }, + "storeLocatorAdminGroupRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Allow", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity", + "Condition": { + "StringEquals": { + "cognito-identity.amazonaws.com:aud": { + "Ref": "authstorelocator41a9495f41a9495fIdentityPoolId" + } + }, + "ForAnyValue:StringLike": { + "cognito-identity.amazonaws.com:amr": "authenticated" + } + } + } + ] + }, + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "-storeLocatorAdminGroupRole" + ] + ] + } + } + } + }, + "Outputs": { + "storeLocatorAdminGroupRole": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorAdminGroupRole", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/awscloudformation/build/root-cloudformation-stack.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/awscloudformation/build/root-cloudformation-stack.json new file mode 100644 index 00000000000..1b8df321c23 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/awscloudformation/build/root-cloudformation-stack.json @@ -0,0 +1,653 @@ +{ + "Description": "Root Stack for AWS Amplify CLI", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "DeploymentBucketName": { + "Type": "String", + "Default": "DeploymentBucket", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "AuthRoleName": { + "Type": "String", + "Default": "AuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "UnauthRoleName": { + "Type": "String", + "Default": "UnAuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + } + }, + "Outputs": { + "Region": { + "Description": "CloudFormation provider root stack Region", + "Value": { + "Ref": "AWS::Region" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-Region" + } + } + }, + "StackName": { + "Description": "CloudFormation provider root stack ID", + "Value": { + "Ref": "AWS::StackName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackName" + } + } + }, + "StackId": { + "Description": "CloudFormation provider root stack name", + "Value": { + "Ref": "AWS::StackId" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackId" + } + } + }, + "AuthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + "UnauthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + }, + "DeploymentBucketName": { + "Description": "CloudFormation provider root stack deployment bucket name", + "Value": { + "Ref": "DeploymentBucketName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-DeploymentBucketName" + } + } + }, + "AuthRoleName": { + "Value": { + "Ref": "AuthRole" + } + }, + "UnauthRoleName": { + "Value": { + "Ref": "UnauthRole" + } + } + }, + "Resources": { + "DeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Ref": "DeploymentBucketName" + }, + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "DeploymentBucketBlockHTTP": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "DeploymentBucketName" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Effect": "Deny", + "Principal": "*", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "DeploymentBucketName" + }, + "/*" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "DeploymentBucketName" + } + ] + ] + } + ], + "Condition": { + "Bool": { + "aws:SecureTransport": false + } + } + } + ] + } + } + }, + "AuthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "AuthRoleName" + } + } + }, + "UnauthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "UnauthRoleName" + } + } + }, + "AuthTriggerCustomLambdaStack": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/auth-trigger-cloudformation-template.json", + "Parameters": { + "env": "main", + "userpoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "userpoolArn": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolArn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationLambdaExecutionRole": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.LambdaExecutionRoleArn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.Arn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.Name" + ] + } + } + }, + "DependsOn": [ + "authstorelocator41a9495f41a9495f", + "functionstorelocator41a9495f41a9495fPostConfirmation" + ] + }, + "authuserPoolGroups": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/userPoolGroups-cloudformation-template.json", + "Parameters": { + "AuthRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "UnauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authstorelocator41a9495f41a9495fAppClientIDWeb": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.AppClientIDWeb" + ] + }, + "authstorelocator41a9495f41a9495fAppClientID": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.AppClientID" + ] + }, + "authstorelocator41a9495f41a9495fIdentityPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.IdentityPoolId" + ] + }, + "env": "main" + } + } + }, + "authstorelocator41a9495f41a9495f": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/storelocator41a9495f41a9495f-cloudformation-template.json", + "Parameters": { + "identityPoolName": "storelocator41a9495f_identitypool_41a9495f", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "storel41a9495f", + "userPoolName": "storelocator41a9495f_userpool_41a9495f", + "autoVerifiedAttributes": "email", + "mfaConfiguration": "OFF", + "mfaTypes": "SMS Text Message", + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": "", + "requiredAttributes": "email", + "aliasAttributes": "", + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": "100", + "userpoolClientWriteAttributes": "email", + "userpoolClientReadAttributes": "email", + "userpoolClientLambdaRole": "storel41a9495f_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "41a9495f", + "resourceName": "storelocator41a9495f41a9495f", + "authSelections": "identityPoolAndUserPool", + "useDefault": "manual", + "thirdPartyAuth": false, + "usernameAttributes": "email", + "userPoolGroups": true, + "adminQueries": false, + "triggers": "{\"PostConfirmation\":[\"add-to-group\"]}", + "hostedUI": false, + "userPoolGroupList": "storeLocatorAdmin", + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": "[object Object]", + "permissions": "{\"policyName\":\"AddToGroupCognito\",\"trigger\":\"PostConfirmation\",\"effect\":\"Allow\",\"actions\":[\"cognito-idp:AdminAddUserToGroup\",\"cognito-idp:GetGroup\",\"cognito-idp:CreateGroup\"],\"resource\":{\"paramType\":\"!GetAtt\",\"keys\":[\"UserPool\",\"Arn\"]}}", + "authTriggerConnections": "{\"triggerType\":\"PostConfirmation\",\"lambdaFunctionName\":\"storelocator41a9495f41a9495fPostConfirmation\"}", + "env": "main" + } + } + }, + "functionstorelocator41a9495f41a9495fPostConfirmation": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/function/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json", + "Parameters": { + "modules": "add-to-group", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "GROUP": "storeLocatorAdmin", + "deploymentBucketName": "amplify-storelocator-main-f9ca7-deployment", + "s3Key": "amplify-builds/storelocator41a9495f41a9495fPostConfirmation-6a6c746d4739755a384a-build.zip", + "env": "main" + } + } + }, + "geostoreLocatorMap": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorMap-cloudformation-template.json", + "Parameters": { + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "mapName": "storeLocatorMap", + "mapStyle": "VectorEsriStreets", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "geostoreLocatorSearch": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorSearch-cloudformation-template.json", + "Parameters": { + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "indexName": "storeLocatorSearch", + "dataProvider": "Here", + "dataSourceIntendedUse": "SingleUse", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "geostoreLocatorGeofence": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorGeofence-cloudformation-template.json", + "Parameters": { + "collectionName": "storeLocatorGeofence", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "UpdateRolesWithIDPFunction": { + "DependsOn": [ + "AuthRole", + "UnauthRole", + "authstorelocator41a9495f41a9495f" + ], + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": { + "Fn::Join": [ + "\n", + [ + "const response = require('cfn-response');", + "const { IAMClient, GetRoleCommand, UpdateAssumeRolePolicyCommand } = require('@aws-sdk/client-iam');", + "exports.handler = function(event, context) {", + " // Don't return promise, response.send() marks context as done internally", + " const ignoredPromise = handleEvent(event, context)", + "};", + "async function handleEvent(event, context) {", + " try {", + " let authRoleName = event.ResourceProperties.authRoleName;", + " let unauthRoleName = event.ResourceProperties.unauthRoleName;", + " let idpId = event.ResourceProperties.idpId;", + " let authParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'authenticated'}", + " }", + " }]", + " };", + " let unauthParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'unauthenticated'}", + " }", + " }]", + " };", + " if (event.RequestType === 'Delete') {", + " try {", + " delete authParamsJson.Statement[0].Condition;", + " delete unauthParamsJson.Statement[0].Condition;", + " authParamsJson.Statement[0].Effect = 'Deny'", + " unauthParamsJson.Statement[0].Effect = 'Deny'", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let res = await Promise.all([", + " iam.send(new GetRoleCommand({RoleName: authParams.RoleName})),", + " iam.send(new GetRoleCommand({RoleName: unauthParams.RoleName}))", + " ]);", + " res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.SUCCESS, {Error: err});", + " }", + " } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " }", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.FAILED, {Error: err});", + " }", + "};" + ] + ] + } + }, + "Handler": "index.handler", + "Runtime": "nodejs22.x", + "Timeout": 300, + "Role": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunctionRole", + "Arn" + ] + } + } + }, + "UpdateRolesWithIDPFunctionOutputs": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunction", + "Arn" + ] + }, + "region": { + "Ref": "AWS::Region" + }, + "idpId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.IdentityPoolId" + ] + }, + "authRoleName": { + "Ref": "AuthRole" + }, + "unauthRoleName": { + "Ref": "UnauthRole" + } + } + }, + "UpdateRolesWithIDPFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "AuthRole" + }, + "-idp" + ] + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + }, + "Policies": [ + { + "PolicyName": "UpdateRolesWithIDPFunctionPolicy", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/function/storelocator41a9495f41a9495fPostConfirmation/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/function/storelocator41a9495f41a9495fPostConfirmation/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json new file mode 100644 index 00000000000..192bbea9292 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/function/storelocator41a9495f41a9495fPostConfirmation/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json @@ -0,0 +1,235 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"function-Lambda\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "Parameters": { + "GROUP": { + "Type": "String", + "Default": "" + }, + "modules": { + "Type": "String", + "Default": "", + "Description": "Comma-delimited list of modules to be executed by a lambda trigger. Sent to resource as an env variable." + }, + "resourceName": { + "Type": "String", + "Default": "" + }, + "trigger": { + "Type": "String", + "Default": "true" + }, + "functionName": { + "Type": "String", + "Default": "" + }, + "roleName": { + "Type": "String", + "Default": "" + }, + "parentResource": { + "Type": "String", + "Default": "" + }, + "parentStack": { + "Type": "String", + "Default": "" + }, + "env": { + "Type": "String" + }, + "deploymentBucketName": { + "Type": "String" + }, + "s3Key": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Metadata": { + "aws:asset:path": "./src", + "aws:asset:property": "Code" + }, + "Properties": { + "Handler": "index.handler", + "FunctionName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f41a9495fPostConfirmation", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f41a9495fPostConfirmation", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "Environment": { + "Variables": { + "ENV": { + "Ref": "env" + }, + "MODULES": { + "Ref": "modules" + }, + "REGION": { + "Ref": "AWS::Region" + }, + "GROUP": { + "Ref": "GROUP" + } + } + }, + "Role": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 25, + "Code": { + "S3Bucket": { + "Ref": "deploymentBucketName" + }, + "S3Key": { + "Ref": "s3Key" + } + } + } + }, + "LambdaExecutionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f41a9495fPostConfirmation", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f41a9495fPostConfirmation", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + } + } + }, + "lambdaexecutionpolicy": { + "DependsOn": [ + "LambdaExecutionRole" + ], + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "lambda-execution-policy", + "Roles": [ + { + "Ref": "LambdaExecutionRole" + } + ], + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": { + "Fn::Sub": [ + "arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*", + { + "region": { + "Ref": "AWS::Region" + }, + "account": { + "Ref": "AWS::AccountId" + }, + "lambda": { + "Ref": "LambdaFunction" + } + } + ] + } + } + ] + } + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Ref": "LambdaFunction" + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] + } + }, + "LambdaExecutionRole": { + "Value": { + "Ref": "LambdaExecutionRole" + } + }, + "LambdaExecutionRoleArn": { + "Value": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/geo/storeLocatorGeofence/storeLocatorGeofence-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/geo/storeLocatorGeofence/storeLocatorGeofence-cloudformation-template.json new file mode 100644 index 00000000000..17020d54719 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/geo/storeLocatorGeofence/storeLocatorGeofence-cloudformation-template.json @@ -0,0 +1,364 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "collectionName": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomGeofenceCollectionLambdaServiceRole9040D551": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreateGeofenceCollection", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdateGeofenceCollection", + "geo:DeleteGeofenceCollection" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369", + "Roles": [ + { + "Ref": "CustomGeofenceCollectionLambdaServiceRole9040D551" + } + ] + } + }, + "CustomGeofenceCollectionLambdaCA3D002B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst {\n LocationClient,\n CreateGeofenceCollectionCommand,\n DeleteGeofenceCollectionCommand,\n UpdateGeofenceCollectionCommand,\n} = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateGeofenceCollectionCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.CollectionName && res.CollectionArn) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateGeofenceCollectionCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.CollectionName) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteGeofenceCollectionCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.collectionName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomGeofenceCollectionLambdaServiceRole9040D551", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369", + "CustomGeofenceCollectionLambdaServiceRole9040D551" + ] + }, + "CustomGeofenceCollection": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomGeofenceCollectionLambdaCA3D002B", + "Arn" + ] + }, + "collectionName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "storeLocatorAdminGeofenceCollectionPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:GetGeofence", + "geo:PutGeofence", + "geo:BatchPutGeofence", + "geo:BatchDeleteGeofence", + "geo:ListGeofences" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + "storeLocatorAdmin", + { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + } + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-GeofenceCollection\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/geo/storeLocatorMap/storeLocatorMap-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/geo/storeLocatorMap/storeLocatorMap-cloudformation-template.json new file mode 100644 index 00000000000..bf53b69ff23 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/geo/storeLocatorMap/storeLocatorMap-cloudformation-template.json @@ -0,0 +1,347 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "authRoleName": { + "Type": "String" + }, + "unauthRoleName": { + "Type": "String" + }, + "mapName": { + "Type": "String" + }, + "mapStyle": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomMapLambdaServiceRole4EE7732C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreateMap", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdateMap", + "geo:DeleteMap" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:map/${mapName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "mapName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E", + "Roles": [ + { + "Ref": "CustomMapLambdaServiceRole4EE7732C" + } + ] + } + }, + "CustomMapLambda51D5D430": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst { LocationClient, CreateMapCommand, DeleteMapCommand, UpdateMapCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n Configuration: {\n Style: event.ResourceProperties.mapStyle,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateMapCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Update') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateMapCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Delete') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteMapCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.mapName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomMapLambdaServiceRole4EE7732C", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E", + "CustomMapLambdaServiceRole4EE7732C" + ] + }, + "CustomMap": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomMapLambda51D5D430", + "Arn" + ] + }, + "mapName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + }, + "mapStyle": { + "Ref": "mapStyle" + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "MapPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:GetMapStyleDescriptor", + "geo:GetMapGlyphs", + "geo:GetMapSprites", + "geo:GetMapTile" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CustomMap", + "MapArn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Ref": "authRoleName" + }, + { + "Ref": "unauthRoleName" + }, + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomMap", + "MapName" + ] + } + }, + "Style": { + "Value": { + "Ref": "mapStyle" + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "CustomMap", + "MapArn" + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-Map\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/geo/storeLocatorSearch/storeLocatorSearch-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/geo/storeLocatorSearch/storeLocatorSearch-cloudformation-template.json new file mode 100644 index 00000000000..1ef40f17717 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/geo/storeLocatorSearch/storeLocatorSearch-cloudformation-template.json @@ -0,0 +1,348 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "authRoleName": { + "Type": "String" + }, + "unauthRoleName": { + "Type": "String" + }, + "indexName": { + "Type": "String" + }, + "dataProvider": { + "Type": "String" + }, + "dataSourceIntendedUse": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreatePlaceIndex", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdatePlaceIndex", + "geo:DeletePlaceIndex" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:place-index/${indexName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "indexName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1", + "Roles": [ + { + "Ref": "CustomPlaceIndexLambdaServiceRoleFD2F3C9D" + } + ] + } + }, + "CustomPlaceIndexLambda79813BB9": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst { LocationClient, CreatePlaceIndexCommand, DeletePlaceIndexCommand, UpdatePlaceIndexCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSource: event.ResourceProperties.dataSource,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreatePlaceIndexCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdatePlaceIndexCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeletePlaceIndexCommand(params));\n event.PhysicalResourceId = event.ResourceProperties.indexName;\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.indexName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1", + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D" + ] + }, + "CustomPlaceIndex": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomPlaceIndexLambda79813BB9", + "Arn" + ] + }, + "indexName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + }, + "dataSource": { + "Ref": "dataProvider" + }, + "dataSourceIntendedUse": { + "Ref": "dataSourceIntendedUse" + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "PlaceIndexPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:SearchPlaceIndexForPosition", + "geo:SearchPlaceIndexForText", + "geo:SearchPlaceIndexForSuggestions", + "geo:GetPlace" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexArn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Ref": "authRoleName" + }, + { + "Ref": "unauthRoleName" + }, + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexName" + ] + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexArn" + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-PlaceIndex\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/root-cloudformation-stack.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/root-cloudformation-stack.json new file mode 100644 index 00000000000..1b8df321c23 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/awscloudformation/build/root-cloudformation-stack.json @@ -0,0 +1,653 @@ +{ + "Description": "Root Stack for AWS Amplify CLI", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "DeploymentBucketName": { + "Type": "String", + "Default": "DeploymentBucket", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "AuthRoleName": { + "Type": "String", + "Default": "AuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "UnauthRoleName": { + "Type": "String", + "Default": "UnAuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + } + }, + "Outputs": { + "Region": { + "Description": "CloudFormation provider root stack Region", + "Value": { + "Ref": "AWS::Region" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-Region" + } + } + }, + "StackName": { + "Description": "CloudFormation provider root stack ID", + "Value": { + "Ref": "AWS::StackName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackName" + } + } + }, + "StackId": { + "Description": "CloudFormation provider root stack name", + "Value": { + "Ref": "AWS::StackId" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackId" + } + } + }, + "AuthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + "UnauthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + }, + "DeploymentBucketName": { + "Description": "CloudFormation provider root stack deployment bucket name", + "Value": { + "Ref": "DeploymentBucketName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-DeploymentBucketName" + } + } + }, + "AuthRoleName": { + "Value": { + "Ref": "AuthRole" + } + }, + "UnauthRoleName": { + "Value": { + "Ref": "UnauthRole" + } + } + }, + "Resources": { + "DeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Ref": "DeploymentBucketName" + }, + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "DeploymentBucketBlockHTTP": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "DeploymentBucketName" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Effect": "Deny", + "Principal": "*", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "DeploymentBucketName" + }, + "/*" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "DeploymentBucketName" + } + ] + ] + } + ], + "Condition": { + "Bool": { + "aws:SecureTransport": false + } + } + } + ] + } + } + }, + "AuthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "AuthRoleName" + } + } + }, + "UnauthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "UnauthRoleName" + } + } + }, + "AuthTriggerCustomLambdaStack": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/auth-trigger-cloudformation-template.json", + "Parameters": { + "env": "main", + "userpoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "userpoolArn": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolArn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationLambdaExecutionRole": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.LambdaExecutionRoleArn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.Arn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.Name" + ] + } + } + }, + "DependsOn": [ + "authstorelocator41a9495f41a9495f", + "functionstorelocator41a9495f41a9495fPostConfirmation" + ] + }, + "authuserPoolGroups": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/userPoolGroups-cloudformation-template.json", + "Parameters": { + "AuthRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "UnauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authstorelocator41a9495f41a9495fAppClientIDWeb": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.AppClientIDWeb" + ] + }, + "authstorelocator41a9495f41a9495fAppClientID": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.AppClientID" + ] + }, + "authstorelocator41a9495f41a9495fIdentityPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.IdentityPoolId" + ] + }, + "env": "main" + } + } + }, + "authstorelocator41a9495f41a9495f": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/storelocator41a9495f41a9495f-cloudformation-template.json", + "Parameters": { + "identityPoolName": "storelocator41a9495f_identitypool_41a9495f", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "storel41a9495f", + "userPoolName": "storelocator41a9495f_userpool_41a9495f", + "autoVerifiedAttributes": "email", + "mfaConfiguration": "OFF", + "mfaTypes": "SMS Text Message", + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": "", + "requiredAttributes": "email", + "aliasAttributes": "", + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": "100", + "userpoolClientWriteAttributes": "email", + "userpoolClientReadAttributes": "email", + "userpoolClientLambdaRole": "storel41a9495f_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "41a9495f", + "resourceName": "storelocator41a9495f41a9495f", + "authSelections": "identityPoolAndUserPool", + "useDefault": "manual", + "thirdPartyAuth": false, + "usernameAttributes": "email", + "userPoolGroups": true, + "adminQueries": false, + "triggers": "{\"PostConfirmation\":[\"add-to-group\"]}", + "hostedUI": false, + "userPoolGroupList": "storeLocatorAdmin", + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": "[object Object]", + "permissions": "{\"policyName\":\"AddToGroupCognito\",\"trigger\":\"PostConfirmation\",\"effect\":\"Allow\",\"actions\":[\"cognito-idp:AdminAddUserToGroup\",\"cognito-idp:GetGroup\",\"cognito-idp:CreateGroup\"],\"resource\":{\"paramType\":\"!GetAtt\",\"keys\":[\"UserPool\",\"Arn\"]}}", + "authTriggerConnections": "{\"triggerType\":\"PostConfirmation\",\"lambdaFunctionName\":\"storelocator41a9495f41a9495fPostConfirmation\"}", + "env": "main" + } + } + }, + "functionstorelocator41a9495f41a9495fPostConfirmation": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/function/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json", + "Parameters": { + "modules": "add-to-group", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "GROUP": "storeLocatorAdmin", + "deploymentBucketName": "amplify-storelocator-main-f9ca7-deployment", + "s3Key": "amplify-builds/storelocator41a9495f41a9495fPostConfirmation-6a6c746d4739755a384a-build.zip", + "env": "main" + } + } + }, + "geostoreLocatorMap": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorMap-cloudformation-template.json", + "Parameters": { + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "mapName": "storeLocatorMap", + "mapStyle": "VectorEsriStreets", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "geostoreLocatorSearch": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorSearch-cloudformation-template.json", + "Parameters": { + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "indexName": "storeLocatorSearch", + "dataProvider": "Here", + "dataSourceIntendedUse": "SingleUse", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "geostoreLocatorGeofence": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorGeofence-cloudformation-template.json", + "Parameters": { + "collectionName": "storeLocatorGeofence", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "UpdateRolesWithIDPFunction": { + "DependsOn": [ + "AuthRole", + "UnauthRole", + "authstorelocator41a9495f41a9495f" + ], + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": { + "Fn::Join": [ + "\n", + [ + "const response = require('cfn-response');", + "const { IAMClient, GetRoleCommand, UpdateAssumeRolePolicyCommand } = require('@aws-sdk/client-iam');", + "exports.handler = function(event, context) {", + " // Don't return promise, response.send() marks context as done internally", + " const ignoredPromise = handleEvent(event, context)", + "};", + "async function handleEvent(event, context) {", + " try {", + " let authRoleName = event.ResourceProperties.authRoleName;", + " let unauthRoleName = event.ResourceProperties.unauthRoleName;", + " let idpId = event.ResourceProperties.idpId;", + " let authParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'authenticated'}", + " }", + " }]", + " };", + " let unauthParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'unauthenticated'}", + " }", + " }]", + " };", + " if (event.RequestType === 'Delete') {", + " try {", + " delete authParamsJson.Statement[0].Condition;", + " delete unauthParamsJson.Statement[0].Condition;", + " authParamsJson.Statement[0].Effect = 'Deny'", + " unauthParamsJson.Statement[0].Effect = 'Deny'", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let res = await Promise.all([", + " iam.send(new GetRoleCommand({RoleName: authParams.RoleName})),", + " iam.send(new GetRoleCommand({RoleName: unauthParams.RoleName}))", + " ]);", + " res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.SUCCESS, {Error: err});", + " }", + " } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " }", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.FAILED, {Error: err});", + " }", + "};" + ] + ] + } + }, + "Handler": "index.handler", + "Runtime": "nodejs22.x", + "Timeout": 300, + "Role": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunctionRole", + "Arn" + ] + } + } + }, + "UpdateRolesWithIDPFunctionOutputs": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunction", + "Arn" + ] + }, + "region": { + "Ref": "AWS::Region" + }, + "idpId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.IdentityPoolId" + ] + }, + "authRoleName": { + "Ref": "AuthRole" + }, + "unauthRoleName": { + "Ref": "UnauthRole" + } + } + }, + "UpdateRolesWithIDPFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "AuthRole" + }, + "-idp" + ] + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + }, + "Policies": [ + { + "PolicyName": "UpdateRolesWithIDPFunctionPolicy", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/backend-config.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/backend-config.json new file mode 100644 index 00000000000..6b7a962cd2d --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/backend-config.json @@ -0,0 +1,160 @@ +{ + "auth": { + "storelocator41a9495f41a9495f": { + "customAuth": false, + "dependsOn": [ + { + "attributes": [ + "Arn", + "Name" + ], + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "triggerProvider": "Cognito" + } + ], + "frontendAuthConfig": { + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS" + ], + "passwordProtectionSettings": { + "passwordPolicyCharacters": [], + "passwordPolicyMinLength": 8 + }, + "signupAttributes": [ + "EMAIL" + ], + "socialProviders": [], + "usernameAttributes": [ + "EMAIL" + ], + "verificationMechanisms": [ + "EMAIL" + ] + }, + "providerPlugin": "awscloudformation", + "service": "Cognito" + }, + "userPoolGroups": { + "dependsOn": [ + { + "attributes": [ + "UserPoolId", + "AppClientIDWeb", + "AppClientID", + "IdentityPoolId" + ], + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f" + } + ], + "providerPlugin": "awscloudformation", + "service": "Cognito-UserPool-Groups" + } + }, + "function": { + "storelocator41a9495f41a9495fPostConfirmation": { + "build": true, + "providerPlugin": "awscloudformation", + "service": "Lambda" + } + }, + "geo": { + "storeLocatorGeofence": { + "accessType": "CognitoGroups", + "dependsOn": [ + { + "attributes": [ + "UserPoolId" + ], + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f" + }, + { + "attributes": [ + "storeLocatorAdminGroupRole" + ], + "category": "auth", + "resourceName": "userPoolGroups" + } + ], + "isDefault": true, + "providerPlugin": "awscloudformation", + "service": "GeofenceCollection" + }, + "storeLocatorMap": { + "accessType": "AuthorizedAndGuestUsers", + "dependsOn": [ + { + "attributes": [ + "UserPoolId" + ], + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f" + }, + { + "attributes": [ + "storeLocatorAdminGroupRole" + ], + "category": "auth", + "resourceName": "userPoolGroups" + } + ], + "isDefault": true, + "mapStyle": "VectorEsriStreets", + "providerPlugin": "awscloudformation", + "service": "Map" + }, + "storeLocatorSearch": { + "accessType": "AuthorizedAndGuestUsers", + "dataProvider": "HERE", + "dataSourceIntendedUse": "SingleUse", + "dependsOn": [ + { + "attributes": [ + "UserPoolId" + ], + "category": "auth", + "resourceName": "storelocator41a9495f41a9495f" + }, + { + "attributes": [ + "storeLocatorAdminGroupRole" + ], + "category": "auth", + "resourceName": "userPoolGroups" + } + ], + "isDefault": true, + "providerPlugin": "awscloudformation", + "service": "PlaceIndex" + } + }, + "parameters": { + "AMPLIFY_function_storelocator41a9495f41a9495fPostConfirmation_GROUP": { + "usedBy": [ + { + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation" + } + ] + }, + "AMPLIFY_function_storelocator41a9495f41a9495fPostConfirmation_deploymentBucketName": { + "usedBy": [ + { + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation" + } + ] + }, + "AMPLIFY_function_storelocator41a9495f41a9495fPostConfirmation_s3Key": { + "usedBy": [ + { + "category": "function", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation" + } + ] + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/amplify.state b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/amplify.state new file mode 100644 index 00000000000..0c3efe04706 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/amplify.state @@ -0,0 +1,6 @@ +{ + "pluginId": "amplify-nodejs-function-runtime-provider", + "functionRuntime": "nodejs", + "useLegacyBuild": true, + "defaultEditorFile": "src/index.js" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/custom-policies.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/custom-policies.json new file mode 100644 index 00000000000..528c94f2f26 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/custom-policies.json @@ -0,0 +1,6 @@ +[ + { + "Action": [], + "Resource": [] + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/function-parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/function-parameters.json new file mode 100644 index 00000000000..4c07c063c1d --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/function-parameters.json @@ -0,0 +1,16 @@ +{ + "trigger": true, + "modules": [ + "add-to-group" + ], + "parentResource": "storelocator41a9495f41a9495f", + "functionName": "storelocator41a9495f41a9495fPostConfirmation", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "parentStack": "auth", + "triggerEnvs": "[]", + "triggerDir": "/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/provider-utils/awscloudformation/triggers/PostConfirmation", + "triggerTemplate": "PostConfirmation.json.ejs", + "triggerEventPath": "PostConfirmation.event.json", + "roleName": "storelocator41a9495f41a9495fPostConfirmation", + "skipEdit": true +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/parameters.json new file mode 100644 index 00000000000..82c0ad73bb2 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/parameters.json @@ -0,0 +1,4 @@ +{ + "modules": "add-to-group", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/add-to-group.js b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/add-to-group.js new file mode 100644 index 00000000000..b8920ac2104 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/add-to-group.js @@ -0,0 +1,37 @@ +const { + CognitoIdentityProviderClient, + AdminAddUserToGroupCommand, + GetGroupCommand, + CreateGroupCommand, +} = require('@aws-sdk/client-cognito-identity-provider'); + +const cognitoIdentityServiceProvider = new CognitoIdentityProviderClient({}); + +/** + * @type {import('@types/aws-lambda').PostConfirmationTriggerHandler} + */ +exports.handler = async (event) => { + const groupParams = { + GroupName: process.env.GROUP, + UserPoolId: event.userPoolId, + }; + const addUserParams = { + GroupName: process.env.GROUP, + UserPoolId: event.userPoolId, + Username: event.userName, + }; + /** + * Check if the group exists; if it doesn't, create it. + */ + try { + await cognitoIdentityServiceProvider.send(new GetGroupCommand(groupParams)); + } catch (e) { + await cognitoIdentityServiceProvider.send(new CreateGroupCommand(groupParams)); + } + /** + * Then, add the user to the group. + */ + await cognitoIdentityServiceProvider.send(new AdminAddUserToGroupCommand(addUserParams)); + + return event; +}; diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/event.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/event.json new file mode 100644 index 00000000000..5eafe06ea53 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/event.json @@ -0,0 +1,7 @@ +{ + "request": { + "userPoolId": "testID", + "userName": "testUser" + }, + "response": {} +} diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/index.js b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/index.js new file mode 100644 index 00000000000..876a0cedec6 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/index.js @@ -0,0 +1,33 @@ +/** + * @fileoverview + * + * This CloudFormation Trigger creates a handler which awaits the other handlers + * specified in the `MODULES` env var, located at `./${MODULE}`. + */ + +/** + * The names of modules to load are stored as a comma-delimited string in the + * `MODULES` env var. + */ +const moduleNames = process.env.MODULES.split(','); +/** + * The array of imported modules. + */ +const modules = moduleNames.map((name) => require(`./${name}`)); + +/** + * This async handler iterates over the given modules and awaits them. + * + * @see https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html#nodejs-handler-async + * @type {import('@types/aws-lambda').APIGatewayProxyHandler} + * + */ +exports.handler = async (event, context) => { + /** + * Instead of naively iterating over all handlers, run them concurrently with + * `await Promise.all(...)`. This would otherwise just be determined by the + * order of names in the `MODULES` var. + */ + await Promise.all(modules.map((module) => module.handler(event, context))); + return event; +}; diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/package.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/package.json new file mode 100644 index 00000000000..97ed774298a --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/package.json @@ -0,0 +1,13 @@ +{ + "name": "storelocator41a9495f41a9495fPostConfirmation", + "version": "2.0.0", + "description": "Lambda function generated by Amplify", + "main": "index.js", + "license": "Apache-2.0", + "dependencies": { + "axios": "latest" + }, + "devDependencies": { + "@types/aws-lambda": "^8.10.92" + } +} diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/yarn.lock b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/yarn.lock new file mode 100644 index 00000000000..74757081d71 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/src/yarn.lock @@ -0,0 +1,169 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/aws-lambda@^8.10.92": + version "8.10.161" + resolved "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.161.tgz#36d95723ec46d3d555bf0684f83cf4d4369a28ad" + integrity sha512-rUYdp+MQwSFocxIOcSsYSF3YYYC/uUpMbCY/mbO21vGqfrEYvNSoPyKYDj6RhXXpPfS0KstW9RwG3qXh9sL7FQ== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +axios@latest: + version "1.13.6" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.6.tgz#c3f92da917dc209a15dd29936d20d5089b6b6c98" + integrity sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ== + dependencies: + follow-redirects "^1.15.11" + form-data "^4.0.5" + proxy-from-env "^1.1.0" + +call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + +es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + dependencies: + es-errors "^1.3.0" + +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== + dependencies: + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + +follow-redirects@^1.15.11: + version "1.15.11" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.11.tgz#777d73d72a92f8ec4d2e410eb47352a56b8e8340" + integrity sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ== + +form-data@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.5.tgz#b49e48858045ff4cbf6b03e1805cebcad3679053" + integrity sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" + hasown "^2.0.2" + mime-types "^2.1.12" + +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + +get-intrinsic@^1.2.6: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== + dependencies: + call-bind-apply-helpers "^1.0.2" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + function-bind "^1.1.2" + get-proto "^1.0.1" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + +get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" + +gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + +has-symbols@^1.0.3, has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json new file mode 100644 index 00000000000..192bbea9292 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/function/storelocator41a9495f41a9495fPostConfirmation/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json @@ -0,0 +1,235 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"function-Lambda\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "Parameters": { + "GROUP": { + "Type": "String", + "Default": "" + }, + "modules": { + "Type": "String", + "Default": "", + "Description": "Comma-delimited list of modules to be executed by a lambda trigger. Sent to resource as an env variable." + }, + "resourceName": { + "Type": "String", + "Default": "" + }, + "trigger": { + "Type": "String", + "Default": "true" + }, + "functionName": { + "Type": "String", + "Default": "" + }, + "roleName": { + "Type": "String", + "Default": "" + }, + "parentResource": { + "Type": "String", + "Default": "" + }, + "parentStack": { + "Type": "String", + "Default": "" + }, + "env": { + "Type": "String" + }, + "deploymentBucketName": { + "Type": "String" + }, + "s3Key": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Metadata": { + "aws:asset:path": "./src", + "aws:asset:property": "Code" + }, + "Properties": { + "Handler": "index.handler", + "FunctionName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f41a9495fPostConfirmation", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f41a9495fPostConfirmation", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "Environment": { + "Variables": { + "ENV": { + "Ref": "env" + }, + "MODULES": { + "Ref": "modules" + }, + "REGION": { + "Ref": "AWS::Region" + }, + "GROUP": { + "Ref": "GROUP" + } + } + }, + "Role": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 25, + "Code": { + "S3Bucket": { + "Ref": "deploymentBucketName" + }, + "S3Key": { + "Ref": "s3Key" + } + } + } + }, + "LambdaExecutionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f41a9495fPostConfirmation", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f41a9495fPostConfirmation", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + } + } + }, + "lambdaexecutionpolicy": { + "DependsOn": [ + "LambdaExecutionRole" + ], + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "lambda-execution-policy", + "Roles": [ + { + "Ref": "LambdaExecutionRole" + } + ], + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": { + "Fn::Sub": [ + "arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*", + { + "region": { + "Ref": "AWS::Region" + }, + "account": { + "Ref": "AWS::AccountId" + }, + "lambda": { + "Ref": "LambdaFunction" + } + } + ] + } + } + ] + } + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Ref": "LambdaFunction" + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] + } + }, + "LambdaExecutionRole": { + "Value": { + "Ref": "LambdaExecutionRole" + } + }, + "LambdaExecutionRoleArn": { + "Value": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorGeofence/cli-inputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorGeofence/cli-inputs.json new file mode 100644 index 00000000000..3bb50128864 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorGeofence/cli-inputs.json @@ -0,0 +1,10 @@ +{ + "groupPermissions": { + "storeLocatorAdmin": [ + "Read geofence", + "Create/Update geofence", + "Delete geofence", + "List geofences" + ] + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorGeofence/parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorGeofence/parameters.json new file mode 100644 index 00000000000..7ae714ed5ee --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorGeofence/parameters.json @@ -0,0 +1,4 @@ +{ + "collectionName": "storeLocatorGeofence", + "isDefault": true +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorGeofence/storeLocatorGeofence-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorGeofence/storeLocatorGeofence-cloudformation-template.json new file mode 100644 index 00000000000..17020d54719 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorGeofence/storeLocatorGeofence-cloudformation-template.json @@ -0,0 +1,364 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "collectionName": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomGeofenceCollectionLambdaServiceRole9040D551": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreateGeofenceCollection", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdateGeofenceCollection", + "geo:DeleteGeofenceCollection" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369", + "Roles": [ + { + "Ref": "CustomGeofenceCollectionLambdaServiceRole9040D551" + } + ] + } + }, + "CustomGeofenceCollectionLambdaCA3D002B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst {\n LocationClient,\n CreateGeofenceCollectionCommand,\n DeleteGeofenceCollectionCommand,\n UpdateGeofenceCollectionCommand,\n} = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateGeofenceCollectionCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.CollectionName && res.CollectionArn) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateGeofenceCollectionCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.CollectionName) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteGeofenceCollectionCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.collectionName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomGeofenceCollectionLambdaServiceRole9040D551", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369", + "CustomGeofenceCollectionLambdaServiceRole9040D551" + ] + }, + "CustomGeofenceCollection": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomGeofenceCollectionLambdaCA3D002B", + "Arn" + ] + }, + "collectionName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "storeLocatorAdminGeofenceCollectionPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:GetGeofence", + "geo:PutGeofence", + "geo:BatchPutGeofence", + "geo:BatchDeleteGeofence", + "geo:ListGeofences" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + "storeLocatorAdmin", + { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + } + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-GeofenceCollection\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorMap/cli-inputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorMap/cli-inputs.json new file mode 100644 index 00000000000..89c77968423 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorMap/cli-inputs.json @@ -0,0 +1,5 @@ +{ + "groupPermissions": [ + "storeLocatorAdmin" + ] +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorMap/parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorMap/parameters.json new file mode 100644 index 00000000000..00f849451a2 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorMap/parameters.json @@ -0,0 +1,11 @@ +{ + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "mapName": "storeLocatorMap", + "mapStyle": "VectorEsriStreets", + "isDefault": true +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorMap/storeLocatorMap-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorMap/storeLocatorMap-cloudformation-template.json new file mode 100644 index 00000000000..bf53b69ff23 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorMap/storeLocatorMap-cloudformation-template.json @@ -0,0 +1,347 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "authRoleName": { + "Type": "String" + }, + "unauthRoleName": { + "Type": "String" + }, + "mapName": { + "Type": "String" + }, + "mapStyle": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomMapLambdaServiceRole4EE7732C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreateMap", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdateMap", + "geo:DeleteMap" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:map/${mapName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "mapName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E", + "Roles": [ + { + "Ref": "CustomMapLambdaServiceRole4EE7732C" + } + ] + } + }, + "CustomMapLambda51D5D430": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst { LocationClient, CreateMapCommand, DeleteMapCommand, UpdateMapCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n Configuration: {\n Style: event.ResourceProperties.mapStyle,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateMapCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Update') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateMapCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Delete') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteMapCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.mapName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomMapLambdaServiceRole4EE7732C", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E", + "CustomMapLambdaServiceRole4EE7732C" + ] + }, + "CustomMap": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomMapLambda51D5D430", + "Arn" + ] + }, + "mapName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + }, + "mapStyle": { + "Ref": "mapStyle" + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "MapPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:GetMapStyleDescriptor", + "geo:GetMapGlyphs", + "geo:GetMapSprites", + "geo:GetMapTile" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CustomMap", + "MapArn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Ref": "authRoleName" + }, + { + "Ref": "unauthRoleName" + }, + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomMap", + "MapName" + ] + } + }, + "Style": { + "Value": { + "Ref": "mapStyle" + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "CustomMap", + "MapArn" + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-Map\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorSearch/cli-inputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorSearch/cli-inputs.json new file mode 100644 index 00000000000..89c77968423 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorSearch/cli-inputs.json @@ -0,0 +1,5 @@ +{ + "groupPermissions": [ + "storeLocatorAdmin" + ] +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorSearch/parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorSearch/parameters.json new file mode 100644 index 00000000000..a1ac3acce3c --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorSearch/parameters.json @@ -0,0 +1,12 @@ +{ + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "indexName": "storeLocatorSearch", + "dataProvider": "Here", + "dataSourceIntendedUse": "SingleUse", + "isDefault": true +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorSearch/storeLocatorSearch-cloudformation-template.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorSearch/storeLocatorSearch-cloudformation-template.json new file mode 100644 index 00000000000..1ef40f17717 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/geo/storeLocatorSearch/storeLocatorSearch-cloudformation-template.json @@ -0,0 +1,348 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "authRoleName": { + "Type": "String" + }, + "unauthRoleName": { + "Type": "String" + }, + "indexName": { + "Type": "String" + }, + "dataProvider": { + "Type": "String" + }, + "dataSourceIntendedUse": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreatePlaceIndex", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdatePlaceIndex", + "geo:DeletePlaceIndex" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:place-index/${indexName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "indexName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1", + "Roles": [ + { + "Ref": "CustomPlaceIndexLambdaServiceRoleFD2F3C9D" + } + ] + } + }, + "CustomPlaceIndexLambda79813BB9": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst { LocationClient, CreatePlaceIndexCommand, DeletePlaceIndexCommand, UpdatePlaceIndexCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSource: event.ResourceProperties.dataSource,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreatePlaceIndexCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdatePlaceIndexCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeletePlaceIndexCommand(params));\n event.PhysicalResourceId = event.ResourceProperties.indexName;\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.indexName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1", + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D" + ] + }, + "CustomPlaceIndex": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomPlaceIndexLambda79813BB9", + "Arn" + ] + }, + "indexName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + }, + "dataSource": { + "Ref": "dataProvider" + }, + "dataSourceIntendedUse": { + "Ref": "dataSourceIntendedUse" + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "PlaceIndexPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:SearchPlaceIndexForPosition", + "geo:SearchPlaceIndexForText", + "geo:SearchPlaceIndexForSuggestions", + "geo:GetPlace" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexArn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Ref": "authRoleName" + }, + { + "Ref": "unauthRoleName" + }, + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexName" + ] + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexArn" + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-PlaceIndex\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/tags.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/tags.json new file mode 100644 index 00000000000..b9321d71b83 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/tags.json @@ -0,0 +1,10 @@ +[ + { + "Key": "user:Stack", + "Value": "{project-env}" + }, + { + "Key": "user:Application", + "Value": "{project-name}" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/types/amplify-dependent-resources-ref.d.ts b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/types/amplify-dependent-resources-ref.d.ts new file mode 100644 index 00000000000..3e359cb4006 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/backend/types/amplify-dependent-resources-ref.d.ts @@ -0,0 +1,43 @@ +export type AmplifyDependentResourcesAttributes = { + "auth": { + "storelocator41a9495f41a9495f": { + "AppClientID": "string", + "AppClientIDWeb": "string", + "IdentityPoolId": "string", + "IdentityPoolName": "string", + "UserPoolArn": "string", + "UserPoolId": "string", + "UserPoolName": "string" + }, + "userPoolGroups": { + "storeLocatorAdminGroupRole": "string" + } + }, + "function": { + "storelocator41a9495f41a9495fPostConfirmation": { + "Arn": "string", + "LambdaExecutionRole": "string", + "LambdaExecutionRoleArn": "string", + "Name": "string", + "Region": "string" + } + }, + "geo": { + "storeLocatorGeofence": { + "Arn": "string", + "Name": "string", + "Region": "string" + }, + "storeLocatorMap": { + "Arn": "string", + "Name": "string", + "Region": "string", + "Style": "string" + }, + "storeLocatorSearch": { + "Arn": "string", + "Name": "string", + "Region": "string" + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/cli.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/cli.json new file mode 100644 index 00000000000..11dc8ca0f7d --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/cli.json @@ -0,0 +1,65 @@ +{ + "features": { + "graphqltransformer": { + "addmissingownerfields": true, + "improvepluralization": false, + "validatetypenamereservedwords": true, + "useexperimentalpipelinedtransformer": true, + "enableiterativegsiupdates": true, + "secondarykeyasgsi": true, + "skipoverridemutationinputtypes": true, + "transformerversion": 2, + "suppressschemamigrationprompt": true, + "securityenhancementnotification": false, + "showfieldauthnotification": false, + "usesubusernamefordefaultidentityclaim": true, + "usefieldnameforprimarykeyconnectionfield": false, + "enableautoindexquerynames": true, + "respectprimarykeyattributesonconnectionfield": true, + "shoulddeepmergedirectiveconfigdefaults": false, + "populateownerfieldforstaticgroupauth": true, + "subscriptionsinheritprimaryauth": false, + "enablegen2migration": false + }, + "frontend-ios": { + "enablexcodeintegration": true + }, + "auth": { + "enablecaseinsensitivity": true, + "useinclusiveterminology": true, + "breakcirculardependency": true, + "forcealiasattributes": false, + "useenabledmfas": true + }, + "codegen": { + "useappsyncmodelgenplugin": true, + "usedocsgeneratorplugin": true, + "usetypesgeneratorplugin": true, + "cleangeneratedmodelsdirectory": true, + "retaincasestyle": true, + "addtimestampfields": true, + "handlelistnullabilitytransparently": true, + "emitauthprovider": true, + "generateindexrules": true, + "enabledartnullsafety": true, + "generatemodelsforlazyloadandcustomselectionset": false + }, + "appsync": { + "generategraphqlpermissions": true + }, + "latestregionsupport": { + "pinpoint": 1, + "translate": 1, + "transcribe": 1, + "rekognition": 1, + "textract": 1, + "comprehend": 1 + }, + "project": { + "overrides": true + } + }, + "debug": { + "shareProjectConfig": false + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/hooks/README.md b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/hooks/README.md new file mode 100644 index 00000000000..8fb601eaebe --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/hooks/README.md @@ -0,0 +1,7 @@ +# Command Hooks + +Command hooks can be used to run custom scripts upon Amplify CLI lifecycle events like pre-push, post-add-function, etc. + +To get started, add your script files based on the expected naming convention in this directory. + +Learn more about the script file naming convention, hook parameters, third party dependencies, and advanced configurations at https://docs.amplify.aws/cli/usage/command-hooks diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/team-provider-info.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/team-provider-info.json new file mode 100644 index 00000000000..5d3c96a9e20 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/amplify/team-provider-info.json @@ -0,0 +1,34 @@ +{ + "main": { + "awscloudformation": { + "AuthRoleName": "amplify-storelocator-main-f9ca7-authRole", + "UnauthRoleArn": "arn:aws:iam::123456789012:role/amplify-storelocator-main-f9ca7-unauthRole", + "AuthRoleArn": "arn:aws:iam::123456789012:role/amplify-storelocator-main-f9ca7-authRole", + "Region": "us-east-1", + "DeploymentBucketName": "amplify-storelocator-main-f9ca7-deployment", + "UnauthRoleName": "amplify-storelocator-main-f9ca7-unauthRole", + "StackName": "amplify-storelocator-main-f9ca7", + "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/amplify-storelocator-main-f9ca7/06c2ecf0-279e-11f1-a161-0ea0286337e9", + "AmplifyAppId": "storelocator", + "AuthTriggerTemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/auth-trigger-cloudformation-template.json" + }, + "categories": { + "auth": { + "storelocator41a9495f41a9495f": {}, + "userPoolGroups": {} + }, + "function": { + "storelocator41a9495f41a9495fPostConfirmation": { + "GROUP": "storeLocatorAdmin", + "deploymentBucketName": "amplify-storelocator-main-f9ca7-deployment", + "s3Key": "amplify-builds/storelocator41a9495f41a9495fPostConfirmation-6a6c746d4739755a384a-build.zip" + } + }, + "geo": { + "storeLocatorMap": {}, + "storeLocatorSearch": {}, + "storeLocatorGeofence": {} + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.generate/package.json b/amplify-migration-apps/store-locator/_snapshot.pre.generate/package.json new file mode 100644 index 00000000000..9abc47b5c30 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.generate/package.json @@ -0,0 +1,42 @@ +{ + "name": "@amplify-migration-apps/store-locator", + "private": true, + "version": "0.0.0", + "type": "module", + "installConfig": { + "hoistingLimits": "workspaces" + }, + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview", + "sanitize": "tsx ../sanitize.ts", + "typecheck": "cd _snapshot.post.generate/amplify && npx tsc --noEmit" + }, + "dependencies": { + "@aws-sdk/client-cognito-identity-provider": "^3.1016.0", + "@aws-amplify/geo": "^3.0.92", + "@aws-amplify/ui-react": "^6.13.2", + "@aws-amplify/ui-react-geo": "^2.2.13", + "aws-amplify": "^6.16.0", + "maplibre-gl": "^2.4.0", + "maplibre-gl-js-amplify": "^4.0.2", + "react": "^19.2.0", + "react-dom": "^19.2.0" + }, + "devDependencies": { + "@eslint/js": "^9.39.1", + "@types/node": "^24.10.1", + "@types/react": "^19.2.5", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "globals": "^16.5.0", + "typescript": "~5.9.3", + "typescript-eslint": "^8.46.4", + "vite": "^7.2.4" + } +} diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-auth179371D7-1UWZNDSHOH9AL.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-auth179371D7-1UWZNDSHOH9AL.description.txt new file mode 100644 index 00000000000..72751282334 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-auth179371D7-1UWZNDSHOH9AL.description.txt @@ -0,0 +1 @@ +{"createdOn":"Linux","createdBy":"AmplifyPipelineDeploy","createdWith":"1.11.2","stackType":"auth-Cognito","metadata":{}} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-auth179371D7-1UWZNDSHOH9AL.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-auth179371D7-1UWZNDSHOH9AL.outputs.json new file mode 100644 index 00000000000..706f54737a6 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-auth179371D7-1UWZNDSHOH9AL.outputs.json @@ -0,0 +1,30 @@ +[ + { + "OutputKey": "amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef", + "OutputValue": "amplify-storelocator-ge-amplifyAuthstoreLocatorAd-o18wwJFGuDoS" + }, + { + "OutputKey": "amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthauthenticatedUserRoleE47B81E2Ref", + "OutputValue": "amplify-storelocator-ge-amplifyAuthauthenticatedU-9OqjoXZMGmQf" + }, + { + "OutputKey": "amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthUserPoolE0F0BF85Ref", + "OutputValue": "us-east-1_AeAJNVPgB" + }, + { + "OutputKey": "amplifystorelocatorgen2mainbranch62d6167d4cauthstorelocator41a9495f41a9495fPostConfirmationgen2mainlambda5D769661Ref", + "OutputValue": "storelocator41a9495f41a9495fPostConfirmation-gen2-main" + }, + { + "OutputKey": "amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthIdentityPool537188CARef", + "OutputValue": "us-east-1:cbd1c99c-bad6-4aff-8d75-a63d582714ee" + }, + { + "OutputKey": "amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthUserPoolAppClientA8D9B6FBRef", + "OutputValue": "1t7et22n9m68741vh3pmv2nmfq" + }, + { + "OutputKey": "amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthunauthenticatedUserRole91ACCEF4Ref", + "OutputValue": "amplify-storelocator-ge-amplifyAuthunauthenticate-lXWiZUp3FtNM" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-auth179371D7-1UWZNDSHOH9AL.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-auth179371D7-1UWZNDSHOH9AL.parameters.json new file mode 100644 index 00000000000..0637a088a01 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-auth179371D7-1UWZNDSHOH9AL.parameters.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-auth179371D7-1UWZNDSHOH9AL.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-auth179371D7-1UWZNDSHOH9AL.template.json new file mode 100644 index 00000000000..cd5decd6ce0 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-auth179371D7-1UWZNDSHOH9AL.template.json @@ -0,0 +1,980 @@ +{ + "Description": "{\"createdOn\":\"Linux\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.11.2\",\"stackType\":\"auth-Cognito\",\"metadata\":{}}", + "Resources": { + "amplifyAuthUserPool4BA7F805": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AccountRecoverySetting": { + "RecoveryMechanisms": [ + { + "Name": "verified_email", + "Priority": 1 + } + ] + }, + "AdminCreateUserConfig": { + "AllowAdminCreateUserOnly": false + }, + "AutoVerifiedAttributes": [ + "email" + ], + "EmailVerificationMessage": "Your verification code is {####}", + "EmailVerificationSubject": "Your verification code", + "LambdaConfig": { + "PostConfirmation": { + "Fn::GetAtt": [ + "storelocator41a9495f41a9495fPostConfirmationgen2mainlambdaB4C1234A", + "Arn" + ] + } + }, + "MfaConfiguration": "OFF", + "Policies": { + "PasswordPolicy": { + "MinimumLength": 8, + "RequireLowercase": false, + "RequireNumbers": false, + "RequireSymbols": false, + "RequireUppercase": false, + "TemporaryPasswordValidityDays": 7 + } + }, + "Schema": [ + { + "Mutable": true, + "Name": "email", + "Required": true + } + ], + "SmsVerificationMessage": "The verification code to your new account is {####}", + "UserAttributeUpdateSettings": { + "AttributesRequireVerificationBeforeUpdate": [ + "email" + ] + }, + "UserPoolTags": { + "amplify:app-id": "storelocator", + "amplify:branch-name": "gen2-main", + "amplify:deployment-type": "branch", + "amplify:friendly-name": "amplifyAuth", + "created-by": "amplify" + }, + "UsernameAttributes": [ + "email" + ], + "UsernameConfiguration": { + "CaseSensitive": false + }, + "VerificationMessageTemplate": { + "DefaultEmailOption": "CONFIRM_WITH_CODE", + "EmailMessage": "Your verification code is {####}", + "EmailSubject": "Your verification code", + "SmsMessage": "The verification code to your new account is {####}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete", + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/amplifyAuth/UserPool/Resource" + } + }, + "amplifyAuthUserPoolPostConfirmationCognitoE7E727CF": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "storelocator41a9495f41a9495fPostConfirmationgen2mainlambdaB4C1234A", + "Arn" + ] + }, + "Principal": "cognito-idp.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": [ + "amplifyAuthUserPool4BA7F805", + "Arn" + ] + } + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/amplifyAuth/UserPool/PostConfirmationCognito" + } + }, + "amplifyAuthUserPoolNativeAppClient79534448": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "AllowedOAuthFlowsUserPoolClient": false, + "AuthSessionValidity": 3, + "EnablePropagateAdditionalUserContextData": false, + "EnableTokenRevocation": true, + "GenerateSecret": false, + "RefreshTokenValidity": 144000, + "SupportedIdentityProviders": [ + "COGNITO" + ], + "TokenValidityUnits": { + "RefreshToken": "minutes" + }, + "UserPoolId": { + "Ref": "amplifyAuthUserPool4BA7F805" + } + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/amplifyAuth/UserPool/NativeAppClient/Resource" + } + }, + "amplifyAuthUserPoolAppClient2626C6F8": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "AllowedOAuthFlows": [ + "code" + ], + "AllowedOAuthFlowsUserPoolClient": true, + "AllowedOAuthScopes": [ + "profile", + "phone", + "email", + "openid", + "aws.cognito.signin.user.admin" + ], + "CallbackURLs": [ + "https://example.com" + ], + "ExplicitAuthFlows": [ + "ALLOW_CUSTOM_AUTH", + "ALLOW_USER_SRP_AUTH", + "ALLOW_REFRESH_TOKEN_AUTH" + ], + "PreventUserExistenceErrors": "ENABLED", + "SupportedIdentityProviders": [ + "COGNITO" + ], + "UserPoolId": { + "Ref": "amplifyAuthUserPool4BA7F805" + } + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/amplifyAuth/UserPoolAppClient/Resource" + } + }, + "amplifyAuthIdentityPool3FDE84CC": { + "Type": "AWS::Cognito::IdentityPool", + "Properties": { + "AllowUnauthenticatedIdentities": true, + "CognitoIdentityProviders": [ + { + "ClientId": { + "Ref": "amplifyAuthUserPoolAppClient2626C6F8" + }, + "ProviderName": { + "Fn::Join": [ + "", + [ + "cognito-idp.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com/", + { + "Ref": "amplifyAuthUserPool4BA7F805" + } + ] + ] + } + } + ], + "IdentityPoolTags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "amplify:friendly-name", + "Value": "amplifyAuth" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ], + "SupportedLoginProviders": {} + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/amplifyAuth/IdentityPool" + } + }, + "amplifyAuthauthenticatedUserRoleD8DA3689": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRoleWithWebIdentity", + "Condition": { + "StringEquals": { + "cognito-identity.amazonaws.com:aud": { + "Ref": "amplifyAuthIdentityPool3FDE84CC" + } + }, + "ForAnyValue:StringLike": { + "cognito-identity.amazonaws.com:amr": "authenticated" + } + }, + "Effect": "Allow", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "amplify:friendly-name", + "Value": "amplifyAuth" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/amplifyAuth/authenticatedUserRole/Resource" + } + }, + "amplifyAuthunauthenticatedUserRole2B524D9E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRoleWithWebIdentity", + "Condition": { + "StringEquals": { + "cognito-identity.amazonaws.com:aud": { + "Ref": "amplifyAuthIdentityPool3FDE84CC" + } + }, + "ForAnyValue:StringLike": { + "cognito-identity.amazonaws.com:amr": "unauthenticated" + } + }, + "Effect": "Allow", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "amplify:friendly-name", + "Value": "amplifyAuth" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/amplifyAuth/unauthenticatedUserRole/Resource" + } + }, + "amplifyAuthIdentityPoolRoleAttachment045F17C8": { + "Type": "AWS::Cognito::IdentityPoolRoleAttachment", + "Properties": { + "IdentityPoolId": { + "Ref": "amplifyAuthIdentityPool3FDE84CC" + }, + "RoleMappings": { + "UserPoolWebClientRoleMapping": { + "AmbiguousRoleResolution": "AuthenticatedRole", + "IdentityProvider": { + "Fn::Join": [ + "", + [ + "cognito-idp.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com/", + { + "Ref": "amplifyAuthUserPool4BA7F805" + }, + ":", + { + "Ref": "amplifyAuthUserPoolAppClient2626C6F8" + } + ] + ] + }, + "Type": "Token" + } + }, + "Roles": { + "unauthenticated": { + "Fn::GetAtt": [ + "amplifyAuthunauthenticatedUserRole2B524D9E", + "Arn" + ] + }, + "authenticated": { + "Fn::GetAtt": [ + "amplifyAuthauthenticatedUserRoleD8DA3689", + "Arn" + ] + } + } + }, + "DependsOn": [ + "amplifyAuthIdentityPool3FDE84CC", + "amplifyAuthUserPoolAppClient2626C6F8" + ], + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/amplifyAuth/IdentityPoolRoleAttachment" + } + }, + "amplifyAuthstoreLocatorAdminGroupRoleDECAB489": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRoleWithWebIdentity", + "Condition": { + "StringEquals": { + "cognito-identity.amazonaws.com:aud": { + "Ref": "amplifyAuthIdentityPool3FDE84CC" + } + }, + "ForAnyValue:StringLike": { + "cognito-identity.amazonaws.com:amr": "authenticated" + } + }, + "Effect": "Allow", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "amplify:friendly-name", + "Value": "amplifyAuth" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/amplifyAuth/storeLocatorAdminGroupRole/Resource" + } + }, + "amplifyAuthstoreLocatorAdminGroup85B78B77": { + "Type": "AWS::Cognito::UserPoolGroup", + "Properties": { + "GroupName": "storeLocatorAdmin", + "Precedence": 0, + "RoleArn": { + "Fn::GetAtt": [ + "amplifyAuthstoreLocatorAdminGroupRoleDECAB489", + "Arn" + ] + }, + "UserPoolId": { + "Ref": "amplifyAuthUserPool4BA7F805" + } + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/amplifyAuth/storeLocatorAdminGroup" + } + }, + "storelocator41a9495f41a9495fPostConfirmationgen2mainlambdaServiceRole87050722": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "amplify:friendly-name", + "Value": "storelocator41a9495f41a9495fPostConfirmation-gen2-main" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/storelocator41a9495f41a9495fPostConfirmation-gen2-main-lambda/ServiceRole/Resource" + } + }, + "storelocator41a9495f41a9495fPostConfirmationgen2mainlambdaServiceRoleDefaultPolicyD1FAD8E3": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "ssm:GetParameters", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ssm:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":parameter/amplify/resource_reference/storelocator/gen2main-branch-62d6167d4c/AMPLIFY_AUTH_USERPOOL_ID" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "storelocator41a9495f41a9495fPostConfirmationgen2mainlambdaServiceRoleDefaultPolicyD1FAD8E3", + "Roles": [ + { + "Ref": "storelocator41a9495f41a9495fPostConfirmationgen2mainlambdaServiceRole87050722" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/storelocator41a9495f41a9495fPostConfirmation-gen2-main-lambda/ServiceRole/DefaultPolicy/Resource" + } + }, + "storelocator41a9495f41a9495fPostConfirmationgen2mainlambdaB4C1234A": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Architectures": [ + "x86_64" + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "34e0fef1a944e90a1fa37e3e87c4349d006db1c0017d5da1ee07c0449531c263.zip" + }, + "Environment": { + "Variables": { + "GROUP": "storeLocatorAdmin", + "MODULES": "add-to-group", + "ENV": "gen2-main", + "REGION": "us-east-1", + "AMPLIFY_SSM_ENV_CONFIG": "{\"AMPLIFY_AUTH_USERPOOL_ID\":{\"path\":\"/amplify/resource_reference/storelocator/gen2main-branch-62d6167d4c/AMPLIFY_AUTH_USERPOOL_ID\"}}", + "AMPLIFY_AUTH_USERPOOL_ID": "" + } + }, + "EphemeralStorage": { + "Size": 512 + }, + "FunctionName": "storelocator41a9495f41a9495fPostConfirmation-gen2-main", + "Handler": "index.handler", + "MemorySize": 512, + "Role": { + "Fn::GetAtt": [ + "storelocator41a9495f41a9495fPostConfirmationgen2mainlambdaServiceRole87050722", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "amplify:friendly-name", + "Value": "storelocator41a9495f41a9495fPostConfirmation-gen2-main" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ], + "Timeout": 25 + }, + "DependsOn": [ + "storelocator41a9495f41a9495fPostConfirmationgen2mainlambdaServiceRole87050722" + ], + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/storelocator41a9495f41a9495fPostConfirmation-gen2-main-lambda/Resource", + "aws:asset:path": "asset.34e0fef1a944e90a1fa37e3e87c4349d006db1c0017d5da1ee07c0449531c263", + "aws:asset:is-bundled": true, + "aws:asset:property": "Code" + } + }, + "AMPLIFYAUTHUSERPOOLIDParameterCC466CA3": { + "Type": "AWS::SSM::Parameter", + "Properties": { + "Name": "/amplify/resource_reference/storelocator/gen2main-branch-62d6167d4c/AMPLIFY_AUTH_USERPOOL_ID", + "Tags": { + "amplify:app-id": "storelocator", + "amplify:branch-name": "gen2-main", + "amplify:deployment-type": "branch", + "created-by": "amplify" + }, + "Type": "String", + "Value": { + "Ref": "amplifyAuthUserPool4BA7F805" + } + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/AMPLIFY_AUTH_USERPOOL_IDParameter/Resource" + } + }, + "userpoolAccess13FEE5419": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "cognito-idp:AdminAddUserToGroup", + "cognito-idp:GetGroup", + "cognito-idp:ListGroups", + "cognito-idp:CreateGroup", + "cognito-idp:DeleteGroup", + "cognito-idp:UpdateGroup" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "amplifyAuthUserPool4BA7F805", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "userpoolAccess13FEE5419", + "Roles": [ + { + "Ref": "storelocator41a9495f41a9495fPostConfirmationgen2mainlambdaServiceRole87050722" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/userpoolAccess1/Resource" + } + }, + "CDKMetadata": { + "Type": "AWS::CDK::Metadata", + "Properties": { + "Analytics": "v2:deflate64:H4sIAAAAAAAA/12NzW7CQAyEn4X74tLAoVeI1KoXFBH1HC0bkzrZn2rtFKFV3r3aoLSop5mxPZ8LKHY72Kz0ldemHdaWzpCOyIJtLdoMSl+5SSZ0niRA+mCMVQhWlRf/6xdTWkIvj6u/yXuLXkhuS/kxn4LFvYg2n+5f/y2G8WtSVrtzqyGVF19hdMRMwee719EboeAnRdpByqA8nrUKlswtx7tbMI0PLfYMx1kWguJto5lRGPZZFG/hMJoB5aAZFbODVEsk31U6aoeCcUYvYZrU3KtFd+S7SeUv0PPTd1HA8wtsVj0TrePohRzC6a4/caZnM34BAAA=" + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth/CDKMetadata/Default" + }, + "Condition": "CDKMetadataAvailable" + } + }, + "Conditions": { + "CDKMetadataAvailable": { + "Fn::Or": [ + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "af-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-3" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-4" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-northwest-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-2" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "il-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "sa-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-1" + ] + } + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-2" + ] + } + ] + } + }, + "Outputs": { + "amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthUserPoolE0F0BF85Ref": { + "Value": { + "Ref": "amplifyAuthUserPool4BA7F805" + } + }, + "amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthUserPoolAppClientA8D9B6FBRef": { + "Value": { + "Ref": "amplifyAuthUserPoolAppClient2626C6F8" + } + }, + "amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthIdentityPool537188CARef": { + "Value": { + "Ref": "amplifyAuthIdentityPool3FDE84CC" + } + }, + "amplifystorelocatorgen2mainbranch62d6167d4cauthstorelocator41a9495f41a9495fPostConfirmationgen2mainlambda5D769661Ref": { + "Value": { + "Ref": "storelocator41a9495f41a9495fPostConfirmationgen2mainlambdaB4C1234A" + } + }, + "amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef": { + "Value": { + "Ref": "amplifyAuthstoreLocatorAdminGroupRoleDECAB489" + } + }, + "amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthauthenticatedUserRoleE47B81E2Ref": { + "Value": { + "Ref": "amplifyAuthauthenticatedUserRoleD8DA3689" + } + }, + "amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthunauthenticatedUserRole91ACCEF4Ref": { + "Value": { + "Ref": "amplifyAuthunauthenticatedUserRole2B524D9E" + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorGeofenceEAAC8D05-17RAOM3PY1E9K.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorGeofenceEAAC8D05-17RAOM3PY1E9K.description.txt new file mode 100644 index 00000000000..1e3215c63d9 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorGeofenceEAAC8D05-17RAOM3PY1E9K.description.txt @@ -0,0 +1 @@ +{"createdOn":"Linux","createdBy":"AmplifyPipelineDeploy","createdWith":"1.21.1","stackType":"custom","metadata":{}} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorGeofenceEAAC8D05-17RAOM3PY1E9K.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorGeofenceEAAC8D05-17RAOM3PY1E9K.outputs.json new file mode 100644 index 00000000000..d0f3d98fe35 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorGeofenceEAAC8D05-17RAOM3PY1E9K.outputs.json @@ -0,0 +1,18 @@ +[ + { + "OutputKey": "amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorGeofenceCustomGeofenceCollectionF2914E55CollectionName", + "OutputValue": "storeLocatorGeofence-gen2-main" + }, + { + "OutputKey": "Region", + "OutputValue": "us-east-1" + }, + { + "OutputKey": "Arn", + "OutputValue": "arn:aws:geo:us-east-1:123456789012:geofence-collection/storeLocatorGeofence-gen2-main" + }, + { + "OutputKey": "Name", + "OutputValue": "storeLocatorGeofence-gen2-main" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorGeofenceEAAC8D05-17RAOM3PY1E9K.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorGeofenceEAAC8D05-17RAOM3PY1E9K.parameters.json new file mode 100644 index 00000000000..2a93a404467 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorGeofenceEAAC8D05-17RAOM3PY1E9K.parameters.json @@ -0,0 +1,6 @@ +[ + { + "ParameterKey": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef", + "ParameterValue": "amplify-storelocator-ge-amplifyAuthstoreLocatorAd-o18wwJFGuDoS" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorGeofenceEAAC8D05-17RAOM3PY1E9K.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorGeofenceEAAC8D05-17RAOM3PY1E9K.template.json new file mode 100644 index 00000000000..e38b07e1f04 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorGeofenceEAAC8D05-17RAOM3PY1E9K.template.json @@ -0,0 +1,639 @@ +{ + "Description": "{\"createdOn\":\"Linux\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.21.1\",\"stackType\":\"custom\",\"metadata\":{}}", + "Mappings": { + "storeLocatorGeofenceRegionMapping9D9BCEA8": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Resources": { + "storeLocatorGeofenceCustomGeofenceCollectionLambdaServiceRole9040D5514E15B340": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorGeofence/storeLocatorGeofence/CustomGeofenceCollectionLambdaServiceRole9040D551" + } + }, + "storeLocatorGeofenceCustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369D308393B": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreateGeofenceCollection", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdateGeofenceCollection", + "geo:DeleteGeofenceCollection" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:geo:", + { + "Fn::FindInMap": [ + "storeLocatorGeofenceRegionMapping9D9BCEA8", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":geofence-collection/storeLocatorGeofence-gen2-main" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369", + "Roles": [ + { + "Ref": "storeLocatorGeofenceCustomGeofenceCollectionLambdaServiceRole9040D5514E15B340" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorGeofence/storeLocatorGeofence/CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369" + } + }, + "storeLocatorGeofenceCustomGeofenceCollectionLambdaCA3D002BC8592787": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst {\n LocationClient,\n CreateGeofenceCollectionCommand,\n DeleteGeofenceCollectionCommand,\n UpdateGeofenceCollectionCommand,\n} = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateGeofenceCollectionCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.CollectionName && res.CollectionArn) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateGeofenceCollectionCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.CollectionName) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteGeofenceCollectionCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.collectionName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "storeLocatorGeofenceCustomGeofenceCollectionLambdaServiceRole9040D5514E15B340", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ], + "Timeout": 300 + }, + "DependsOn": [ + "storeLocatorGeofenceCustomGeofenceCollectionLambdaServiceRole9040D5514E15B340", + "storeLocatorGeofenceCustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369D308393B" + ], + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorGeofence/storeLocatorGeofence/CustomGeofenceCollectionLambdaCA3D002B" + } + }, + "storeLocatorGeofenceCustomGeofenceCollectionB76AA26D": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "storeLocatorGeofenceCustomGeofenceCollectionLambdaCA3D002BC8592787", + "Arn" + ] + }, + "collectionName": "storeLocatorGeofence-gen2-main", + "region": { + "Fn::FindInMap": [ + "storeLocatorGeofenceRegionMapping9D9BCEA8", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": "gen2-main" + }, + "DeletionPolicy": "Delete", + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorGeofence/storeLocatorGeofence/CustomGeofenceCollection" + } + }, + "storeLocatorGeofencestoreLocatorAdminGeofenceCollectionPolicy34A5CD0F": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:GetGeofence", + "geo:PutGeofence", + "geo:BatchPutGeofence", + "geo:BatchDeleteGeofence", + "geo:ListGeofences" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:geo:", + { + "Fn::FindInMap": [ + "storeLocatorGeofenceRegionMapping9D9BCEA8", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":geofence-collection/", + { + "Fn::GetAtt": [ + "storeLocatorGeofenceCustomGeofenceCollectionB76AA26D", + "CollectionName" + ] + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "storeLocatorAdminstoreLocatorGeofence-gen2-mainPolicy", + "Roles": [ + { + "Ref": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorGeofence/storeLocatorGeofence/storeLocatorAdminGeofenceCollectionPolicy" + } + }, + "CDKMetadata": { + "Type": "AWS::CDK::Metadata", + "Properties": { + "Analytics": "v2:deflate64:H4sIAAAAAAAA/yXLTQ6DIBBA4bO4x6klLron6a4/sQdoRsBmFAYiUNMY797Yrt7iy5Mg2xaaCpdUazPVjnpYrzZlax4Z9STUwBeMkfglcEnPldDDqgbugrM73oMj/dmEQ98bBDXwubDOFHjbWZWUg+9sCmXWv+FWcix5ExyMhTEd3lLC8QRNNSaiei6cyVvo/v0C08sIKp8AAAA=" + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorGeofence/CDKMetadata/Default" + }, + "Condition": "CDKMetadataAvailable" + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorGeofenceCustomGeofenceCollectionB76AA26D", + "CollectionName" + ] + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "storeLocatorGeofenceRegionMapping9D9BCEA8", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::Join": [ + "", + [ + "arn:aws:geo:", + { + "Fn::FindInMap": [ + "storeLocatorGeofenceRegionMapping9D9BCEA8", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":geofence-collection/", + { + "Fn::GetAtt": [ + "storeLocatorGeofenceCustomGeofenceCollectionB76AA26D", + "CollectionName" + ] + } + ] + ] + } + }, + "amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorGeofenceCustomGeofenceCollectionF2914E55CollectionName": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorGeofenceCustomGeofenceCollectionB76AA26D", + "CollectionName" + ] + } + } + }, + "Conditions": { + "CDKMetadataAvailable": { + "Fn::Or": [ + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "af-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-3" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-4" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-northwest-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-2" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "il-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "sa-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-1" + ] + } + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-2" + ] + } + ] + } + }, + "Parameters": { + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef": { + "Type": "String" + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorMap6A22ACC1-8ERJEQ7R4WPN.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorMap6A22ACC1-8ERJEQ7R4WPN.description.txt new file mode 100644 index 00000000000..1e3215c63d9 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorMap6A22ACC1-8ERJEQ7R4WPN.description.txt @@ -0,0 +1 @@ +{"createdOn":"Linux","createdBy":"AmplifyPipelineDeploy","createdWith":"1.21.1","stackType":"custom","metadata":{}} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorMap6A22ACC1-8ERJEQ7R4WPN.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorMap6A22ACC1-8ERJEQ7R4WPN.outputs.json new file mode 100644 index 00000000000..a8fdcfffbc4 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorMap6A22ACC1-8ERJEQ7R4WPN.outputs.json @@ -0,0 +1,22 @@ +[ + { + "OutputKey": "Style", + "OutputValue": "VectorEsriStreets" + }, + { + "OutputKey": "Region", + "OutputValue": "us-east-1" + }, + { + "OutputKey": "amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorMapCustomMap41EB8E23MapName", + "OutputValue": "storeLocatorMap-gen2-main" + }, + { + "OutputKey": "Arn", + "OutputValue": "arn:aws:geo:us-east-1:123456789012:map/storeLocatorMap-gen2-main" + }, + { + "OutputKey": "Name", + "OutputValue": "storeLocatorMap-gen2-main" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorMap6A22ACC1-8ERJEQ7R4WPN.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorMap6A22ACC1-8ERJEQ7R4WPN.parameters.json new file mode 100644 index 00000000000..8e6d6f64984 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorMap6A22ACC1-8ERJEQ7R4WPN.parameters.json @@ -0,0 +1,14 @@ +[ + { + "ParameterKey": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthunauthenticatedUserRole91ACCEF4Ref", + "ParameterValue": "amplify-storelocator-ge-amplifyAuthunauthenticate-lXWiZUp3FtNM" + }, + { + "ParameterKey": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthauthenticatedUserRoleE47B81E2Ref", + "ParameterValue": "amplify-storelocator-ge-amplifyAuthauthenticatedU-9OqjoXZMGmQf" + }, + { + "ParameterKey": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef", + "ParameterValue": "amplify-storelocator-ge-amplifyAuthstoreLocatorAd-o18wwJFGuDoS" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorMap6A22ACC1-8ERJEQ7R4WPN.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorMap6A22ACC1-8ERJEQ7R4WPN.template.json new file mode 100644 index 00000000000..ebf1268cc9a --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorMap6A22ACC1-8ERJEQ7R4WPN.template.json @@ -0,0 +1,610 @@ +{ + "Description": "{\"createdOn\":\"Linux\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.21.1\",\"stackType\":\"custom\",\"metadata\":{}}", + "Mappings": { + "storeLocatorMapRegionMapping7E708396": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Resources": { + "storeLocatorMapCustomMapLambdaServiceRole4EE7732C2405A734": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorMap/storeLocatorMap/CustomMapLambdaServiceRole4EE7732C" + } + }, + "storeLocatorMapCustomMapLambdaServiceRoleDefaultPolicy983FDD4ECEADC647": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreateMap", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdateMap", + "geo:DeleteMap" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:geo:", + { + "Fn::FindInMap": [ + "storeLocatorMapRegionMapping7E708396", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":map/storeLocatorMap-gen2-main" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E", + "Roles": [ + { + "Ref": "storeLocatorMapCustomMapLambdaServiceRole4EE7732C2405A734" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorMap/storeLocatorMap/CustomMapLambdaServiceRoleDefaultPolicy983FDD4E" + } + }, + "storeLocatorMapCustomMapLambda51D5D43019B4B7E6": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst { LocationClient, CreateMapCommand, DeleteMapCommand, UpdateMapCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n Configuration: {\n Style: event.ResourceProperties.mapStyle,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateMapCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Update') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateMapCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Delete') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteMapCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.mapName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "storeLocatorMapCustomMapLambdaServiceRole4EE7732C2405A734", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ], + "Timeout": 300 + }, + "DependsOn": [ + "storeLocatorMapCustomMapLambdaServiceRole4EE7732C2405A734", + "storeLocatorMapCustomMapLambdaServiceRoleDefaultPolicy983FDD4ECEADC647" + ], + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorMap/storeLocatorMap/CustomMapLambda51D5D430" + } + }, + "storeLocatorMapCustomMap3D69EC7C": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "storeLocatorMapCustomMapLambda51D5D43019B4B7E6", + "Arn" + ] + }, + "mapName": "storeLocatorMap-gen2-main", + "mapStyle": "VectorEsriStreets", + "region": { + "Fn::FindInMap": [ + "storeLocatorMapRegionMapping7E708396", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": "gen2-main" + }, + "DeletionPolicy": "Delete", + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorMap/storeLocatorMap/CustomMap" + } + }, + "storeLocatorMapMapPolicy388540F3": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:GetMapStyleDescriptor", + "geo:GetMapGlyphs", + "geo:GetMapSprites", + "geo:GetMapTile" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "storeLocatorMapCustomMap3D69EC7C", + "MapArn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "storeLocatorMap-gen2-mainPolicy", + "Roles": [ + { + "Ref": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthauthenticatedUserRoleE47B81E2Ref" + }, + { + "Ref": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthunauthenticatedUserRole91ACCEF4Ref" + }, + { + "Ref": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorMap/storeLocatorMap/MapPolicy" + } + }, + "CDKMetadata": { + "Type": "AWS::CDK::Metadata", + "Properties": { + "Analytics": "v2:deflate64:H4sIAAAAAAAA/yXLTQ6DIBBA4bO4x6klLron6a4/sQdoRsBmFAYiUNMY797Yrt7iy5Mg2xaaCpdUazPVjnpYrzZlax4Z9STUwBeMkfglcEnPldDDqgbugrM73oMj/dmEQ98bBDXwubDOFHjbWZWUg+9sCmXWv+FWcix5ExyMhTEd3lLC8QRNNSaiei6cyVvo/v0C08sIKp8AAAA=" + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorMap/CDKMetadata/Default" + }, + "Condition": "CDKMetadataAvailable" + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorMapCustomMap3D69EC7C", + "MapName" + ] + } + }, + "Style": { + "Value": "VectorEsriStreets" + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "storeLocatorMapRegionMapping7E708396", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorMapCustomMap3D69EC7C", + "MapArn" + ] + } + }, + "amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorMapCustomMap41EB8E23MapName": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorMapCustomMap3D69EC7C", + "MapName" + ] + } + } + }, + "Conditions": { + "CDKMetadataAvailable": { + "Fn::Or": [ + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "af-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-3" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-4" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-northwest-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-2" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "il-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "sa-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-1" + ] + } + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-2" + ] + } + ] + } + }, + "Parameters": { + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthauthenticatedUserRoleE47B81E2Ref": { + "Type": "String" + }, + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthunauthenticatedUserRole91ACCEF4Ref": { + "Type": "String" + }, + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef": { + "Type": "String" + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorSearch516CF59F-10BDIX52ZDQV2.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorSearch516CF59F-10BDIX52ZDQV2.description.txt new file mode 100644 index 00000000000..1e3215c63d9 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorSearch516CF59F-10BDIX52ZDQV2.description.txt @@ -0,0 +1 @@ +{"createdOn":"Linux","createdBy":"AmplifyPipelineDeploy","createdWith":"1.21.1","stackType":"custom","metadata":{}} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorSearch516CF59F-10BDIX52ZDQV2.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorSearch516CF59F-10BDIX52ZDQV2.outputs.json new file mode 100644 index 00000000000..03e129e8fd3 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorSearch516CF59F-10BDIX52ZDQV2.outputs.json @@ -0,0 +1,18 @@ +[ + { + "OutputKey": "Region", + "OutputValue": "us-east-1" + }, + { + "OutputKey": "Arn", + "OutputValue": "arn:aws:geo:us-east-1:123456789012:place-index/storeLocatorSearch-gen2-main" + }, + { + "OutputKey": "amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorSearchCustomPlaceIndexAEDF2721IndexName", + "OutputValue": "storeLocatorSearch-gen2-main" + }, + { + "OutputKey": "Name", + "OutputValue": "storeLocatorSearch-gen2-main" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorSearch516CF59F-10BDIX52ZDQV2.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorSearch516CF59F-10BDIX52ZDQV2.parameters.json new file mode 100644 index 00000000000..8e6d6f64984 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorSearch516CF59F-10BDIX52ZDQV2.parameters.json @@ -0,0 +1,14 @@ +[ + { + "ParameterKey": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthunauthenticatedUserRole91ACCEF4Ref", + "ParameterValue": "amplify-storelocator-ge-amplifyAuthunauthenticate-lXWiZUp3FtNM" + }, + { + "ParameterKey": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthauthenticatedUserRoleE47B81E2Ref", + "ParameterValue": "amplify-storelocator-ge-amplifyAuthauthenticatedU-9OqjoXZMGmQf" + }, + { + "ParameterKey": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef", + "ParameterValue": "amplify-storelocator-ge-amplifyAuthstoreLocatorAd-o18wwJFGuDoS" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorSearch516CF59F-10BDIX52ZDQV2.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorSearch516CF59F-10BDIX52ZDQV2.template.json new file mode 100644 index 00000000000..60985dad427 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c-geostoreLocatorSearch516CF59F-10BDIX52ZDQV2.template.json @@ -0,0 +1,608 @@ +{ + "Description": "{\"createdOn\":\"Linux\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.21.1\",\"stackType\":\"custom\",\"metadata\":{}}", + "Mappings": { + "storeLocatorSearchRegionMappingA7DF4548": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Resources": { + "storeLocatorSearchCustomPlaceIndexLambdaServiceRoleFD2F3C9D9AAF5F9F": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorSearch/storeLocatorSearch/CustomPlaceIndexLambdaServiceRoleFD2F3C9D" + } + }, + "storeLocatorSearchCustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B11998631C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreatePlaceIndex", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdatePlaceIndex", + "geo:DeletePlaceIndex" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:geo:", + { + "Fn::FindInMap": [ + "storeLocatorSearchRegionMappingA7DF4548", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":place-index/storeLocatorSearch-gen2-main" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1", + "Roles": [ + { + "Ref": "storeLocatorSearchCustomPlaceIndexLambdaServiceRoleFD2F3C9D9AAF5F9F" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorSearch/storeLocatorSearch/CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1" + } + }, + "storeLocatorSearchCustomPlaceIndexLambda79813BB9A2F450FE": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst { LocationClient, CreatePlaceIndexCommand, DeletePlaceIndexCommand, UpdatePlaceIndexCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSource: event.ResourceProperties.dataSource,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreatePlaceIndexCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdatePlaceIndexCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeletePlaceIndexCommand(params));\n event.PhysicalResourceId = event.ResourceProperties.indexName;\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.indexName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "storeLocatorSearchCustomPlaceIndexLambdaServiceRoleFD2F3C9D9AAF5F9F", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ], + "Timeout": 300 + }, + "DependsOn": [ + "storeLocatorSearchCustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B11998631C", + "storeLocatorSearchCustomPlaceIndexLambdaServiceRoleFD2F3C9D9AAF5F9F" + ], + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorSearch/storeLocatorSearch/CustomPlaceIndexLambda79813BB9" + } + }, + "storeLocatorSearchCustomPlaceIndexF0192882": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "storeLocatorSearchCustomPlaceIndexLambda79813BB9A2F450FE", + "Arn" + ] + }, + "indexName": "storeLocatorSearch-gen2-main", + "dataSource": "Here", + "dataSourceIntendedUse": "SingleUse", + "region": { + "Fn::FindInMap": [ + "storeLocatorSearchRegionMappingA7DF4548", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": "gen2-main" + }, + "DeletionPolicy": "Delete", + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorSearch/storeLocatorSearch/CustomPlaceIndex" + } + }, + "storeLocatorSearchPlaceIndexPolicy9E8EFC93": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:SearchPlaceIndexForPosition", + "geo:SearchPlaceIndexForText", + "geo:SearchPlaceIndexForSuggestions", + "geo:GetPlace" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "storeLocatorSearchCustomPlaceIndexF0192882", + "IndexArn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "storeLocatorSearch-gen2-mainPolicy", + "Roles": [ + { + "Ref": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthauthenticatedUserRoleE47B81E2Ref" + }, + { + "Ref": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthunauthenticatedUserRole91ACCEF4Ref" + }, + { + "Ref": "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorSearch/storeLocatorSearch/PlaceIndexPolicy" + } + }, + "CDKMetadata": { + "Type": "AWS::CDK::Metadata", + "Properties": { + "Analytics": "v2:deflate64:H4sIAAAAAAAA/yXLTQ6DIBBA4bO4x6klLron6a4/sQdoRsBmFAYiUNMY797Yrt7iy5Mg2xaaCpdUazPVjnpYrzZlax4Z9STUwBeMkfglcEnPldDDqgbugrM73oMj/dmEQ98bBDXwubDOFHjbWZWUg+9sCmXWv+FWcix5ExyMhTEd3lLC8QRNNSaiei6cyVvo/v0C08sIKp8AAAA=" + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorSearch/CDKMetadata/Default" + }, + "Condition": "CDKMetadataAvailable" + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorSearchCustomPlaceIndexF0192882", + "IndexName" + ] + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "storeLocatorSearchRegionMappingA7DF4548", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorSearchCustomPlaceIndexF0192882", + "IndexArn" + ] + } + }, + "amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorSearchCustomPlaceIndexAEDF2721IndexName": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorSearchCustomPlaceIndexF0192882", + "IndexName" + ] + } + } + }, + "Conditions": { + "CDKMetadataAvailable": { + "Fn::Or": [ + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "af-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-3" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-4" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-northwest-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-2" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "il-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "sa-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-1" + ] + } + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-2" + ] + } + ] + } + }, + "Parameters": { + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthauthenticatedUserRoleE47B81E2Ref": { + "Type": "String" + }, + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthunauthenticatedUserRole91ACCEF4Ref": { + "Type": "String" + }, + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef": { + "Type": "String" + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c.description.txt new file mode 100644 index 00000000000..afc6ec23957 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c.description.txt @@ -0,0 +1 @@ +{"createdOn":"Linux","createdBy":"AmplifyPipelineDeploy","createdWith":"1.21.1","stackType":"root","metadata":{}} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c.outputs.json new file mode 100644 index 00000000000..d6f6c8d2aff --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c.outputs.json @@ -0,0 +1,102 @@ +[ + { + "OutputKey": "webClientId", + "OutputValue": "1t7et22n9m68741vh3pmv2nmfq" + }, + { + "OutputKey": "socialProviders", + "OutputValue": "" + }, + { + "OutputKey": "usernameAttributes", + "OutputValue": "[\"email\"]" + }, + { + "OutputKey": "signupAttributes", + "OutputValue": "[\"email\"]" + }, + { + "OutputKey": "oauthClientId", + "OutputValue": "1t7et22n9m68741vh3pmv2nmfq" + }, + { + "OutputKey": "allowUnauthenticatedIdentities", + "OutputValue": "true" + }, + { + "OutputKey": "oauthCognitoDomain", + "OutputValue": "" + }, + { + "OutputKey": "oauthScope", + "OutputValue": "[\"profile\",\"phone\",\"email\",\"openid\",\"aws.cognito.signin.user.admin\"]" + }, + { + "OutputKey": "oauthRedirectSignOut", + "OutputValue": "" + }, + { + "OutputKey": "mfaTypes", + "OutputValue": "[]" + }, + { + "OutputKey": "mfaConfiguration", + "OutputValue": "OFF" + }, + { + "OutputKey": "oauthResponseType", + "OutputValue": "code" + }, + { + "OutputKey": "customOutputs", + "OutputValue": "{\"geo\":{\"aws_region\":\"us-east-1\",\"maps\":{\"items\":{\"storeLocatorMap-gen2-main\":{\"style\":\"VectorEsriStreets\"}},\"default\":\"storeLocatorMap-gen2-main\"},\"search_indices\":{\"items\":[\"storeLocatorSearch-gen2-main\"],\"default\":\"storeLocatorSearch-gen2-main\"},\"geofence_collections\":{\"items\":[\"storeLocatorGeofence-gen2-main\"],\"default\":\"storeLocatorGeofence-gen2-main\"}},\"version\":\"1.4\"}" + }, + { + "OutputKey": "oauthRedirectSignIn", + "OutputValue": "https://example.com" + }, + { + "OutputKey": "passwordPolicyMinLength", + "OutputValue": "8" + }, + { + "OutputKey": "authRegion", + "OutputValue": "us-east-1" + }, + { + "OutputKey": "groups", + "OutputValue": "[{\"storeLocatorAdmin\":{\"precedence\":0}}]" + }, + { + "OutputKey": "definedFunctions", + "OutputValue": "[\"storelocator41a9495f41a9495fPostConfirmation-gen2-main\"]" + }, + { + "OutputKey": "passwordlessOptions", + "OutputValue": "" + }, + { + "OutputKey": "deploymentType", + "OutputValue": "branch" + }, + { + "OutputKey": "passwordPolicyRequirements", + "OutputValue": "[]" + }, + { + "OutputKey": "region", + "OutputValue": "us-east-1" + }, + { + "OutputKey": "userPoolId", + "OutputValue": "us-east-1_AeAJNVPgB" + }, + { + "OutputKey": "identityPoolId", + "OutputValue": "us-east-1:cbd1c99c-bad6-4aff-8d75-a63d582714ee" + }, + { + "OutputKey": "verificationMechanisms", + "OutputValue": "[\"email\"]" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c.parameters.json new file mode 100644 index 00000000000..74596fb6f32 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c.parameters.json @@ -0,0 +1,7 @@ +[ + { + "ParameterKey": "BootstrapVersion", + "ParameterValue": "/cdk-bootstrap/hnb659fds/version", + "ResolvedValue": "30" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c.template.json new file mode 100644 index 00000000000..7b7b114bb42 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-gen2main-branch-62d6167d4c.template.json @@ -0,0 +1,1163 @@ +{ + "Description": "{\"createdOn\":\"Linux\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"1.21.1\",\"stackType\":\"root\",\"metadata\":{}}", + "Metadata": { + "AWS::Amplify::Platform": { + "version": "1", + "stackOutputs": [ + "deploymentType", + "region" + ] + }, + "AWS::Amplify::Auth": { + "version": "1", + "stackOutputs": [ + "userPoolId", + "webClientId", + "identityPoolId", + "authRegion", + "allowUnauthenticatedIdentities", + "signupAttributes", + "usernameAttributes", + "verificationMechanisms", + "passwordPolicyMinLength", + "passwordPolicyRequirements", + "mfaConfiguration", + "mfaTypes", + "passwordlessOptions", + "socialProviders", + "oauthCognitoDomain", + "oauthScope", + "oauthRedirectSignIn", + "oauthRedirectSignOut", + "oauthResponseType", + "oauthClientId", + "groups" + ] + }, + "AWS::Amplify::Function": { + "version": "1", + "stackOutputs": [ + "definedFunctions" + ] + }, + "AWS::Amplify::Custom": { + "version": "1", + "stackOutputs": [ + "customOutputs" + ] + } + }, + "Outputs": { + "deploymentType": { + "Value": "branch" + }, + "region": { + "Value": { + "Ref": "AWS::Region" + } + }, + "userPoolId": { + "Value": { + "Fn::GetAtt": [ + "auth179371D7", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthUserPoolE0F0BF85Ref" + ] + } + }, + "webClientId": { + "Value": { + "Fn::GetAtt": [ + "auth179371D7", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthUserPoolAppClientA8D9B6FBRef" + ] + } + }, + "identityPoolId": { + "Value": { + "Fn::GetAtt": [ + "auth179371D7", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthIdentityPool537188CARef" + ] + } + }, + "authRegion": { + "Value": { + "Ref": "AWS::Region" + } + }, + "allowUnauthenticatedIdentities": { + "Value": "true" + }, + "signupAttributes": { + "Value": "[\"email\"]" + }, + "usernameAttributes": { + "Value": "[\"email\"]" + }, + "verificationMechanisms": { + "Value": "[\"email\"]" + }, + "passwordPolicyMinLength": { + "Value": "8" + }, + "passwordPolicyRequirements": { + "Value": "[]" + }, + "mfaConfiguration": { + "Value": "OFF" + }, + "mfaTypes": { + "Value": "[]" + }, + "passwordlessOptions": { + "Value": "" + }, + "socialProviders": { + "Value": "" + }, + "oauthCognitoDomain": { + "Value": "" + }, + "oauthScope": { + "Value": "[\"profile\",\"phone\",\"email\",\"openid\",\"aws.cognito.signin.user.admin\"]" + }, + "oauthRedirectSignIn": { + "Value": "https://example.com" + }, + "oauthRedirectSignOut": { + "Value": "" + }, + "oauthResponseType": { + "Value": "code" + }, + "oauthClientId": { + "Value": { + "Fn::GetAtt": [ + "auth179371D7", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthUserPoolAppClientA8D9B6FBRef" + ] + } + }, + "groups": { + "Value": "[{\"storeLocatorAdmin\":{\"precedence\":0}}]" + }, + "definedFunctions": { + "Value": { + "Fn::Join": [ + "", + [ + "[\"", + { + "Fn::GetAtt": [ + "auth179371D7", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cauthstorelocator41a9495f41a9495fPostConfirmationgen2mainlambda5D769661Ref" + ] + }, + "\"]" + ] + ] + } + }, + "customOutputs": { + "Value": { + "Fn::Join": [ + "", + [ + "{\"geo\":{\"aws_region\":\"", + { + "Fn::FindInMap": [ + "MappingCopyRegionMappingc899bf01def5cbc849691ab5f6733a851ecaaf8d34", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "\",\"maps\":{\"items\":{\"", + { + "Fn::GetAtt": [ + "geostoreLocatorMap6A22ACC1", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorMapCustomMap41EB8E23MapName" + ] + }, + "\":{\"style\":\"VectorEsriStreets\"}},\"default\":\"", + { + "Fn::GetAtt": [ + "geostoreLocatorMap6A22ACC1", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorMapCustomMap41EB8E23MapName" + ] + }, + "\"},\"search_indices\":{\"items\":[\"", + { + "Fn::GetAtt": [ + "geostoreLocatorSearch516CF59F", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorSearchCustomPlaceIndexAEDF2721IndexName" + ] + }, + "\"],\"default\":\"", + { + "Fn::GetAtt": [ + "geostoreLocatorSearch516CF59F", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorSearchCustomPlaceIndexAEDF2721IndexName" + ] + }, + "\"},\"geofence_collections\":{\"items\":[\"", + { + "Fn::GetAtt": [ + "geostoreLocatorGeofenceEAAC8D05", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorGeofenceCustomGeofenceCollectionF2914E55CollectionName" + ] + }, + "\"],\"default\":\"", + { + "Fn::GetAtt": [ + "geostoreLocatorGeofenceEAAC8D05", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorGeofenceCustomGeofenceCollectionF2914E55CollectionName" + ] + }, + "\"}},\"version\":\"1.4\"}" + ] + ] + } + } + }, + "Resources": { + "AmplifyBranchLinkerCustomResourceLambdaServiceRole3DDCBC03": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/AmplifyBranchLinker/CustomResourceLambda/ServiceRole/Resource" + } + }, + "AmplifyBranchLinkerCustomResourceLambdaServiceRoleDefaultPolicy86099CA1": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "amplify:GetBranch", + "amplify:UpdateBranch" + ], + "Effect": "Allow", + "Resource": "arn:aws:amplify:*:*:apps/storelocator/branches/gen2-main" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AmplifyBranchLinkerCustomResourceLambdaServiceRoleDefaultPolicy86099CA1", + "Roles": [ + { + "Ref": "AmplifyBranchLinkerCustomResourceLambdaServiceRole3DDCBC03" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/AmplifyBranchLinker/CustomResourceLambda/ServiceRole/DefaultPolicy/Resource" + } + }, + "AmplifyBranchLinkerCustomResourceLambda582AC093": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "59635e07adb5fb948b68e22ccd96205d87940fdcdfb7993bddf9639acde4f941.zip" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceLambdaServiceRole3DDCBC03", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ], + "Timeout": 10 + }, + "DependsOn": [ + "AmplifyBranchLinkerCustomResourceLambdaServiceRoleDefaultPolicy86099CA1", + "AmplifyBranchLinkerCustomResourceLambdaServiceRole3DDCBC03" + ], + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/AmplifyBranchLinker/CustomResourceLambda/Resource", + "aws:asset:path": "asset.59635e07adb5fb948b68e22ccd96205d87940fdcdfb7993bddf9639acde4f941", + "aws:asset:is-bundled": true, + "aws:asset:property": "Code" + } + }, + "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRole92A035EB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/AmplifyBranchLinker/CustomResourceProvider/framework-onEvent/ServiceRole/Resource" + } + }, + "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRoleDefaultPolicy38AAE412": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceLambda582AC093", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceLambda582AC093", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:GetFunction", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceLambda582AC093", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRoleDefaultPolicy38AAE412", + "Roles": [ + { + "Ref": "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRole92A035EB" + } + ] + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/AmplifyBranchLinker/CustomResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource" + } + }, + "AmplifyBranchLinkerCustomResourceProviderframeworkonEvent3B23F900": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "07a90cc3efdfc34da22208dcd9d211f06f5b0e01b21e778edc7c3966b1f61d57.zip" + }, + "Description": "AWS CDK resource provider framework - onEvent (amplify-storelocator-gen2main-branch-62d6167d4c/AmplifyBranchLinker/CustomResourceProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceLambda582AC093", + "Arn" + ] + } + } + }, + "Handler": "framework.onEvent", + "LoggingConfig": { + "ApplicationLogLevel": "FATAL", + "LogFormat": "JSON" + }, + "Role": { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRole92A035EB", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ], + "Timeout": 900 + }, + "DependsOn": [ + "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRoleDefaultPolicy38AAE412", + "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRole92A035EB" + ], + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/AmplifyBranchLinker/CustomResourceProvider/framework-onEvent/Resource", + "aws:asset:path": "asset.07a90cc3efdfc34da22208dcd9d211f06f5b0e01b21e778edc7c3966b1f61d57", + "aws:asset:is-bundled": false, + "aws:asset:property": "Code" + } + }, + "AmplifyBranchLinkerCustomResource96E36FC1": { + "Type": "Custom::AmplifyBranchLinkerResource", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceProviderframeworkonEvent3B23F900", + "Arn" + ] + }, + "appId": "storelocator", + "branchName": "gen2-main" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete", + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/AmplifyBranchLinker/CustomResource/Default" + } + }, + "auth179371D7": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ], + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/f156fe04791fb3f78f6b0818c75bef22dc8486f70ba0ee1d8bb703e3740d5052.json" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete", + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/auth.NestedStack/auth.NestedStackResource", + "aws:asset:path": "amplifystorelocatorgen2mainbranch62d6167d4cauthBE445115.nested.template.json", + "aws:asset:property": "TemplateURL" + } + }, + "geostoreLocatorGeofenceEAAC8D05": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef": { + "Fn::GetAtt": [ + "auth179371D7", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef" + ] + } + }, + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ], + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/61b8b993a358f371215f7600a3c9ac3262c1ff852a651decd16e924e24648542.json" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete", + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorGeofence.NestedStack/geostoreLocatorGeofence.NestedStackResource", + "aws:asset:path": "amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorGeofenceC4B4AC70.nested.template.json", + "aws:asset:property": "TemplateURL" + } + }, + "geostoreLocatorMap6A22ACC1": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthauthenticatedUserRoleE47B81E2Ref": { + "Fn::GetAtt": [ + "auth179371D7", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthauthenticatedUserRoleE47B81E2Ref" + ] + }, + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthunauthenticatedUserRole91ACCEF4Ref": { + "Fn::GetAtt": [ + "auth179371D7", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthunauthenticatedUserRole91ACCEF4Ref" + ] + }, + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef": { + "Fn::GetAtt": [ + "auth179371D7", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef" + ] + } + }, + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ], + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/c61568e1890b3f3be2d76768068a5d7b209d6090eaae0ead003a6f15762d014e.json" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete", + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorMap.NestedStack/geostoreLocatorMap.NestedStackResource", + "aws:asset:path": "amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorMap6456EB66.nested.template.json", + "aws:asset:property": "TemplateURL" + } + }, + "geostoreLocatorSearch516CF59F": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthauthenticatedUserRoleE47B81E2Ref": { + "Fn::GetAtt": [ + "auth179371D7", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthauthenticatedUserRoleE47B81E2Ref" + ] + }, + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthunauthenticatedUserRole91ACCEF4Ref": { + "Fn::GetAtt": [ + "auth179371D7", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthunauthenticatedUserRole91ACCEF4Ref" + ] + }, + "referencetoamplifystorelocatorgen2mainbranch62d6167d4cauthNestedStackauthNestedStackResourceFD19A2FDOutputsamplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef": { + "Fn::GetAtt": [ + "auth179371D7", + "Outputs.amplifystorelocatorgen2mainbranch62d6167d4cauthamplifyAuthstoreLocatorAdminGroupRole237CDBFDRef" + ] + } + }, + "Tags": [ + { + "Key": "amplify:app-id", + "Value": "storelocator" + }, + { + "Key": "amplify:branch-name", + "Value": "gen2-main" + }, + { + "Key": "amplify:deployment-type", + "Value": "branch" + }, + { + "Key": "created-by", + "Value": "amplify" + } + ], + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/8e1b00219260034f32364589cca2ec984d63c5300abf158dd9451370a7b43411.json" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete", + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/geostoreLocatorSearch.NestedStack/geostoreLocatorSearch.NestedStackResource", + "aws:asset:path": "amplifystorelocatorgen2mainbranch62d6167d4cgeostoreLocatorSearchE6091B13.nested.template.json", + "aws:asset:property": "TemplateURL" + } + }, + "CDKMetadata": { + "Type": "AWS::CDK::Metadata", + "Properties": { + "Analytics": "v2:deflate64:H4sIAAAAAAAA/02PzWrDQAyEnyV3WU2dHHJtDD22wXkAo6yVIP/slpU2oRi/e/C6LT19I4YZNCWW+z1uN/TQwrV9McgFp7OR66G6+s9kX8mAHtpMA42XlhofWu4UPzLek3cmwYPQiFMdBl5SmacwiPtezlXNoLuGVNkU3xaA7vCYXM92JGVY63Gqrv6v9VfMM+TI2egm/gYuqYWxiawhRceKpxju0nKEKjv1j5Gf+afzrhmWCdjpy70s8fWA202nIkVM3mRkrFc+AXlCmgwZAQAA" + }, + "Metadata": { + "aws:cdk:path": "amplify-storelocator-gen2main-branch-62d6167d4c/CDKMetadata/Default" + }, + "Condition": "CDKMetadataAvailable" + } + }, + "Conditions": { + "CDKMetadataAvailable": { + "Fn::Or": [ + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "af-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-3" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-4" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-northwest-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-2" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "il-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "sa-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-1" + ] + } + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-2" + ] + } + ] + } + }, + "Mappings": { + "MappingCopyRegionMappingc899bf01def5cbc849691ab5f6733a851ecaaf8d34": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-AuthTriggerCustomLambdaStack-SCPJHG15CQN7.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-AuthTriggerCustomLambdaStack-SCPJHG15CQN7.description.txt new file mode 100644 index 00000000000..667d8b27f42 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-AuthTriggerCustomLambdaStack-SCPJHG15CQN7.description.txt @@ -0,0 +1 @@ +Custom Resource stack for Auth Trigger created using Amplify CLI \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-AuthTriggerCustomLambdaStack-SCPJHG15CQN7.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-AuthTriggerCustomLambdaStack-SCPJHG15CQN7.outputs.json new file mode 100644 index 00000000000..0637a088a01 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-AuthTriggerCustomLambdaStack-SCPJHG15CQN7.outputs.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-AuthTriggerCustomLambdaStack-SCPJHG15CQN7.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-AuthTriggerCustomLambdaStack-SCPJHG15CQN7.parameters.json new file mode 100644 index 00000000000..36ae928387f --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-AuthTriggerCustomLambdaStack-SCPJHG15CQN7.parameters.json @@ -0,0 +1,26 @@ +[ + { + "ParameterKey": "userpoolId", + "ParameterValue": "us-east-1_R1pdziFVe" + }, + { + "ParameterKey": "functionstorelocator41a9495f41a9495fPostConfirmationLambdaExecutionRole", + "ParameterValue": "arn:aws:iam::123456789012:role/storelocator41a9495f41a9495fPostConfirmation-main" + }, + { + "ParameterKey": "functionstorelocator41a9495f41a9495fPostConfirmationArn", + "ParameterValue": "arn:aws:lambda:us-east-1:123456789012:function:storelocator41a9495f41a9495fPostConfirmation-main" + }, + { + "ParameterKey": "env", + "ParameterValue": "main" + }, + { + "ParameterKey": "userpoolArn", + "ParameterValue": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_R1pdziFVe" + }, + { + "ParameterKey": "functionstorelocator41a9495f41a9495fPostConfirmationName", + "ParameterValue": "storelocator41a9495f41a9495fPostConfirmation-main" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-AuthTriggerCustomLambdaStack-SCPJHG15CQN7.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-AuthTriggerCustomLambdaStack-SCPJHG15CQN7.template.json new file mode 100644 index 00000000000..722ceef6ad7 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-AuthTriggerCustomLambdaStack-SCPJHG15CQN7.template.json @@ -0,0 +1,204 @@ +{ + "Description": "Custom Resource stack for Auth Trigger created using Amplify CLI", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "userpoolId": { + "Type": "String" + }, + "userpoolArn": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationLambdaExecutionRole": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "UserPoolPostConfirmationLambdaInvokePermission": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "functionstorelocator41a9495f41a9495fPostConfirmationName" + }, + "Principal": "cognito-idp.amazonaws.com", + "SourceArn": { + "Ref": "userpoolArn" + } + } + }, + "Amplifyfunctionstorelocator41a9495f41a9495fPostConfirmationNamePostConfirmationAddToGroupCognitoC0815C8F": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "cognito-idp:AdminAddUserToGroup", + "cognito-idp:GetGroup", + "cognito-idp:CreateGroup" + ], + "Effect": "Allow", + "Resource": { + "Ref": "userpoolArn" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AddToGroupCognito", + "Roles": [ + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "functionstorelocator41a9495f41a9495fPostConfirmationLambdaExecutionRole" + } + ] + } + ] + } + ] + } + ] + } + ] + } + }, + "authTriggerFnServiceRole08093B67": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "authTriggerFnServiceRoleDefaultPolicyEC9285A8": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "cognito-idp:DescribeUserPool", + "cognito-idp:UpdateUserPool" + ], + "Effect": "Allow", + "Resource": { + "Ref": "userpoolArn" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "authTriggerFnServiceRoleDefaultPolicyEC9285A8", + "Roles": [ + { + "Ref": "authTriggerFnServiceRole08093B67" + } + ] + } + }, + "authTriggerFn7FCFA449": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst {\n CognitoIdentityProviderClient,\n DescribeUserPoolCommand,\n UpdateUserPoolCommand,\n} = require('@aws-sdk/client-cognito-identity-provider');\n\nexports.handler = (event, context) => {\n // Don't return promise, response.send() marks context as done internally\n void tryHandleEvent(event, context);\n};\n\nasync function tryHandleEvent(event, context) {\n const physicalResourceId =\n event.RequestType === 'Update' ? event.PhysicalResourceId : `${event.LogicalResourceId}-${event.ResourceProperties.userpoolId}`;\n try {\n await handleEvent(event);\n response.send(event, context, response.SUCCESS, {}, physicalResourceId);\n } catch (err) {\n console.log(err.stack);\n response.send(event, context, response.FAILED, { err }, physicalResourceId);\n }\n}\n\nasync function handleEvent(event) {\n const userPoolId = event.ResourceProperties.userpoolId;\n const { lambdaConfig } = event.ResourceProperties;\n const config = {};\n const cognitoClient = new CognitoIdentityProviderClient({});\n const userPoolConfig = await cognitoClient.send(new DescribeUserPoolCommand({ UserPoolId: userPoolId }));\n const userPoolParams = userPoolConfig.UserPool;\n // update userPool params\n\n const updateUserPoolConfig = {\n UserPoolId: userPoolParams.Id,\n Policies: userPoolParams.Policies,\n SmsVerificationMessage: userPoolParams.SmsVerificationMessage,\n AccountRecoverySetting: userPoolParams.AccountRecoverySetting,\n AdminCreateUserConfig: userPoolParams.AdminCreateUserConfig,\n AutoVerifiedAttributes: userPoolParams.AutoVerifiedAttributes,\n EmailConfiguration: userPoolParams.EmailConfiguration,\n EmailVerificationMessage: userPoolParams.EmailVerificationMessage,\n EmailVerificationSubject: userPoolParams.EmailVerificationSubject,\n VerificationMessageTemplate: userPoolParams.VerificationMessageTemplate,\n SmsAuthenticationMessage: userPoolParams.SmsAuthenticationMessage,\n MfaConfiguration: userPoolParams.MfaConfiguration,\n DeviceConfiguration: userPoolParams.DeviceConfiguration,\n SmsConfiguration: userPoolParams.SmsConfiguration,\n UserPoolTags: userPoolParams.UserPoolTags,\n UserPoolAddOns: userPoolParams.UserPoolAddOns,\n };\n\n // removing undefined keys\n Object.keys(updateUserPoolConfig).forEach((key) => updateUserPoolConfig[key] === undefined && delete updateUserPoolConfig[key]);\n\n /* removing UnusedAccountValidityDays as deprecated\n InvalidParameterException: Please use TemporaryPasswordValidityDays in PasswordPolicy instead of UnusedAccountValidityDays\n */\n if (updateUserPoolConfig.AdminCreateUserConfig && updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays) {\n delete updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays;\n }\n lambdaConfig.forEach((lambda) => (config[`${lambda.triggerType}`] = lambda.lambdaFunctionArn));\n if (event.RequestType === 'Delete') {\n updateUserPoolConfig.LambdaConfig = {};\n console.log(`${event.RequestType}:`, JSON.stringify(updateUserPoolConfig));\n const result = await cognitoClient.send(new UpdateUserPoolCommand(updateUserPoolConfig));\n console.log(`delete response data ${JSON.stringify(result)}`);\n } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {\n updateUserPoolConfig.LambdaConfig = config;\n const result = await cognitoClient.send(new UpdateUserPoolCommand(updateUserPoolConfig));\n console.log(`createOrUpdate response data ${JSON.stringify(result)}`);\n }\n}\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "authTriggerFnServiceRole08093B67", + "Arn" + ] + }, + "Runtime": "nodejs22.x" + }, + "DependsOn": [ + "authTriggerFnServiceRoleDefaultPolicyEC9285A8", + "authTriggerFnServiceRole08093B67" + ] + }, + "CustomAuthTriggerResource": { + "Type": "Custom::CustomAuthTriggerResourceOutputs", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "authTriggerFn7FCFA449", + "Arn" + ] + }, + "userpoolId": { + "Ref": "userpoolId" + }, + "lambdaConfig": [ + { + "triggerType": "PostConfirmation", + "lambdaFunctionName": "storelocator41a9495f41a9495fPostConfirmation", + "lambdaFunctionArn": { + "Ref": "functionstorelocator41a9495f41a9495fPostConfirmationArn" + } + } + ], + "nonce": "d121e6b9-f4d9-415d-a210-c1fc421ab66f" + }, + "DependsOn": [ + "authTriggerFn7FCFA449", + "authTriggerFnServiceRoleDefaultPolicyEC9285A8", + "authTriggerFnServiceRole08093B67" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authstorelocator41a9495f41a9495f-1LQSABXDYQIJW.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authstorelocator41a9495f41a9495f-1LQSABXDYQIJW.description.txt new file mode 100644 index 00000000000..28ba956271c --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authstorelocator41a9495f41a9495f-1LQSABXDYQIJW.description.txt @@ -0,0 +1 @@ +{"createdOn":"Mac","createdBy":"Amplify","createdWith":"14.2.5","stackType":"auth-Cognito","metadata":{"whyContinueWithGen1":"Prefer not to answer"}} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authstorelocator41a9495f41a9495f-1LQSABXDYQIJW.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authstorelocator41a9495f41a9495f-1LQSABXDYQIJW.outputs.json new file mode 100644 index 00000000000..d2f187e468e --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authstorelocator41a9495f41a9495f-1LQSABXDYQIJW.outputs.json @@ -0,0 +1,35 @@ +[ + { + "OutputKey": "UserPoolId", + "OutputValue": "us-east-1_R1pdziFVe", + "Description": "Id for the user pool" + }, + { + "OutputKey": "AppClientIDWeb", + "OutputValue": "6am6ldh23n8ke819nuvk51cddq", + "Description": "The user pool app client id for web" + }, + { + "OutputKey": "AppClientID", + "OutputValue": "5ppvpdo9dmkrj55qi8h865lt34", + "Description": "The user pool app client id" + }, + { + "OutputKey": "IdentityPoolId", + "OutputValue": "us-east-1:4ea514e6-bc16-4990-a5ea-cefe84c3050d", + "Description": "Id for the identity pool" + }, + { + "OutputKey": "UserPoolArn", + "OutputValue": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_R1pdziFVe", + "Description": "Arn for the user pool" + }, + { + "OutputKey": "IdentityPoolName", + "OutputValue": "storelocator41a9495f_identitypool_41a9495f__main" + }, + { + "OutputKey": "UserPoolName", + "OutputValue": "storelocator41a9495f_userpool_41a9495f" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authstorelocator41a9495f41a9495f-1LQSABXDYQIJW.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authstorelocator41a9495f41a9495f-1LQSABXDYQIJW.parameters.json new file mode 100644 index 00000000000..d52f69d2a99 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authstorelocator41a9495f41a9495f-1LQSABXDYQIJW.parameters.json @@ -0,0 +1,182 @@ +[ + { + "ParameterKey": "usernameAttributes", + "ParameterValue": "email" + }, + { + "ParameterKey": "authRoleArn", + "ParameterValue": "arn:aws:iam::123456789012:role/amplify-storelocator-main-f9ca7-authRole" + }, + { + "ParameterKey": "autoVerifiedAttributes", + "ParameterValue": "email" + }, + { + "ParameterKey": "allowUnauthenticatedIdentities", + "ParameterValue": "true" + }, + { + "ParameterKey": "hostedUI", + "ParameterValue": "false" + }, + { + "ParameterKey": "smsVerificationMessage", + "ParameterValue": "Your verification code is {####}" + }, + { + "ParameterKey": "userpoolClientReadAttributes", + "ParameterValue": "email" + }, + { + "ParameterKey": "breakCircularDependency", + "ParameterValue": "true" + }, + { + "ParameterKey": "mfaTypes", + "ParameterValue": "SMS Text Message" + }, + { + "ParameterKey": "emailVerificationSubject", + "ParameterValue": "Your verification code" + }, + { + "ParameterKey": "sharedId", + "ParameterValue": "41a9495f" + }, + { + "ParameterKey": "useDefault", + "ParameterValue": "manual" + }, + { + "ParameterKey": "userpoolClientGenerateSecret", + "ParameterValue": "false" + }, + { + "ParameterKey": "mfaConfiguration", + "ParameterValue": "OFF" + }, + { + "ParameterKey": "identityPoolName", + "ParameterValue": "storelocator41a9495f_identitypool_41a9495f" + }, + { + "ParameterKey": "thirdPartyAuth", + "ParameterValue": "false" + }, + { + "ParameterKey": "userPoolGroupList", + "ParameterValue": "storeLocatorAdmin" + }, + { + "ParameterKey": "authSelections", + "ParameterValue": "identityPoolAndUserPool" + }, + { + "ParameterKey": "adminQueries", + "ParameterValue": "false" + }, + { + "ParameterKey": "permissions", + "ParameterValue": "{\"policyName\":\"AddToGroupCognito\",\"trigger\":\"PostConfirmation\",\"effect\":\"Allow\",\"actions\":[\"cognito-idp:AdminAddUserToGroup\",\"cognito-idp:GetGroup\",\"cognito-idp:CreateGroup\"],\"resource\":{\"paramType\":\"!GetAtt\",\"keys\":[\"UserPool\",\"Arn\"]}}" + }, + { + "ParameterKey": "resourceNameTruncated", + "ParameterValue": "storel41a9495f" + }, + { + "ParameterKey": "userPoolGroups", + "ParameterValue": "true" + }, + { + "ParameterKey": "smsAuthenticationMessage", + "ParameterValue": "Your authentication code is {####}" + }, + { + "ParameterKey": "functionstorelocator41a9495f41a9495fPostConfirmationArn", + "ParameterValue": "functionstorelocator41a9495f41a9495fPostConfirmationArn" + }, + { + "ParameterKey": "functionstorelocator41a9495f41a9495fPostConfirmationName", + "ParameterValue": "functionstorelocator41a9495f41a9495fPostConfirmationName" + }, + { + "ParameterKey": "passwordPolicyMinLength", + "ParameterValue": "8" + }, + { + "ParameterKey": "userPoolName", + "ParameterValue": "storelocator41a9495f_userpool_41a9495f" + }, + { + "ParameterKey": "userpoolClientWriteAttributes", + "ParameterValue": "email" + }, + { + "ParameterKey": "dependsOn", + "ParameterValue": "[object Object]" + }, + { + "ParameterKey": "useEnabledMfas", + "ParameterValue": "true" + }, + { + "ParameterKey": "usernameCaseSensitive", + "ParameterValue": "false" + }, + { + "ParameterKey": "resourceName", + "ParameterValue": "storelocator41a9495f41a9495f" + }, + { + "ParameterKey": "env", + "ParameterValue": "main" + }, + { + "ParameterKey": "triggers", + "ParameterValue": "{\"PostConfirmation\":[\"add-to-group\"]}" + }, + { + "ParameterKey": "serviceName", + "ParameterValue": "Cognito" + }, + { + "ParameterKey": "emailVerificationMessage", + "ParameterValue": "Your verification code is {####}" + }, + { + "ParameterKey": "userpoolClientRefreshTokenValidity", + "ParameterValue": "100" + }, + { + "ParameterKey": "userpoolClientSetAttributes", + "ParameterValue": "false" + }, + { + "ParameterKey": "unauthRoleArn", + "ParameterValue": "arn:aws:iam::123456789012:role/amplify-storelocator-main-f9ca7-unauthRole" + }, + { + "ParameterKey": "requiredAttributes", + "ParameterValue": "email" + }, + { + "ParameterKey": "passwordPolicyCharacters", + "ParameterValue": "" + }, + { + "ParameterKey": "authTriggerConnections", + "ParameterValue": "{\"triggerType\":\"PostConfirmation\",\"lambdaFunctionName\":\"storelocator41a9495f41a9495fPostConfirmation\"}" + }, + { + "ParameterKey": "aliasAttributes", + "ParameterValue": "" + }, + { + "ParameterKey": "userpoolClientLambdaRole", + "ParameterValue": "storel41a9495f_userpoolclient_lambda_role" + }, + { + "ParameterKey": "defaultPasswordPolicy", + "ParameterValue": "false" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authstorelocator41a9495f41a9495f-1LQSABXDYQIJW.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authstorelocator41a9495f41a9495f-1LQSABXDYQIJW.template.json new file mode 100644 index 00000000000..32f0ad747e9 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authstorelocator41a9495f41a9495f-1LQSABXDYQIJW.template.json @@ -0,0 +1,486 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"auth-Cognito\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Type": "String", + "Default": "functionstorelocator41a9495f41a9495fPostConfirmationArn" + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Type": "String", + "Default": "functionstorelocator41a9495f41a9495fPostConfirmationName" + }, + "identityPoolName": { + "Type": "String" + }, + "allowUnauthenticatedIdentities": { + "Type": "String" + }, + "resourceNameTruncated": { + "Type": "String" + }, + "userPoolName": { + "Type": "String" + }, + "autoVerifiedAttributes": { + "Type": "CommaDelimitedList" + }, + "mfaConfiguration": { + "Type": "String" + }, + "mfaTypes": { + "Type": "CommaDelimitedList" + }, + "smsAuthenticationMessage": { + "Type": "String" + }, + "smsVerificationMessage": { + "Type": "String" + }, + "emailVerificationSubject": { + "Type": "String" + }, + "emailVerificationMessage": { + "Type": "String" + }, + "defaultPasswordPolicy": { + "Type": "String" + }, + "passwordPolicyMinLength": { + "Type": "String" + }, + "passwordPolicyCharacters": { + "Type": "CommaDelimitedList" + }, + "requiredAttributes": { + "Type": "CommaDelimitedList" + }, + "aliasAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientGenerateSecret": { + "Type": "String" + }, + "userpoolClientRefreshTokenValidity": { + "Type": "String" + }, + "userpoolClientWriteAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientReadAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientLambdaRole": { + "Type": "String" + }, + "userpoolClientSetAttributes": { + "Type": "String" + }, + "sharedId": { + "Type": "String" + }, + "resourceName": { + "Type": "String" + }, + "authSelections": { + "Type": "String" + }, + "useDefault": { + "Type": "String" + }, + "thirdPartyAuth": { + "Type": "String" + }, + "usernameAttributes": { + "Type": "CommaDelimitedList" + }, + "userPoolGroups": { + "Type": "String" + }, + "adminQueries": { + "Type": "String" + }, + "triggers": { + "Type": "String" + }, + "hostedUI": { + "Type": "String" + }, + "userPoolGroupList": { + "Type": "CommaDelimitedList" + }, + "serviceName": { + "Type": "String" + }, + "usernameCaseSensitive": { + "Type": "String" + }, + "useEnabledMfas": { + "Type": "String" + }, + "authRoleArn": { + "Type": "String" + }, + "unauthRoleArn": { + "Type": "String" + }, + "breakCircularDependency": { + "Type": "String" + }, + "dependsOn": { + "Type": "CommaDelimitedList" + }, + "permissions": { + "Type": "CommaDelimitedList" + }, + "authTriggerConnections": { + "Type": "CommaDelimitedList" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "UserPool": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AutoVerifiedAttributes": [ + "email" + ], + "EmailVerificationMessage": { + "Ref": "emailVerificationMessage" + }, + "EmailVerificationSubject": { + "Ref": "emailVerificationSubject" + }, + "MfaConfiguration": { + "Ref": "mfaConfiguration" + }, + "Policies": { + "PasswordPolicy": { + "MinimumLength": { + "Ref": "passwordPolicyMinLength" + }, + "RequireLowercase": false, + "RequireNumbers": false, + "RequireSymbols": false, + "RequireUppercase": false + } + }, + "Schema": [ + { + "Mutable": true, + "Name": "email", + "Required": true + } + ], + "UserAttributeUpdateSettings": { + "AttributesRequireVerificationBeforeUpdate": [ + "email" + ] + }, + "UserPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userPoolName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "userPoolName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "UsernameAttributes": { + "Ref": "usernameAttributes" + }, + "UsernameConfiguration": { + "CaseSensitive": false + } + } + }, + "UserPoolClientWeb": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "storel41a9495f_app_clientWeb", + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClient": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "storel41a9495f_app_client", + "GenerateSecret": { + "Ref": "userpoolClientGenerateSecret" + }, + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClientRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + }, + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userpoolClientLambdaRole" + }, + { + "Fn::Join": [ + "", + [ + "upClientLambdaRole41a9495f", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPool": { + "Type": "AWS::Cognito::IdentityPool", + "Properties": { + "AllowUnauthenticatedIdentities": { + "Ref": "allowUnauthenticatedIdentities" + }, + "CognitoIdentityProviders": [ + { + "ClientId": { + "Ref": "UserPoolClient" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + }, + { + "ClientId": { + "Ref": "UserPoolClientWeb" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + } + ], + "IdentityPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f_identitypool_41a9495f", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f_identitypool_41a9495f__", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPoolRoleMap": { + "Type": "AWS::Cognito::IdentityPoolRoleAttachment", + "Properties": { + "IdentityPoolId": { + "Ref": "IdentityPool" + }, + "RoleMappings": { + "UserPoolClientRoleMapping": { + "AmbiguousRoleResolution": "AuthenticatedRole", + "IdentityProvider": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${userPool}:${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "userPool": { + "Ref": "UserPool" + }, + "client": { + "Ref": "UserPoolClient" + } + } + ] + }, + "Type": "Token" + }, + "UserPoolWebClientRoleMapping": { + "AmbiguousRoleResolution": "AuthenticatedRole", + "IdentityProvider": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${userPool}:${webClient}", + { + "region": { + "Ref": "AWS::Region" + }, + "userPool": { + "Ref": "UserPool" + }, + "webClient": { + "Ref": "UserPoolClientWeb" + } + } + ] + }, + "Type": "Token" + } + }, + "Roles": { + "unauthenticated": { + "Ref": "unauthRoleArn" + }, + "authenticated": { + "Ref": "authRoleArn" + } + } + }, + "DependsOn": [ + "IdentityPool", + "UserPoolClient", + "UserPoolClientWeb" + ] + } + }, + "Outputs": { + "IdentityPoolId": { + "Description": "Id for the identity pool", + "Value": { + "Ref": "IdentityPool" + } + }, + "IdentityPoolName": { + "Value": { + "Fn::GetAtt": [ + "IdentityPool", + "Name" + ] + } + }, + "UserPoolId": { + "Description": "Id for the user pool", + "Value": { + "Ref": "UserPool" + } + }, + "UserPoolArn": { + "Description": "Arn for the user pool", + "Value": { + "Fn::GetAtt": [ + "UserPool", + "Arn" + ] + } + }, + "UserPoolName": { + "Value": { + "Ref": "userPoolName" + } + }, + "AppClientIDWeb": { + "Description": "The user pool app client id for web", + "Value": { + "Ref": "UserPoolClientWeb" + } + }, + "AppClientID": { + "Description": "The user pool app client id", + "Value": { + "Ref": "UserPoolClient" + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authuserPoolGroups-1G3B0P2B6Q0ZH.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authuserPoolGroups-1G3B0P2B6Q0ZH.description.txt new file mode 100644 index 00000000000..aa91c019d71 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authuserPoolGroups-1G3B0P2B6Q0ZH.description.txt @@ -0,0 +1 @@ +{"createdOn":"Mac","createdBy":"Amplify","createdWith":"14.2.5","stackType":"auth-Cognito-UserPool-Groups","metadata":{"whyContinueWithGen1":"Prefer not to answer"}} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authuserPoolGroups-1G3B0P2B6Q0ZH.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authuserPoolGroups-1G3B0P2B6Q0ZH.outputs.json new file mode 100644 index 00000000000..434cc24ea19 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authuserPoolGroups-1G3B0P2B6Q0ZH.outputs.json @@ -0,0 +1,6 @@ +[ + { + "OutputKey": "storeLocatorAdminGroupRole", + "OutputValue": "arn:aws:iam::123456789012:role/us-east-1_R1pdziFVe-storeLocatorAdminGroupRole" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authuserPoolGroups-1G3B0P2B6Q0ZH.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authuserPoolGroups-1G3B0P2B6Q0ZH.parameters.json new file mode 100644 index 00000000000..2e7645b29bc --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authuserPoolGroups-1G3B0P2B6Q0ZH.parameters.json @@ -0,0 +1,30 @@ +[ + { + "ParameterKey": "UnauthRoleArn", + "ParameterValue": "arn:aws:iam::123456789012:role/amplify-storelocator-main-f9ca7-unauthRole" + }, + { + "ParameterKey": "authstorelocator41a9495f41a9495fAppClientID", + "ParameterValue": "5ppvpdo9dmkrj55qi8h865lt34" + }, + { + "ParameterKey": "authstorelocator41a9495f41a9495fIdentityPoolId", + "ParameterValue": "us-east-1:4ea514e6-bc16-4990-a5ea-cefe84c3050d" + }, + { + "ParameterKey": "AuthRoleArn", + "ParameterValue": "arn:aws:iam::123456789012:role/amplify-storelocator-main-f9ca7-authRole" + }, + { + "ParameterKey": "env", + "ParameterValue": "main" + }, + { + "ParameterKey": "authstorelocator41a9495f41a9495fAppClientIDWeb", + "ParameterValue": "6am6ldh23n8ke819nuvk51cddq" + }, + { + "ParameterKey": "authstorelocator41a9495f41a9495fUserPoolId", + "ParameterValue": "us-east-1_R1pdziFVe" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authuserPoolGroups-1G3B0P2B6Q0ZH.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authuserPoolGroups-1G3B0P2B6Q0ZH.template.json new file mode 100644 index 00000000000..5edc3def07d --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-authuserPoolGroups-1G3B0P2B6Q0ZH.template.json @@ -0,0 +1,109 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"auth-Cognito-UserPool-Groups\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "AuthRoleArn": { + "Type": "String" + }, + "UnauthRoleArn": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "authstorelocator41a9495f41a9495fIdentityPoolId": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fIdentityPoolId" + }, + "authstorelocator41a9495f41a9495fAppClientID": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fAppClientID" + }, + "authstorelocator41a9495f41a9495fAppClientIDWeb": { + "Type": "String", + "Default": "authstorelocator41a9495f41a9495fAppClientIDWeb" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "storeLocatorAdminGroup": { + "Type": "AWS::Cognito::UserPoolGroup", + "Properties": { + "Description": "override success", + "GroupName": "storeLocatorAdmin", + "Precedence": 1, + "RoleArn": { + "Fn::GetAtt": [ + "storeLocatorAdminGroupRole", + "Arn" + ] + }, + "UserPoolId": { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + } + } + }, + "storeLocatorAdminGroupRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Allow", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity", + "Condition": { + "StringEquals": { + "cognito-identity.amazonaws.com:aud": { + "Ref": "authstorelocator41a9495f41a9495fIdentityPoolId" + } + }, + "ForAnyValue:StringLike": { + "cognito-identity.amazonaws.com:amr": "authenticated" + } + } + } + ] + }, + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "-storeLocatorAdminGroupRole" + ] + ] + } + } + } + }, + "Outputs": { + "storeLocatorAdminGroupRole": { + "Value": { + "Fn::GetAtt": [ + "storeLocatorAdminGroupRole", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-functionstorelocator41a9495f41a9495fPostConfirmation-1VPC441AZ14I6.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-functionstorelocator41a9495f41a9495fPostConfirmation-1VPC441AZ14I6.description.txt new file mode 100644 index 00000000000..445081e4df1 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-functionstorelocator41a9495f41a9495fPostConfirmation-1VPC441AZ14I6.description.txt @@ -0,0 +1 @@ +{"createdOn":"Mac","createdBy":"Amplify","createdWith":"14.2.5","stackType":"function-Lambda","metadata":{"whyContinueWithGen1":"Prefer not to answer"}} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-functionstorelocator41a9495f41a9495fPostConfirmation-1VPC441AZ14I6.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-functionstorelocator41a9495f41a9495fPostConfirmation-1VPC441AZ14I6.outputs.json new file mode 100644 index 00000000000..e6872c85811 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-functionstorelocator41a9495f41a9495fPostConfirmation-1VPC441AZ14I6.outputs.json @@ -0,0 +1,22 @@ +[ + { + "OutputKey": "LambdaExecutionRoleArn", + "OutputValue": "arn:aws:iam::123456789012:role/storelocator41a9495f41a9495fPostConfirmation-main" + }, + { + "OutputKey": "Region", + "OutputValue": "us-east-1" + }, + { + "OutputKey": "Arn", + "OutputValue": "arn:aws:lambda:us-east-1:123456789012:function:storelocator41a9495f41a9495fPostConfirmation-main" + }, + { + "OutputKey": "Name", + "OutputValue": "storelocator41a9495f41a9495fPostConfirmation-main" + }, + { + "OutputKey": "LambdaExecutionRole", + "OutputValue": "storelocator41a9495f41a9495fPostConfirmation-main" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-functionstorelocator41a9495f41a9495fPostConfirmation-1VPC441AZ14I6.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-functionstorelocator41a9495f41a9495fPostConfirmation-1VPC441AZ14I6.parameters.json new file mode 100644 index 00000000000..6f043e3804d --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-functionstorelocator41a9495f41a9495fPostConfirmation-1VPC441AZ14I6.parameters.json @@ -0,0 +1,46 @@ +[ + { + "ParameterKey": "GROUP", + "ParameterValue": "storeLocatorAdmin" + }, + { + "ParameterKey": "parentResource", + "ParameterValue": "" + }, + { + "ParameterKey": "s3Key", + "ParameterValue": "amplify-builds/storelocator41a9495f41a9495fPostConfirmation-6a6c746d4739755a384a-build.zip" + }, + { + "ParameterKey": "functionName", + "ParameterValue": "" + }, + { + "ParameterKey": "parentStack", + "ParameterValue": "" + }, + { + "ParameterKey": "deploymentBucketName", + "ParameterValue": "amplify-storelocator-main-f9ca7-deployment" + }, + { + "ParameterKey": "roleName", + "ParameterValue": "" + }, + { + "ParameterKey": "resourceName", + "ParameterValue": "storelocator41a9495f41a9495fPostConfirmation" + }, + { + "ParameterKey": "trigger", + "ParameterValue": "true" + }, + { + "ParameterKey": "env", + "ParameterValue": "main" + }, + { + "ParameterKey": "modules", + "ParameterValue": "add-to-group" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-functionstorelocator41a9495f41a9495fPostConfirmation-1VPC441AZ14I6.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-functionstorelocator41a9495f41a9495fPostConfirmation-1VPC441AZ14I6.template.json new file mode 100644 index 00000000000..192bbea9292 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-functionstorelocator41a9495f41a9495fPostConfirmation-1VPC441AZ14I6.template.json @@ -0,0 +1,235 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"function-Lambda\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}", + "Parameters": { + "GROUP": { + "Type": "String", + "Default": "" + }, + "modules": { + "Type": "String", + "Default": "", + "Description": "Comma-delimited list of modules to be executed by a lambda trigger. Sent to resource as an env variable." + }, + "resourceName": { + "Type": "String", + "Default": "" + }, + "trigger": { + "Type": "String", + "Default": "true" + }, + "functionName": { + "Type": "String", + "Default": "" + }, + "roleName": { + "Type": "String", + "Default": "" + }, + "parentResource": { + "Type": "String", + "Default": "" + }, + "parentStack": { + "Type": "String", + "Default": "" + }, + "env": { + "Type": "String" + }, + "deploymentBucketName": { + "Type": "String" + }, + "s3Key": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Metadata": { + "aws:asset:path": "./src", + "aws:asset:property": "Code" + }, + "Properties": { + "Handler": "index.handler", + "FunctionName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f41a9495fPostConfirmation", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f41a9495fPostConfirmation", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "Environment": { + "Variables": { + "ENV": { + "Ref": "env" + }, + "MODULES": { + "Ref": "modules" + }, + "REGION": { + "Ref": "AWS::Region" + }, + "GROUP": { + "Ref": "GROUP" + } + } + }, + "Role": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 25, + "Code": { + "S3Bucket": { + "Ref": "deploymentBucketName" + }, + "S3Key": { + "Ref": "s3Key" + } + } + } + }, + "LambdaExecutionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "storelocator41a9495f41a9495fPostConfirmation", + { + "Fn::Join": [ + "", + [ + "storelocator41a9495f41a9495fPostConfirmation", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + } + } + }, + "lambdaexecutionpolicy": { + "DependsOn": [ + "LambdaExecutionRole" + ], + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "lambda-execution-policy", + "Roles": [ + { + "Ref": "LambdaExecutionRole" + } + ], + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": { + "Fn::Sub": [ + "arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*", + { + "region": { + "Ref": "AWS::Region" + }, + "account": { + "Ref": "AWS::AccountId" + }, + "lambda": { + "Ref": "LambdaFunction" + } + } + ] + } + } + ] + } + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Ref": "LambdaFunction" + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] + } + }, + "LambdaExecutionRole": { + "Value": { + "Ref": "LambdaExecutionRole" + } + }, + "LambdaExecutionRoleArn": { + "Value": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorGeofence-1L1TL0PS3DT8L.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorGeofence-1L1TL0PS3DT8L.description.txt new file mode 100644 index 00000000000..49cef6381f7 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorGeofence-1L1TL0PS3DT8L.description.txt @@ -0,0 +1 @@ +{"createdOn":"Mac","createdBy":"Amplify","createdWith":"14.2.5","stackType":"geo-GeofenceCollection","metadata":{"whyContinueWithGen1":"Prefer not to answer"}} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorGeofence-1L1TL0PS3DT8L.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorGeofence-1L1TL0PS3DT8L.outputs.json new file mode 100644 index 00000000000..58f0ddedbcf --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorGeofence-1L1TL0PS3DT8L.outputs.json @@ -0,0 +1,14 @@ +[ + { + "OutputKey": "Region", + "OutputValue": "us-east-1" + }, + { + "OutputKey": "Arn", + "OutputValue": "arn:aws:geo:us-east-1:123456789012:geofence-collection/storeLocatorGeofence-main" + }, + { + "OutputKey": "Name", + "OutputValue": "storeLocatorGeofence-main" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorGeofence-1L1TL0PS3DT8L.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorGeofence-1L1TL0PS3DT8L.parameters.json new file mode 100644 index 00000000000..b28f809dfe9 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorGeofence-1L1TL0PS3DT8L.parameters.json @@ -0,0 +1,22 @@ +[ + { + "ParameterKey": "authuserPoolGroupsstoreLocatorAdminGroupRole", + "ParameterValue": "arn:aws:iam::123456789012:role/us-east-1_R1pdziFVe-storeLocatorAdminGroupRole" + }, + { + "ParameterKey": "isDefault", + "ParameterValue": "true" + }, + { + "ParameterKey": "env", + "ParameterValue": "main" + }, + { + "ParameterKey": "authstorelocator41a9495f41a9495fUserPoolId", + "ParameterValue": "us-east-1_R1pdziFVe" + }, + { + "ParameterKey": "collectionName", + "ParameterValue": "storeLocatorGeofence" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorGeofence-1L1TL0PS3DT8L.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorGeofence-1L1TL0PS3DT8L.template.json new file mode 100644 index 00000000000..17020d54719 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorGeofence-1L1TL0PS3DT8L.template.json @@ -0,0 +1,364 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "collectionName": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomGeofenceCollectionLambdaServiceRole9040D551": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreateGeofenceCollection", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdateGeofenceCollection", + "geo:DeleteGeofenceCollection" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369", + "Roles": [ + { + "Ref": "CustomGeofenceCollectionLambdaServiceRole9040D551" + } + ] + } + }, + "CustomGeofenceCollectionLambdaCA3D002B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst {\n LocationClient,\n CreateGeofenceCollectionCommand,\n DeleteGeofenceCollectionCommand,\n UpdateGeofenceCollectionCommand,\n} = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateGeofenceCollectionCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.CollectionName && res.CollectionArn) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateGeofenceCollectionCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.CollectionName) {\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n } else {\n await response.send(event, context, response.FAILED, res, params.CollectionName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n CollectionName: event.ResourceProperties.collectionName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteGeofenceCollectionCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.CollectionName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.collectionName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomGeofenceCollectionLambdaServiceRole9040D551", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomGeofenceCollectionLambdaServiceRoleDefaultPolicy0A18B369", + "CustomGeofenceCollectionLambdaServiceRole9040D551" + ] + }, + "CustomGeofenceCollection": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomGeofenceCollectionLambdaCA3D002B", + "Arn" + ] + }, + "collectionName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "storeLocatorAdminGeofenceCollectionPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:GetGeofence", + "geo:PutGeofence", + "geo:BatchPutGeofence", + "geo:BatchDeleteGeofence", + "geo:ListGeofences" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + "storeLocatorAdmin", + { + "Fn::Join": [ + "-", + [ + { + "Ref": "collectionName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:geofence-collection/${collectionName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "collectionName": { + "Fn::GetAtt": [ + "CustomGeofenceCollection", + "CollectionName" + ] + } + } + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-GeofenceCollection\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorMap-1CK1VG37JGFHH.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorMap-1CK1VG37JGFHH.description.txt new file mode 100644 index 00000000000..f8224820c34 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorMap-1CK1VG37JGFHH.description.txt @@ -0,0 +1 @@ +{"createdOn":"Mac","createdBy":"Amplify","createdWith":"14.2.5","stackType":"geo-Map","metadata":{"whyContinueWithGen1":"Prefer not to answer"}} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorMap-1CK1VG37JGFHH.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorMap-1CK1VG37JGFHH.outputs.json new file mode 100644 index 00000000000..20df3948c53 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorMap-1CK1VG37JGFHH.outputs.json @@ -0,0 +1,18 @@ +[ + { + "OutputKey": "Style", + "OutputValue": "VectorEsriStreets" + }, + { + "OutputKey": "Region", + "OutputValue": "us-east-1" + }, + { + "OutputKey": "Arn", + "OutputValue": "arn:aws:geo:us-east-1:123456789012:map/storeLocatorMap-main" + }, + { + "OutputKey": "Name", + "OutputValue": "storeLocatorMap-main" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorMap-1CK1VG37JGFHH.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorMap-1CK1VG37JGFHH.parameters.json new file mode 100644 index 00000000000..037f17b4597 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorMap-1CK1VG37JGFHH.parameters.json @@ -0,0 +1,34 @@ +[ + { + "ParameterKey": "authuserPoolGroupsstoreLocatorAdminGroupRole", + "ParameterValue": "arn:aws:iam::123456789012:role/us-east-1_R1pdziFVe-storeLocatorAdminGroupRole" + }, + { + "ParameterKey": "isDefault", + "ParameterValue": "true" + }, + { + "ParameterKey": "authRoleName", + "ParameterValue": "amplify-storelocator-main-f9ca7-authRole" + }, + { + "ParameterKey": "unauthRoleName", + "ParameterValue": "amplify-storelocator-main-f9ca7-unauthRole" + }, + { + "ParameterKey": "mapStyle", + "ParameterValue": "VectorEsriStreets" + }, + { + "ParameterKey": "mapName", + "ParameterValue": "storeLocatorMap" + }, + { + "ParameterKey": "env", + "ParameterValue": "main" + }, + { + "ParameterKey": "authstorelocator41a9495f41a9495fUserPoolId", + "ParameterValue": "us-east-1_R1pdziFVe" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorMap-1CK1VG37JGFHH.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorMap-1CK1VG37JGFHH.template.json new file mode 100644 index 00000000000..bf53b69ff23 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorMap-1CK1VG37JGFHH.template.json @@ -0,0 +1,347 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "authRoleName": { + "Type": "String" + }, + "unauthRoleName": { + "Type": "String" + }, + "mapName": { + "Type": "String" + }, + "mapStyle": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomMapLambdaServiceRole4EE7732C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreateMap", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdateMap", + "geo:DeleteMap" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:map/${mapName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "mapName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E", + "Roles": [ + { + "Ref": "CustomMapLambdaServiceRole4EE7732C" + } + ] + } + }, + "CustomMapLambda51D5D430": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst { LocationClient, CreateMapCommand, DeleteMapCommand, UpdateMapCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n Configuration: {\n Style: event.ResourceProperties.mapStyle,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreateMapCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Update') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdateMapCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.MapName && res.MapArn) {\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n } else {\n await response.send(event, context, response.FAILED, res, params.MapName);\n }\n }\n if (event.RequestType === 'Delete') {\n let params = {\n MapName: event.ResourceProperties.mapName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeleteMapCommand(params));\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.MapName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.mapName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomMapLambdaServiceRole4EE7732C", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomMapLambdaServiceRoleDefaultPolicy983FDD4E", + "CustomMapLambdaServiceRole4EE7732C" + ] + }, + "CustomMap": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomMapLambda51D5D430", + "Arn" + ] + }, + "mapName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + }, + "mapStyle": { + "Ref": "mapStyle" + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "MapPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:GetMapStyleDescriptor", + "geo:GetMapGlyphs", + "geo:GetMapSprites", + "geo:GetMapTile" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CustomMap", + "MapArn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "mapName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Ref": "authRoleName" + }, + { + "Ref": "unauthRoleName" + }, + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomMap", + "MapName" + ] + } + }, + "Style": { + "Value": { + "Ref": "mapStyle" + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "CustomMap", + "MapArn" + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-Map\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorSearch-1KBIBJ81FICL6.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorSearch-1KBIBJ81FICL6.description.txt new file mode 100644 index 00000000000..255e1dac25d --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorSearch-1KBIBJ81FICL6.description.txt @@ -0,0 +1 @@ +{"createdOn":"Mac","createdBy":"Amplify","createdWith":"14.2.5","stackType":"geo-PlaceIndex","metadata":{"whyContinueWithGen1":"Prefer not to answer"}} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorSearch-1KBIBJ81FICL6.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorSearch-1KBIBJ81FICL6.outputs.json new file mode 100644 index 00000000000..244ec8691fa --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorSearch-1KBIBJ81FICL6.outputs.json @@ -0,0 +1,14 @@ +[ + { + "OutputKey": "Region", + "OutputValue": "us-east-1" + }, + { + "OutputKey": "Arn", + "OutputValue": "arn:aws:geo:us-east-1:123456789012:place-index/storeLocatorSearch-main" + }, + { + "OutputKey": "Name", + "OutputValue": "storeLocatorSearch-main" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorSearch-1KBIBJ81FICL6.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorSearch-1KBIBJ81FICL6.parameters.json new file mode 100644 index 00000000000..8632772abd9 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorSearch-1KBIBJ81FICL6.parameters.json @@ -0,0 +1,38 @@ +[ + { + "ParameterKey": "authuserPoolGroupsstoreLocatorAdminGroupRole", + "ParameterValue": "arn:aws:iam::123456789012:role/us-east-1_R1pdziFVe-storeLocatorAdminGroupRole" + }, + { + "ParameterKey": "isDefault", + "ParameterValue": "true" + }, + { + "ParameterKey": "authRoleName", + "ParameterValue": "amplify-storelocator-main-f9ca7-authRole" + }, + { + "ParameterKey": "unauthRoleName", + "ParameterValue": "amplify-storelocator-main-f9ca7-unauthRole" + }, + { + "ParameterKey": "indexName", + "ParameterValue": "storeLocatorSearch" + }, + { + "ParameterKey": "dataProvider", + "ParameterValue": "Here" + }, + { + "ParameterKey": "dataSourceIntendedUse", + "ParameterValue": "SingleUse" + }, + { + "ParameterKey": "env", + "ParameterValue": "main" + }, + { + "ParameterKey": "authstorelocator41a9495f41a9495fUserPoolId", + "ParameterValue": "us-east-1_R1pdziFVe" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorSearch-1KBIBJ81FICL6.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorSearch-1KBIBJ81FICL6.template.json new file mode 100644 index 00000000000..1ef40f17717 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7-geostoreLocatorSearch-1KBIBJ81FICL6.template.json @@ -0,0 +1,348 @@ +{ + "Mappings": { + "RegionMapping": { + "us-east-1": { + "locationServiceRegion": "us-east-1" + }, + "us-east-2": { + "locationServiceRegion": "us-east-2" + }, + "us-west-2": { + "locationServiceRegion": "us-west-2" + }, + "ap-southeast-1": { + "locationServiceRegion": "ap-southeast-1" + }, + "ap-southeast-2": { + "locationServiceRegion": "ap-southeast-2" + }, + "ap-northeast-1": { + "locationServiceRegion": "ap-northeast-1" + }, + "eu-central-1": { + "locationServiceRegion": "eu-central-1" + }, + "eu-north-1": { + "locationServiceRegion": "eu-north-1" + }, + "eu-west-1": { + "locationServiceRegion": "eu-west-1" + }, + "sa-east-1": { + "locationServiceRegion": "us-east-1" + }, + "ca-central-1": { + "locationServiceRegion": "us-east-1" + }, + "us-west-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-north-1": { + "locationServiceRegion": "us-west-2" + }, + "cn-northwest-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-south-1": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-3": { + "locationServiceRegion": "us-west-2" + }, + "ap-northeast-2": { + "locationServiceRegion": "us-west-2" + }, + "eu-west-2": { + "locationServiceRegion": "eu-west-1" + }, + "eu-west-3": { + "locationServiceRegion": "eu-west-1" + }, + "me-south-1": { + "locationServiceRegion": "ap-southeast-1" + } + } + }, + "Parameters": { + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Type": "String" + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Type": "String" + }, + "authRoleName": { + "Type": "String" + }, + "unauthRoleName": { + "Type": "String" + }, + "indexName": { + "Type": "String" + }, + "dataProvider": { + "Type": "String" + }, + "dataSourceIntendedUse": { + "Type": "String" + }, + "env": { + "Type": "String" + }, + "isDefault": { + "Type": "String" + } + }, + "Resources": { + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "geo:CreatePlaceIndex", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "geo:UpdatePlaceIndex", + "geo:DeletePlaceIndex" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:geo:${region}:${account}:place-index/${indexName}", + { + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "account": { + "Ref": "AWS::AccountId" + }, + "indexName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + } + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1", + "Roles": [ + { + "Ref": "CustomPlaceIndexLambdaServiceRoleFD2F3C9D" + } + ] + } + }, + "CustomPlaceIndexLambda79813BB9": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "const response = require('cfn-response');\nconst { LocationClient, CreatePlaceIndexCommand, DeletePlaceIndexCommand, UpdatePlaceIndexCommand } = require('@aws-sdk/client-location');\nexports.handler = async function (event, context) {\n try {\n console.log('REQUEST RECEIVED:' + JSON.stringify(event));\n const pricingPlan = 'RequestBasedUsage';\n if (event.RequestType === 'Create') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSource: event.ResourceProperties.dataSource,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new CreatePlaceIndexCommand(params));\n console.log('create resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Update') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n DataSourceConfiguration: {\n IntendedUse: event.ResourceProperties.dataSourceIntendedUse,\n },\n PricingPlan: pricingPlan,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new UpdatePlaceIndexCommand(params));\n console.log('update resource response data' + JSON.stringify(res));\n if (res.IndexName && res.IndexArn) {\n event.PhysicalResourceId = res.IndexName;\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n } else {\n await response.send(event, context, response.FAILED, res, params.IndexName);\n }\n }\n if (event.RequestType === 'Delete') {\n const params = {\n IndexName: event.ResourceProperties.indexName,\n };\n const locationClient = new LocationClient({ region: event.ResourceProperties.region });\n const res = await locationClient.send(new DeletePlaceIndexCommand(params));\n event.PhysicalResourceId = event.ResourceProperties.indexName;\n console.log('delete resource response data' + JSON.stringify(res));\n await response.send(event, context, response.SUCCESS, res, params.IndexName);\n }\n } catch (err) {\n console.log(err.stack);\n const res = { Error: err };\n await response.send(event, context, response.FAILED, res, event.ResourceProperties.indexName);\n throw err;\n }\n};\n" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "CustomPlaceIndexLambdaServiceRoleDefaultPolicy818068B1", + "CustomPlaceIndexLambdaServiceRoleFD2F3C9D" + ] + }, + "CustomPlaceIndex": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomPlaceIndexLambda79813BB9", + "Arn" + ] + }, + "indexName": { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + }, + "dataSource": { + "Ref": "dataProvider" + }, + "dataSourceIntendedUse": { + "Ref": "dataSourceIntendedUse" + }, + "region": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + }, + "env": { + "Ref": "env" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "PlaceIndexPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "geo:SearchPlaceIndexForPosition", + "geo:SearchPlaceIndexForText", + "geo:SearchPlaceIndexForSuggestions", + "geo:GetPlace" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexArn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Fn::Join": [ + "", + [ + { + "Fn::Join": [ + "-", + [ + { + "Ref": "indexName" + }, + { + "Ref": "env" + } + ] + ] + }, + "Policy" + ] + ] + }, + "Roles": [ + { + "Ref": "authRoleName" + }, + { + "Ref": "unauthRoleName" + }, + { + "Fn::Join": [ + "-", + [ + { + "Ref": "authstorelocator41a9495f41a9495fUserPoolId" + }, + "storeLocatorAdminGroupRole" + ] + ] + } + ] + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexName" + ] + } + }, + "Region": { + "Value": { + "Fn::FindInMap": [ + "RegionMapping", + { + "Ref": "AWS::Region" + }, + "locationServiceRegion" + ] + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "CustomPlaceIndex", + "IndexArn" + ] + } + } + }, + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"14.2.5\",\"stackType\":\"geo-PlaceIndex\",\"metadata\":{\"whyContinueWithGen1\":\"Prefer not to answer\"}}" +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7.description.txt b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7.description.txt new file mode 100644 index 00000000000..daf66c0bc85 --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7.description.txt @@ -0,0 +1 @@ +Root Stack for AWS Amplify CLI \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7.outputs.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7.outputs.json new file mode 100644 index 00000000000..7adc659344c --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7.outputs.json @@ -0,0 +1,42 @@ +[ + { + "OutputKey": "AuthRoleName", + "OutputValue": "amplify-storelocator-main-f9ca7-authRole" + }, + { + "OutputKey": "UnauthRoleArn", + "OutputValue": "arn:aws:iam::123456789012:role/amplify-storelocator-main-f9ca7-unauthRole" + }, + { + "OutputKey": "AuthRoleArn", + "OutputValue": "arn:aws:iam::123456789012:role/amplify-storelocator-main-f9ca7-authRole" + }, + { + "OutputKey": "Region", + "OutputValue": "us-east-1", + "Description": "CloudFormation provider root stack Region", + "ExportName": "amplify-storelocator-main-f9ca7-Region" + }, + { + "OutputKey": "DeploymentBucketName", + "OutputValue": "amplify-storelocator-main-f9ca7-deployment", + "Description": "CloudFormation provider root stack deployment bucket name", + "ExportName": "amplify-storelocator-main-f9ca7-DeploymentBucketName" + }, + { + "OutputKey": "UnauthRoleName", + "OutputValue": "amplify-storelocator-main-f9ca7-unauthRole" + }, + { + "OutputKey": "StackName", + "OutputValue": "amplify-storelocator-main-f9ca7", + "Description": "CloudFormation provider root stack ID", + "ExportName": "amplify-storelocator-main-f9ca7-StackName" + }, + { + "OutputKey": "StackId", + "OutputValue": "arn:aws:cloudformation:us-east-1:123456789012:stack/amplify-storelocator-main-f9ca7/06c2ecf0-279e-11f1-a161-0ea0286337e9", + "Description": "CloudFormation provider root stack name", + "ExportName": "amplify-storelocator-main-f9ca7-StackId" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7.parameters.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7.parameters.json new file mode 100644 index 00000000000..4de99a17daa --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7.parameters.json @@ -0,0 +1,14 @@ +[ + { + "ParameterKey": "AuthRoleName", + "ParameterValue": "amplify-storelocator-main-f9ca7-authRole" + }, + { + "ParameterKey": "DeploymentBucketName", + "ParameterValue": "amplify-storelocator-main-f9ca7-deployment" + }, + { + "ParameterKey": "UnauthRoleName", + "ParameterValue": "amplify-storelocator-main-f9ca7-unauthRole" + } +] \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7.template.json b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7.template.json new file mode 100644 index 00000000000..d2b7054fe5b --- /dev/null +++ b/amplify-migration-apps/store-locator/_snapshot.pre.refactor/amplify-storelocator-main-f9ca7.template.json @@ -0,0 +1,653 @@ +{ + "Description": "Root Stack for AWS Amplify CLI", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "DeploymentBucketName": { + "Type": "String", + "Default": "DeploymentBucket", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "AuthRoleName": { + "Type": "String", + "Default": "AuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "UnauthRoleName": { + "Type": "String", + "Default": "UnAuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + } + }, + "Outputs": { + "Region": { + "Description": "CloudFormation provider root stack Region", + "Value": { + "Ref": "AWS::Region" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-Region" + } + } + }, + "StackName": { + "Description": "CloudFormation provider root stack ID", + "Value": { + "Ref": "AWS::StackName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackName" + } + } + }, + "StackId": { + "Description": "CloudFormation provider root stack name", + "Value": { + "Ref": "AWS::StackId" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackId" + } + } + }, + "AuthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + "UnauthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + }, + "DeploymentBucketName": { + "Description": "CloudFormation provider root stack deployment bucket name", + "Value": { + "Ref": "DeploymentBucketName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-DeploymentBucketName" + } + } + }, + "AuthRoleName": { + "Value": { + "Ref": "AuthRole" + } + }, + "UnauthRoleName": { + "Value": { + "Ref": "UnauthRole" + } + } + }, + "Resources": { + "DeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Ref": "DeploymentBucketName" + }, + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "DeploymentBucketBlockHTTP": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "DeploymentBucketName" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Effect": "Deny", + "Principal": "*", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "DeploymentBucketName" + }, + "/*" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "DeploymentBucketName" + } + ] + ] + } + ], + "Condition": { + "Bool": { + "aws:SecureTransport": false + } + } + } + ] + } + } + }, + "AuthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "AuthRoleName" + } + } + }, + "UnauthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "UnauthRoleName" + } + } + }, + "AuthTriggerCustomLambdaStack": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/auth-trigger-cloudformation-template.json", + "Parameters": { + "env": "main", + "userpoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "userpoolArn": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolArn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationLambdaExecutionRole": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.LambdaExecutionRoleArn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationArn": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.Arn" + ] + }, + "functionstorelocator41a9495f41a9495fPostConfirmationName": { + "Fn::GetAtt": [ + "functionstorelocator41a9495f41a9495fPostConfirmation", + "Outputs.Name" + ] + } + } + }, + "DependsOn": [ + "authstorelocator41a9495f41a9495f", + "functionstorelocator41a9495f41a9495fPostConfirmation" + ] + }, + "authstorelocator41a9495f41a9495f": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/storelocator41a9495f41a9495f-cloudformation-template.json", + "Parameters": { + "identityPoolName": "storelocator41a9495f_identitypool_41a9495f", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "storel41a9495f", + "userPoolName": "storelocator41a9495f_userpool_41a9495f", + "autoVerifiedAttributes": "email", + "mfaConfiguration": "OFF", + "mfaTypes": "SMS Text Message", + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": "", + "requiredAttributes": "email", + "aliasAttributes": "", + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": "100", + "userpoolClientWriteAttributes": "email", + "userpoolClientReadAttributes": "email", + "userpoolClientLambdaRole": "storel41a9495f_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "41a9495f", + "resourceName": "storelocator41a9495f41a9495f", + "authSelections": "identityPoolAndUserPool", + "useDefault": "manual", + "thirdPartyAuth": false, + "usernameAttributes": "email", + "userPoolGroups": true, + "adminQueries": false, + "triggers": "{\"PostConfirmation\":[\"add-to-group\"]}", + "hostedUI": false, + "userPoolGroupList": "storeLocatorAdmin", + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": "[object Object]", + "permissions": "{\"policyName\":\"AddToGroupCognito\",\"trigger\":\"PostConfirmation\",\"effect\":\"Allow\",\"actions\":[\"cognito-idp:AdminAddUserToGroup\",\"cognito-idp:GetGroup\",\"cognito-idp:CreateGroup\"],\"resource\":{\"paramType\":\"!GetAtt\",\"keys\":[\"UserPool\",\"Arn\"]}}", + "authTriggerConnections": "{\"triggerType\":\"PostConfirmation\",\"lambdaFunctionName\":\"storelocator41a9495f41a9495fPostConfirmation\"}", + "env": "main" + } + } + }, + "authuserPoolGroups": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/auth/userPoolGroups-cloudformation-template.json", + "Parameters": { + "AuthRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "UnauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authstorelocator41a9495f41a9495fAppClientIDWeb": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.AppClientIDWeb" + ] + }, + "authstorelocator41a9495f41a9495fAppClientID": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.AppClientID" + ] + }, + "authstorelocator41a9495f41a9495fIdentityPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.IdentityPoolId" + ] + }, + "env": "main" + } + } + }, + "functionstorelocator41a9495f41a9495fPostConfirmation": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/function/storelocator41a9495f41a9495fPostConfirmation-cloudformation-template.json", + "Parameters": { + "modules": "add-to-group", + "resourceName": "storelocator41a9495f41a9495fPostConfirmation", + "GROUP": "storeLocatorAdmin", + "deploymentBucketName": "amplify-storelocator-main-f9ca7-deployment", + "s3Key": "amplify-builds/storelocator41a9495f41a9495fPostConfirmation-6a6c746d4739755a384a-build.zip", + "env": "main" + } + } + }, + "geostoreLocatorGeofence": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorGeofence-cloudformation-template.json", + "Parameters": { + "collectionName": "storeLocatorGeofence", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "geostoreLocatorMap": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorMap-cloudformation-template.json", + "Parameters": { + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "mapName": "storeLocatorMap", + "mapStyle": "VectorEsriStreets", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "geostoreLocatorSearch": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-storelocator-main-f9ca7-deployment/amplify-cfn-templates/geo/storeLocatorSearch-cloudformation-template.json", + "Parameters": { + "authRoleName": { + "Ref": "AuthRoleName" + }, + "unauthRoleName": { + "Ref": "UnauthRoleName" + }, + "indexName": "storeLocatorSearch", + "dataProvider": "Here", + "dataSourceIntendedUse": "SingleUse", + "isDefault": true, + "authstorelocator41a9495f41a9495fUserPoolId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.UserPoolId" + ] + }, + "authuserPoolGroupsstoreLocatorAdminGroupRole": { + "Fn::GetAtt": [ + "authuserPoolGroups", + "Outputs.storeLocatorAdminGroupRole" + ] + }, + "env": "main" + } + } + }, + "UpdateRolesWithIDPFunction": { + "DependsOn": [ + "AuthRole", + "UnauthRole", + "authstorelocator41a9495f41a9495f" + ], + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": { + "Fn::Join": [ + "\n", + [ + "const response = require('cfn-response');", + "const { IAMClient, GetRoleCommand, UpdateAssumeRolePolicyCommand } = require('@aws-sdk/client-iam');", + "exports.handler = function(event, context) {", + " // Don't return promise, response.send() marks context as done internally", + " const ignoredPromise = handleEvent(event, context)", + "};", + "async function handleEvent(event, context) {", + " try {", + " let authRoleName = event.ResourceProperties.authRoleName;", + " let unauthRoleName = event.ResourceProperties.unauthRoleName;", + " let idpId = event.ResourceProperties.idpId;", + " let authParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'authenticated'}", + " }", + " }]", + " };", + " let unauthParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'unauthenticated'}", + " }", + " }]", + " };", + " if (event.RequestType === 'Delete') {", + " try {", + " delete authParamsJson.Statement[0].Condition;", + " delete unauthParamsJson.Statement[0].Condition;", + " authParamsJson.Statement[0].Effect = 'Deny'", + " unauthParamsJson.Statement[0].Effect = 'Deny'", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let res = await Promise.all([", + " iam.send(new GetRoleCommand({RoleName: authParams.RoleName})),", + " iam.send(new GetRoleCommand({RoleName: unauthParams.RoleName}))", + " ]);", + " res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.SUCCESS, {Error: err});", + " }", + " } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " }", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.FAILED, {Error: err});", + " }", + "};" + ] + ] + } + }, + "Handler": "index.handler", + "Runtime": "nodejs22.x", + "Timeout": 300, + "Role": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunctionRole", + "Arn" + ] + } + } + }, + "UpdateRolesWithIDPFunctionOutputs": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunction", + "Arn" + ] + }, + "region": { + "Ref": "AWS::Region" + }, + "idpId": { + "Fn::GetAtt": [ + "authstorelocator41a9495f41a9495f", + "Outputs.IdentityPoolId" + ] + }, + "authRoleName": { + "Ref": "AuthRole" + }, + "unauthRoleName": { + "Ref": "UnauthRole" + } + } + }, + "UpdateRolesWithIDPFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "AuthRole" + }, + "-idp" + ] + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + }, + "Policies": [ + { + "PolicyName": "UpdateRolesWithIDPFunctionPolicy", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/eslint.config.js b/amplify-migration-apps/store-locator/eslint.config.js new file mode 100644 index 00000000000..6f236359302 --- /dev/null +++ b/amplify-migration-apps/store-locator/eslint.config.js @@ -0,0 +1,18 @@ +import js from '@eslint/js'; +import globals from 'globals'; +import reactHooks from 'eslint-plugin-react-hooks'; +import reactRefresh from 'eslint-plugin-react-refresh'; +import tseslint from 'typescript-eslint'; +import { defineConfig, globalIgnores } from 'eslint/config'; + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [js.configs.recommended, tseslint.configs.recommended, reactHooks.configs.flat.recommended, reactRefresh.configs.vite], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + }, +]); diff --git a/amplify-migration-apps/store-locator/gen1-test-script.ts b/amplify-migration-apps/store-locator/gen1-test-script.ts new file mode 100644 index 00000000000..0c9e021da11 --- /dev/null +++ b/amplify-migration-apps/store-locator/gen1-test-script.ts @@ -0,0 +1,100 @@ +/** + * Gen1 Test Script for Store Locator App + * + * This script tests geo functionality: + * 1. Location Search (Place Index) -- searchByText, searchByCoordinates + * 2. Geofence Operations -- save, get, list, delete + * + * Credentials are provisioned automatically via Cognito + * AdminCreateUser + AdminSetUserPassword. Since AdminCreateUser + * does not trigger the PostConfirmation Lambda, the script + * manually adds the user to the storeLocatorAdmin group to + * grant geofence CRUD permissions. + */ + +// Polyfill crypto for Node.js environment (required for Amplify Auth) +import { webcrypto } from 'crypto'; +if (typeof globalThis.crypto === 'undefined') { + (globalThis as any).crypto = webcrypto; +} + +import { Amplify } from 'aws-amplify'; +import { signIn, signOut, getCurrentUser } from 'aws-amplify/auth'; +import { + CognitoIdentityProviderClient, + AdminAddUserToGroupCommand, +} from '@aws-sdk/client-cognito-identity-provider'; +import amplifyconfig from './src/amplifyconfiguration.json'; +import { TestRunner } from '../_test-common/test-apps-test-utils'; +import { provisionTestUser } from '../_test-common/signup'; +import { createTestFunctions, createTestOrchestrator } from './test-utils'; + +// Configure Amplify +Amplify.configure(amplifyconfig); + +// ============================================================ +// Main Test Execution +// ============================================================ + +async function runAllTests(): Promise { + console.log('🚀 Starting Store Locator Gen1 Test Script\n'); + console.log('This script tests:'); + console.log(' 1. Location Search (Place Index)'); + console.log(' 2. Geofence Operations (CRUD)'); + + // Provision user via admin APIs, then sign in here so tokens stay in this module's Amplify scope + const { signinValue, testUser } = await provisionTestUser(amplifyconfig); + + // AdminCreateUser does not fire the PostConfirmation trigger, so + // manually add the user to storeLocatorAdmin for geofence permissions. + try { + const cognitoClient = new CognitoIdentityProviderClient({ + region: (amplifyconfig as any).aws_cognito_region, + }); + await cognitoClient.send( + new AdminAddUserToGroupCommand({ + UserPoolId: (amplifyconfig as any).aws_user_pools_id, + Username: signinValue, + GroupName: 'storeLocatorAdmin', + }), + ); + console.log('✅ Added user to storeLocatorAdmin group'); + } catch (error: any) { + console.error('❌ Failed to add user to group:', error.message || error); + process.exit(1); + } + + // Sign in from this module so the auth tokens are available to Geo + try { + await signIn({ username: signinValue, password: testUser.password }); + const currentUser = await getCurrentUser(); + console.log(`✅ Signed in as: ${currentUser.username}`); + } catch (error: any) { + console.error('❌ SignIn failed:', error.message || error); + process.exit(1); + } + + const runner = new TestRunner(); + const testFunctions = createTestFunctions(); + const { runSearchTests, runGeofenceTests } = createTestOrchestrator(testFunctions, runner); + + // Part 1: Location Search + await runSearchTests(); + + // Part 2: Geofence Operations + await runGeofenceTests(); + + // Sign out + try { + await signOut(); + console.log('✅ Signed out successfully'); + } catch (error: any) { + console.error('❌ Sign out error:', error.message || error); + } + + // Print summary and exit with appropriate code + runner.printSummary(); +} + +// Run all tests +void runAllTests(); diff --git a/amplify-migration-apps/store-locator/gen2-test-script.ts b/amplify-migration-apps/store-locator/gen2-test-script.ts new file mode 100644 index 00000000000..5f5fb82facd --- /dev/null +++ b/amplify-migration-apps/store-locator/gen2-test-script.ts @@ -0,0 +1,110 @@ +/** + * Gen2 Test Script for Store Locator App + * + * This script tests geo functionality against the Gen2 backend: + * 1. Location Search (Place Index) -- searchByText, searchByCoordinates + * 2. Geofence Operations -- save, get, list, delete + * + * Credentials are provisioned automatically via Cognito + * AdminCreateUser + AdminSetUserPassword. Since AdminCreateUser + * does not trigger the PostConfirmation Lambda, the script + * manually adds the user to the storeLocatorAdmin group to + * grant geofence CRUD permissions. + * + * IMPORTANT: Place your Gen2 amplify_outputs.json in src/ before running. + */ + +// Polyfill crypto for Node.js environment (required for Amplify Auth) +import { webcrypto } from 'crypto'; +if (typeof globalThis.crypto === 'undefined') { + (globalThis as any).crypto = webcrypto; +} + +import { Amplify } from 'aws-amplify'; +import { signIn, signOut, getCurrentUser } from 'aws-amplify/auth'; +import { + CognitoIdentityProviderClient, + AdminAddUserToGroupCommand, +} from '@aws-sdk/client-cognito-identity-provider'; +import amplifyconfig from './src/amplify_outputs.json'; +import { TestRunner } from '../_test-common/test-apps-test-utils'; +import { provisionTestUser } from '../_test-common/signup'; +import { createTestFunctions, createTestOrchestrator } from './test-utils'; + +// Configure Amplify with Gen2 configuration (overrides the Gen1 config in test-utils) +Amplify.configure(amplifyconfig); + +// ============================================================ +// Main Test Execution +// ============================================================ + +async function runAllTests(): Promise { + console.log('🚀 Starting Store Locator Gen2 Test Script\n'); + console.log('This script tests:'); + console.log(' 1. Location Search (Place Index)'); + console.log(' 2. Geofence Operations (CRUD)'); + + // Provision user via admin APIs, then sign in here so tokens stay in this module's Amplify scope + const gen2Auth = (amplifyconfig as any).auth; + const gen1Compat = { + aws_user_pools_id: gen2Auth.user_pool_id, + aws_user_pools_web_client_id: gen2Auth.user_pool_client_id, + aws_cognito_region: gen2Auth.aws_region, + aws_cognito_username_attributes: gen2Auth.username_attributes?.map((a: string) => a.toUpperCase()) ?? [], + aws_cognito_signup_attributes: gen2Auth.standard_required_attributes?.map((a: string) => a.toUpperCase()) ?? [], + }; + const { signinValue, testUser } = await provisionTestUser(gen1Compat); + + // AdminCreateUser does not fire the PostConfirmation trigger, so + // manually add the user to storeLocatorAdmin for geofence permissions. + try { + const cognitoClient = new CognitoIdentityProviderClient({ + region: gen2Auth.aws_region, + }); + await cognitoClient.send( + new AdminAddUserToGroupCommand({ + UserPoolId: gen2Auth.user_pool_id, + Username: signinValue, + GroupName: 'storeLocatorAdmin', + }), + ); + console.log('✅ Added user to storeLocatorAdmin group'); + } catch (error: any) { + console.error('❌ Failed to add user to group:', error.message || error); + process.exit(1); + } + + // Sign in from this module so the auth tokens are available to Geo + try { + await signIn({ username: signinValue, password: testUser.password }); + const currentUser = await getCurrentUser(); + console.log(`✅ Signed in as: ${currentUser.username}`); + } catch (error: any) { + console.error('❌ SignIn failed:', error.message || error); + process.exit(1); + } + + const runner = new TestRunner(); + const testFunctions = createTestFunctions(); + const { runSearchTests, runGeofenceTests } = createTestOrchestrator(testFunctions, runner); + + // Part 1: Location Search + await runSearchTests(); + + // Part 2: Geofence Operations + await runGeofenceTests(); + + // Sign out + try { + await signOut(); + console.log('✅ Signed out successfully'); + } catch (error: any) { + console.error('❌ Sign out error:', error.message || error); + } + + // Print summary and exit with appropriate code + runner.printSummary(); +} + +// Run all tests +void runAllTests(); diff --git a/amplify-migration-apps/store-locator/images/add-gen2-main-branch.png b/amplify-migration-apps/store-locator/images/add-gen2-main-branch.png new file mode 100644 index 00000000000..236c5d5a772 Binary files /dev/null and b/amplify-migration-apps/store-locator/images/add-gen2-main-branch.png differ diff --git a/amplify-migration-apps/store-locator/images/add-main-branch.png b/amplify-migration-apps/store-locator/images/add-main-branch.png new file mode 100644 index 00000000000..81f5676edb6 Binary files /dev/null and b/amplify-migration-apps/store-locator/images/add-main-branch.png differ diff --git a/amplify-migration-apps/store-locator/images/app.png b/amplify-migration-apps/store-locator/images/app.png new file mode 100644 index 00000000000..35a736603d7 Binary files /dev/null and b/amplify-migration-apps/store-locator/images/app.png differ diff --git a/amplify-migration-apps/store-locator/images/deploying-gen2-main-branch.png b/amplify-migration-apps/store-locator/images/deploying-gen2-main-branch.png new file mode 100644 index 00000000000..4be42e2231a Binary files /dev/null and b/amplify-migration-apps/store-locator/images/deploying-gen2-main-branch.png differ diff --git a/amplify-migration-apps/store-locator/images/deploying-main-branch.png b/amplify-migration-apps/store-locator/images/deploying-main-branch.png new file mode 100644 index 00000000000..0f19512dc15 Binary files /dev/null and b/amplify-migration-apps/store-locator/images/deploying-main-branch.png differ diff --git a/amplify-migration-apps/store-locator/images/find-gen2-stack.png b/amplify-migration-apps/store-locator/images/find-gen2-stack.png new file mode 100644 index 00000000000..6e62d9e9d1c Binary files /dev/null and b/amplify-migration-apps/store-locator/images/find-gen2-stack.png differ diff --git a/amplify-migration-apps/store-locator/images/hosting-get-started.png b/amplify-migration-apps/store-locator/images/hosting-get-started.png new file mode 100644 index 00000000000..498dfa66164 Binary files /dev/null and b/amplify-migration-apps/store-locator/images/hosting-get-started.png differ diff --git a/amplify-migration-apps/store-locator/index.html b/amplify-migration-apps/store-locator/index.html new file mode 100644 index 00000000000..6ed4c17060a --- /dev/null +++ b/amplify-migration-apps/store-locator/index.html @@ -0,0 +1,13 @@ + + + + + + + storelocator + + +
+ + + diff --git a/amplify-migration-apps/store-locator/package.json b/amplify-migration-apps/store-locator/package.json new file mode 100644 index 00000000000..9abc47b5c30 --- /dev/null +++ b/amplify-migration-apps/store-locator/package.json @@ -0,0 +1,42 @@ +{ + "name": "@amplify-migration-apps/store-locator", + "private": true, + "version": "0.0.0", + "type": "module", + "installConfig": { + "hoistingLimits": "workspaces" + }, + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview", + "sanitize": "tsx ../sanitize.ts", + "typecheck": "cd _snapshot.post.generate/amplify && npx tsc --noEmit" + }, + "dependencies": { + "@aws-sdk/client-cognito-identity-provider": "^3.1016.0", + "@aws-amplify/geo": "^3.0.92", + "@aws-amplify/ui-react": "^6.13.2", + "@aws-amplify/ui-react-geo": "^2.2.13", + "aws-amplify": "^6.16.0", + "maplibre-gl": "^2.4.0", + "maplibre-gl-js-amplify": "^4.0.2", + "react": "^19.2.0", + "react-dom": "^19.2.0" + }, + "devDependencies": { + "@eslint/js": "^9.39.1", + "@types/node": "^24.10.1", + "@types/react": "^19.2.5", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "globals": "^16.5.0", + "typescript": "~5.9.3", + "typescript-eslint": "^8.46.4", + "vite": "^7.2.4" + } +} diff --git a/amplify-migration-apps/store-locator/public/vite.svg b/amplify-migration-apps/store-locator/public/vite.svg new file mode 100644 index 00000000000..e7b8dfb1b2a --- /dev/null +++ b/amplify-migration-apps/store-locator/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/src/App.css b/amplify-migration-apps/store-locator/src/App.css new file mode 100644 index 00000000000..913eace8803 --- /dev/null +++ b/amplify-migration-apps/store-locator/src/App.css @@ -0,0 +1,158 @@ +.app { + height: 100%; + display: flex; + flex-direction: column; +} + +.header { + padding: 1rem; + background-color: #232f3e; + color: white; + position: relative; +} + +.header h1 { + margin: 0 0 0.5rem 0; + font-size: 1.5rem; + font-weight: 500; +} + +.search-form { + display: flex; + gap: 0.5rem; +} + +.search-input { + flex: 1; + padding: 0.5rem; + border: none; + border-radius: 4px; + font-size: 1rem; +} + +.search-button { + padding: 0.5rem 1rem; + background-color: #ff9900; + border: none; + border-radius: 4px; + color: #232f3e; + font-weight: 500; + cursor: pointer; +} + +.search-button:hover { + background-color: #ffac31; +} + +.search-button:disabled { + background-color: #ccc; + cursor: not-allowed; +} + +.search-results { + position: absolute; + top: 100%; + left: 1rem; + right: 1rem; + background: white; + color: #232f3e; + list-style: none; + margin: 0; + padding: 0; + border-radius: 0 0 4px 4px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + z-index: 1000; +} + +.search-results li { + padding: 0.75rem 1rem; + cursor: pointer; + border-bottom: 1px solid #eee; +} + +.search-results li:last-child { + border-bottom: none; +} + +.search-results li:hover { + background-color: #f5f5f5; +} + +.map-container { + flex: 1; + width: 100%; +} + + +/* Fix marker popup sizing */ +.maplibregl-popup-content { + padding: 10px !important; + box-sizing: border-box; + width: auto !important; + min-width: unset !important; + max-width: 250px !important; +} + +.maplibregl-popup { + max-width: none !important; +} + +.maplibregl-popup-content h3 { + margin: 0 0 5px 0; + font-size: 14px; +} + +.maplibregl-popup-content p { + margin: 0; + font-size: 12px; +} + + +/* Auth section styles */ +.header-top { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 0.5rem; +} + +.auth-section { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.user-email { + font-size: 0.875rem; + opacity: 0.8; +} + +.sign-out-button { + padding: 0.25rem 0.5rem; + background-color: transparent; + border: 1px solid white; + border-radius: 4px; + color: white; + font-size: 0.75rem; + cursor: pointer; +} + +.sign-out-button:hover { + background-color: rgba(255, 255, 255, 0.1); +} + +/* Amplify Authenticator overrides */ +[data-amplify-authenticator] { + --amplify-components-button-primary-background-color: #ff9900; + --amplify-components-button-primary-hover-background-color: #ffac31; +} + + +/* Center the Authenticator */ +[data-amplify-authenticator] { + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + background-color: #232f3e; +} diff --git a/amplify-migration-apps/store-locator/src/App.tsx b/amplify-migration-apps/store-locator/src/App.tsx new file mode 100644 index 00000000000..f4be171cb61 --- /dev/null +++ b/amplify-migration-apps/store-locator/src/App.tsx @@ -0,0 +1,208 @@ +import { useEffect, useRef, useState } from 'react'; +import { createMap, drawPoints, AmplifyGeofenceControl } from 'maplibre-gl-js-amplify'; +import maplibregl from 'maplibre-gl'; +import { Geo } from '@aws-amplify/geo'; +import { Authenticator } from '@aws-amplify/ui-react'; +import 'maplibre-gl/dist/maplibre-gl.css'; +import 'maplibre-gl-js-amplify/dist/public/amplify-map.css'; +import 'maplibre-gl-js-amplify/dist/public/amplify-ctrl-geofence.css'; +import '@aws-amplify/ui-react/styles.css'; +import './App.css'; + +// Sample store locations - New York +const storeLocations = [ + { + coordinates: [-73.9857, 40.7484] as [number, number], + title: 'Midtown Manhattan Store', + address: '350 5th Avenue, New York, NY', + }, + { + coordinates: [-73.9805, 40.787] as [number, number], + title: 'Upper West Side Store', + address: '2100 Broadway, New York, NY', + }, + { + coordinates: [-73.9442, 40.6782] as [number, number], + title: 'Brooklyn Store', + address: '445 Albee Square, Brooklyn, NY', + }, + { + coordinates: [-74.006, 40.7128] as [number, number], + title: 'Financial District Store', + address: '100 Wall Street, New York, NY', + }, + { + coordinates: [-73.9855, 40.758] as [number, number], + title: 'Times Square Store', + address: '1560 Broadway, New York, NY', + }, + { + coordinates: [-73.9654, 40.7829] as [number, number], + title: 'Central Park Store', + address: '10 Columbus Circle, New York, NY', + }, + { + coordinates: [-73.9934, 40.7505] as [number, number], + title: 'Hudson Yards Store', + address: '20 Hudson Yards, New York, NY', + }, + { + coordinates: [-73.9776, 40.7614] as [number, number], + title: 'Rockefeller Center Store', + address: '45 Rockefeller Plaza, New York, NY', + }, + { + coordinates: [-74.0445, 40.6892] as [number, number], + title: 'Staten Island Ferry Store', + address: '4 Whitehall Street, New York, NY', + }, + { + coordinates: [-73.9496, 40.6501] as [number, number], + title: 'Flatbush Store', + address: '900 Flatbush Avenue, Brooklyn, NY', + }, +]; + +interface SearchResult { + label?: string; + geometry?: { + point?: [number, number]; + }; +} + +interface StoreLocatorProps { + signOut: () => void; + user: { signInDetails?: { loginId?: string } }; +} + +function StoreLocator({ signOut, user }: StoreLocatorProps) { + const mapRef = useRef(null); + const markerRef = useRef(null); + const [searchQuery, setSearchQuery] = useState(''); + const [searchResults, setSearchResults] = useState([]); + const [isSearching, setIsSearching] = useState(false); + + useEffect(() => { + async function initializeMap() { + const map = await createMap({ + container: 'map', + center: [-73.9857, 40.7484], + zoom: 11, + }); + + mapRef.current = map; + + map.on('load', function () { + drawPoints('storeLocations', storeLocations, map, { + showCluster: true, + unclusteredOptions: { + showMarkerPopup: true, + }, + clusterOptions: { + showCount: true, + smCircleSize: 20, + mdCircleSize: 30, + lgCircleSize: 40, + clusterMaxZoom: 12, + }, + }); + + // Add geofence control + const geofenceControl = new AmplifyGeofenceControl(); + map.addControl(geofenceControl as unknown as maplibregl.IControl); + }); + } + + initializeMap(); + + return () => { + if (mapRef.current) { + mapRef.current.remove(); + } + }; + }, []); + + const handleSearch = async (e: React.FormEvent) => { + e.preventDefault(); + if (!searchQuery.trim()) return; + + setIsSearching(true); + try { + const results = await Geo.searchByText(searchQuery, { + maxResults: 5, + }); + setSearchResults(results); + } catch (error) { + console.error('Search error:', error); + setSearchResults([]); + } finally { + setIsSearching(false); + } + }; + + const handleResultClick = (result: SearchResult) => { + if (result.geometry?.point && mapRef.current) { + const [lng, lat] = result.geometry.point; + + if (markerRef.current) { + markerRef.current.remove(); + } + + markerRef.current = new maplibregl.Marker({ color: '#ff9900' }) + .setLngLat([lng, lat]) + .setPopup(new maplibregl.Popup().setHTML(`${result.label}`)) + .addTo(mapRef.current); + + mapRef.current.flyTo({ + center: [lng, lat], + zoom: 15, + }); + setSearchResults([]); + setSearchQuery(''); + } + }; + + return ( +
+
+
+

Store Locator

+
+ {user.signInDetails?.loginId} + +
+
+
+ setSearchQuery(e.target.value)} + className="search-input" + /> + +
+ {searchResults.length > 0 && ( +
    + {searchResults.map((result, index) => ( +
  • handleResultClick(result)}> + {result.label} +
  • + ))} +
+ )} +
+
+
+ ); +} + +function App() { + return {({ signOut, user }) => }; +} + +export default App; diff --git a/amplify-migration-apps/store-locator/src/assets/react.svg b/amplify-migration-apps/store-locator/src/assets/react.svg new file mode 100644 index 00000000000..6c87de9bb33 --- /dev/null +++ b/amplify-migration-apps/store-locator/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/amplify-migration-apps/store-locator/src/aws-exports.js b/amplify-migration-apps/store-locator/src/aws-exports.js new file mode 100644 index 00000000000..2f8c052177d --- /dev/null +++ b/amplify-migration-apps/store-locator/src/aws-exports.js @@ -0,0 +1,57 @@ +/* eslint-disable */ +// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten. + +const awsmobile = { + "aws_project_region": "us-east-1", + "aws_cognito_identity_pool_id": "us-east-1:4ea514e6-bc16-4990-a5ea-cefe84c3050d", + "aws_cognito_region": "us-east-1", + "aws_user_pools_id": "us-east-1_R1pdziFVe", + "aws_user_pools_web_client_id": "6am6ldh23n8ke819nuvk51cddq", + "oauth": {}, + "aws_cognito_username_attributes": [ + "EMAIL" + ], + "aws_cognito_social_providers": [], + "aws_cognito_signup_attributes": [ + "EMAIL" + ], + "aws_cognito_mfa_configuration": "OFF", + "aws_cognito_mfa_types": [ + "SMS" + ], + "aws_cognito_password_protection_settings": { + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [] + }, + "aws_cognito_verification_mechanisms": [ + "EMAIL" + ], + "geo": { + "amazon_location_service": { + "region": "us-east-1", + "maps": { + "items": { + "storeLocatorMap-main": { + "style": "VectorEsriStreets" + } + }, + "default": "storeLocatorMap-main" + }, + "search_indices": { + "items": [ + "storeLocatorSearch-main" + ], + "default": "storeLocatorSearch-main" + }, + "geofenceCollections": { + "items": [ + "storeLocatorGeofence-main" + ], + "default": "storeLocatorGeofence-main" + } + } + } +}; + + +export default awsmobile; diff --git a/amplify-migration-apps/store-locator/src/index.css b/amplify-migration-apps/store-locator/src/index.css new file mode 100644 index 00000000000..5d5be76d5d0 --- /dev/null +++ b/amplify-migration-apps/store-locator/src/index.css @@ -0,0 +1,11 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +html, +body, +#root { + height: 100%; +} diff --git a/amplify-migration-apps/store-locator/src/main.tsx b/amplify-migration-apps/store-locator/src/main.tsx new file mode 100644 index 00000000000..ff81d6c69dc --- /dev/null +++ b/amplify-migration-apps/store-locator/src/main.tsx @@ -0,0 +1,14 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; +import { Amplify } from 'aws-amplify'; +import './index.css'; +import App from './App.tsx'; +import amplifyconfig from './amplifyconfiguration.json'; + +Amplify.configure(amplifyconfig); + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/amplify-migration-apps/store-locator/test-utils.ts b/amplify-migration-apps/store-locator/test-utils.ts new file mode 100644 index 00000000000..ba44baf5668 --- /dev/null +++ b/amplify-migration-apps/store-locator/test-utils.ts @@ -0,0 +1,175 @@ +// test-utils.ts +/** + * Shared test utilities for Store Locator Gen1 and Gen2 test scripts. + */ + +import { Amplify } from 'aws-amplify'; +import { Geo } from '@aws-amplify/geo'; +import { TestRunner } from '../_test-common/test-apps-test-utils'; +import amplifyconfig from './src/amplifyconfiguration.json'; + +// Configure Amplify in this module to ensure geo singletons see the config +Amplify.configure(amplifyconfig); + +// Midtown Manhattan store coordinates from App.tsx +const MIDTOWN_COORDINATES: [number, number] = [-73.9857, 40.7484]; + +// Counter-clockwise rectangle around Midtown Manhattan (~0.01 deg offset) +const TEST_GEOFENCE_POLYGON: [number, number][] = [ + [-73.995, 40.745], + [-73.975, 40.745], + [-73.975, 40.755], + [-73.995, 40.755], + [-73.995, 40.745], +]; + +// ============================================================ +// Shared Test Functions Factory +// ============================================================ + +export function createTestFunctions() { + let testGeofenceId = `test-geofence-${Date.now()}`; + + // ============================================================ + // Location Search Test Functions (Place Index) + // ============================================================ + + async function testSearchByText(): Promise { + console.log('\n🔍 Testing Geo.searchByText...'); + const results = await Geo.searchByText('New York', { + maxResults: 5, + }); + if (!results || results.length === 0) { + throw new Error('searchByText returned no results'); + } + console.log(`✅ Found ${results.length} results:`); + results.forEach((r: any) => { + const label = r.label || '(no label)'; + const point = r.geometry?.point; + console.log(` - ${label}${point ? ` [${point[0].toFixed(4)}, ${point[1].toFixed(4)}]` : ''}`); + }); + } + + async function testSearchByCoordinates(): Promise { + console.log('\n📍 Testing Geo.searchByCoordinates...'); + console.log(` Coordinates: [${MIDTOWN_COORDINATES[0]}, ${MIDTOWN_COORDINATES[1]}]`); + const result = await Geo.searchByCoordinates(MIDTOWN_COORDINATES); + if (!result) { + throw new Error('searchByCoordinates returned no result'); + } + const label = (result as any).label || '(no label)'; + console.log(`✅ Reverse geocode result: ${label}`); + } + + // ============================================================ + // Geofence Test Functions (Geofence Collection) + // ============================================================ + + async function testSaveGeofences(): Promise { + console.log('\n📐 Testing Geo.saveGeofences...'); + console.log(` Geofence ID: ${testGeofenceId}`); + const result = await Geo.saveGeofences([ + { + geofenceId: testGeofenceId, + geometry: { + polygon: [TEST_GEOFENCE_POLYGON], + }, + }, + ]); + const successes = (result as any).successes || []; + const errors = (result as any).errors || []; + if (errors.length > 0) { + throw new Error(`saveGeofences had errors: ${JSON.stringify(errors)}`); + } + if (successes.length === 0) { + throw new Error('saveGeofences returned no successes'); + } + console.log('✅ Geofence saved:', { + geofenceId: successes[0].geofenceId, + createTime: successes[0].createTime, + }); + return testGeofenceId; + } + + async function testGetGeofence(): Promise { + console.log(`\n🔎 Testing Geo.getGeofence (id: ${testGeofenceId})...`); + const geofence = await Geo.getGeofence(testGeofenceId); + if (!geofence) { + throw new Error('getGeofence returned no result'); + } + const gf = geofence as any; + console.log('✅ Geofence retrieved:', { + geofenceId: gf.geofenceId, + createTime: gf.createTime, + updateTime: gf.updateTime, + vertices: gf.geometry?.polygon?.[0]?.length || 0, + }); + } + + async function testListGeofences(): Promise { + console.log('\n📋 Testing Geo.listGeofences...'); + const result = await Geo.listGeofences(); + const entries = (result as any).entries || []; + console.log(`✅ Found ${entries.length} geofence(s):`); + entries.forEach((g: any) => { + console.log(` - ${g.geofenceId} (created: ${g.createTime})`); + }); + const found = entries.some((g: any) => g.geofenceId === testGeofenceId); + if (!found) { + throw new Error(`Test geofence ${testGeofenceId} not found in list`); + } + console.log(` ✅ Test geofence ${testGeofenceId} found in list`); + } + + async function testDeleteGeofences(): Promise { + console.log(`\n🗑️ Testing Geo.deleteGeofences (id: ${testGeofenceId})...`); + const result = await Geo.deleteGeofences([testGeofenceId]); + const errors = (result as any).errors || []; + if (errors.length > 0) { + throw new Error(`deleteGeofences had errors: ${JSON.stringify(errors)}`); + } + console.log('✅ Geofence deleted successfully'); + } + + return { + testSearchByText, + testSearchByCoordinates, + testSaveGeofences, + testGetGeofence, + testListGeofences, + testDeleteGeofences, + }; +} + +// ============================================================ +// Shared Test Orchestration Functions +// ============================================================ + +export function createTestOrchestrator(testFunctions: ReturnType, runner: TestRunner) { + async function runSearchTests(): Promise { + console.log('\n' + '='.repeat(50)); + console.log('🔍 PART 1: Location Search (Place Index)'); + console.log('='.repeat(50)); + + await runner.runTest('searchByText', testFunctions.testSearchByText); + await runner.runTest('searchByCoordinates', testFunctions.testSearchByCoordinates); + } + + async function runGeofenceTests(): Promise { + console.log('\n' + '='.repeat(50)); + console.log('📐 PART 2: Geofence Operations'); + console.log('='.repeat(50)); + + const geofenceId = await runner.runTest('saveGeofences', testFunctions.testSaveGeofences); + if (geofenceId) { + await runner.runTest('getGeofence', testFunctions.testGetGeofence); + await runner.runTest('listGeofences', testFunctions.testListGeofences); + await runner.runTest('deleteGeofences', testFunctions.testDeleteGeofences); + } + } + + return { + runSearchTests, + runGeofenceTests, + }; +} diff --git a/amplify-migration-apps/store-locator/tsconfig.app.json b/amplify-migration-apps/store-locator/tsconfig.app.json new file mode 100644 index 00000000000..a9b5a59ca64 --- /dev/null +++ b/amplify-migration-apps/store-locator/tsconfig.app.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2022", + "useDefineForClassFields": true, + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "module": "ESNext", + "types": ["vite/client"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["src"] +} diff --git a/amplify-migration-apps/store-locator/tsconfig.json b/amplify-migration-apps/store-locator/tsconfig.json new file mode 100644 index 00000000000..1ffef600d95 --- /dev/null +++ b/amplify-migration-apps/store-locator/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/amplify-migration-apps/store-locator/tsconfig.node.json b/amplify-migration-apps/store-locator/tsconfig.node.json new file mode 100644 index 00000000000..8a67f62f4ce --- /dev/null +++ b/amplify-migration-apps/store-locator/tsconfig.node.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "ES2023", + "lib": ["ES2023"], + "module": "ESNext", + "types": ["node"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/amplify-migration-apps/store-locator/vite.config.ts b/amplify-migration-apps/store-locator/vite.config.ts new file mode 100644 index 00000000000..8d84b235208 --- /dev/null +++ b/amplify-migration-apps/store-locator/vite.config.ts @@ -0,0 +1,15 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [react()], + define: { + global: 'globalThis', + }, + resolve: { + alias: { + './runtimeConfig': './runtimeConfig.browser', + }, + }, +}); diff --git a/packages/amplify-cli/package.json b/packages/amplify-cli/package.json index 89caa667a6d..5d311cf5d93 100644 --- a/packages/amplify-cli/package.json +++ b/packages/amplify-cli/package.json @@ -89,7 +89,7 @@ "amplify-python-function-runtime-provider": "2.4.54", "aws-cdk-lib": "~2.189.1", "bottleneck": "2.19.5", - "cdk-from-cfn": "^0.271.0", + "cdk-from-cfn": "^0.291.0", "chalk": "^4.1.1", "ci-info": "^3.8.0", "cli-table3": "^0.6.0", diff --git a/packages/amplify-cli/src/__tests__/commands/gen2-migration/generate.test.ts b/packages/amplify-cli/src/__tests__/commands/gen2-migration/generate.test.ts index d692cf96f55..41c5aa3ffb8 100644 --- a/packages/amplify-cli/src/__tests__/commands/gen2-migration/generate.test.ts +++ b/packages/amplify-cli/src/__tests__/commands/gen2-migration/generate.test.ts @@ -66,6 +66,10 @@ test('mood-board snapshot', async () => { await testSnapshot('mood-board', { buildSpec: BUILDSPEC }); }); +test('store-locator snapshot', async () => { + await testSnapshot('store-locator', { buildSpec: BUILDSPEC }); +}); + async function testSnapshot(appName: string, appOptions?: MigrationAppOptions, customize?: (app: MigrationApp) => Promise) { await MigrationApp.run( appName, diff --git a/packages/amplify-cli/src/commands/gen2-migration/_validations.ts b/packages/amplify-cli/src/commands/gen2-migration/_validations.ts index 13f66c44da2..ad9db7afd16 100644 --- a/packages/amplify-cli/src/commands/gen2-migration/_validations.ts +++ b/packages/amplify-cli/src/commands/gen2-migration/_validations.ts @@ -97,7 +97,6 @@ export class AmplifyGen2MigrationValidations { const statefulRemoves: Array<{ category: string; resourceType: string; physicalId: string }> = []; for (const change of changeSet.Changes) { if (change.Type === 'Resource' && change.ResourceChange?.Action === 'Remove' && change.ResourceChange?.ResourceType) { - // Skip deployment bucket only when explicitly requested (e.g., during decommission) if ( deploymentBucketName && change.ResourceChange.ResourceType === 'AWS::S3::Bucket' && diff --git a/packages/amplify-cli/src/commands/gen2-migration/generate.ts b/packages/amplify-cli/src/commands/gen2-migration/generate.ts index 4f1cae47c25..f523c98bb2b 100644 --- a/packages/amplify-cli/src/commands/gen2-migration/generate.ts +++ b/packages/amplify-cli/src/commands/gen2-migration/generate.ts @@ -24,6 +24,7 @@ import { S3Generator } from './generate/amplify/storage/s3.generator'; import { DynamoDBGenerator } from './generate/amplify/storage/dynamodb.generator'; import { FunctionGenerator } from './generate/amplify/function/function.generator'; import { AnalyticsKinesisGenerator } from './generate/amplify/analytics/kinesis.generator'; +import { GeoGenerator } from './generate/amplify/geo/geo.generator'; import { fileOrDirectoryExists } from './generate/_infra/files'; const AMPLIFY_DIR = 'amplify'; @@ -47,6 +48,9 @@ export class AmplifyMigrationGenerateStep extends AmplifyMigrationStep { case 'api:API Gateway': case 'analytics:Kinesis': case 'function:Lambda': + case 'geo:Map': + case 'geo:PlaceIndex': + case 'geo:GeofenceCollection': assessment.record('generate', resource, { supported: true }); break; case 'unsupported': @@ -70,6 +74,7 @@ export class AmplifyMigrationGenerateStep extends AmplifyMigrationStep { // Cross-category state captured during the loop. let authGenerator: AuthGenerator | undefined; let s3Generator: S3Generator | undefined; + let geoGenerator: GeoGenerator | undefined; const functionGenerators: FunctionGenerator[] = []; for (const resource of discovered) { @@ -110,6 +115,15 @@ export class AmplifyMigrationGenerateStep extends AmplifyMigrationStep { case 'analytics:Kinesis': generators.push(new AnalyticsKinesisGenerator(gen1App, backendGenerator, outputDir, resource)); break; + case 'geo:Map': + case 'geo:PlaceIndex': + case 'geo:GeofenceCollection': + // All geo services share a single GeoGenerator instance. + if (!geoGenerator) { + geoGenerator = new GeoGenerator(gen1App, backendGenerator, outputDir, resource); + generators.push(geoGenerator); + } + break; case 'function:Lambda': { const functionCategoryMap = computeFunctionCategories(gen1App); const funcGen = new FunctionGenerator({ diff --git a/packages/amplify-cli/src/commands/gen2-migration/generate/_infra/gen1-app.ts b/packages/amplify-cli/src/commands/gen2-migration/generate/_infra/gen1-app.ts index 0c35890c2d6..2b9e7481ebc 100644 --- a/packages/amplify-cli/src/commands/gen2-migration/generate/_infra/gen1-app.ts +++ b/packages/amplify-cli/src/commands/gen2-migration/generate/_infra/gen1-app.ts @@ -36,6 +36,9 @@ export const SUPPORTED_RESOURCE_KEYS = [ 'api:API Gateway', 'analytics:Kinesis', 'function:Lambda', + 'geo:Map', + 'geo:PlaceIndex', + 'geo:GeofenceCollection', ] as const; /** diff --git a/packages/amplify-cli/src/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.ts b/packages/amplify-cli/src/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.ts new file mode 100644 index 00000000000..e9b00f8845c --- /dev/null +++ b/packages/amplify-cli/src/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.ts @@ -0,0 +1,316 @@ +import * as path from 'path'; +import * as fs from 'fs/promises'; +import * as cdk_from_cfn from 'cdk-from-cfn'; +import CFNConditionResolver from '../analytics/cfn-condition-resolver'; +import { GetObjectCommand, S3Client } from '@aws-sdk/client-s3'; +import { CloudFormationClient, DescribeStackResourcesCommand, DescribeStacksCommand, Parameter } from '@aws-sdk/client-cloudformation'; + +/** + * Geo service type from Gen1 amplify-meta.json. + */ +export type GeoServiceName = 'Map' | 'PlaceIndex' | 'GeofenceCollection'; + +/** + * Provider metadata for a Gen1 geo resource. + */ +export interface GeoProviderMetadata { + readonly s3TemplateURL: string; + readonly logicalId: string; +} + +/** + * Base fields common to all geo codegen results. + */ +interface GeoCodegenResultBase { + readonly constructClassName: string; + readonly constructFileName: string; + readonly resourceName: string; + readonly userPoolIdParamName: string; + readonly groupRoles: ReadonlyArray<{ readonly paramName: string; readonly groupName: string }>; + readonly isDefault: string; +} + +export interface MapCodegenResult extends GeoCodegenResultBase { + readonly serviceName: 'Map'; + readonly mapName: string; + readonly mapStyle: string; +} + +export interface PlaceIndexCodegenResult extends GeoCodegenResultBase { + readonly serviceName: 'PlaceIndex'; + readonly indexName: string; + readonly dataProvider: string; + readonly dataSourceIntendedUse: string; +} + +export interface GeofenceCollectionCodegenResult extends GeoCodegenResultBase { + readonly serviceName: 'GeofenceCollection'; + readonly collectionName: string; +} + +export type GeoCodegenResult = MapCodegenResult | PlaceIndexCodegenResult | GeofenceCollectionCodegenResult; + +/** + * Converts geo CloudFormation templates to CDK constructs using cdk-from-cfn. + * + * Handles all three geo service types (Map, PlaceIndex, GeofenceCollection). + * Downloads the nested stack's CFN template from S3, resolves conditions, + * fixes Fn::FindInMap dictionary lookups, and runs cdk-from-cfn to produce + * a TypeScript CDK construct file. + */ +export class GeoCfnConverter { + private readonly dir: string; + private readonly fileWriter: (content: string, filePath: string) => Promise; + private readonly s3Client: S3Client; + private readonly cfnClient?: CloudFormationClient; + private readonly rootStackName?: string; + + public constructor( + dir: string, + fileWriter: (content: string, filePath: string) => Promise, + s3Client: S3Client, + cfnClient?: CloudFormationClient, + rootStackName?: string, + ) { + this.dir = dir; + this.fileWriter = fileWriter; + this.s3Client = s3Client; + this.cfnClient = cfnClient; + this.rootStackName = rootStackName; + } + + /** + * Converts a geo CloudFormation template to a CDK L1 construct. + */ + public async generateGeoL1Code( + resourceName: string, + service: GeoServiceName, + providerMetadata: GeoProviderMetadata, + ): Promise { + const constructFileName = `${resourceName}-construct`; + const filePath = path.join(this.dir, 'amplify', 'geo', resourceName, `${constructFileName}.ts`); + const template = await getCfnTemplateFromS3(providerMetadata.s3TemplateURL, this.s3Client); + const nestedStackLogicalId = providerMetadata.logicalId; + + const parameters = await this.getNestedStackParameters(nestedStackLogicalId); + const finalTemplate = await this.preTransmute(template, nestedStackLogicalId); + const tsFile = cdk_from_cfn.transmute(JSON.stringify(finalTemplate), 'typescript', nestedStackLogicalId, 'construct'); + const fixedTsFile = this.postTransmute(tsFile); + + await fs.mkdir(path.dirname(filePath), { recursive: true }); + + const prettier = await import('prettier'); + const formatted = prettier.format(fixedTsFile, { + parser: 'typescript', + singleQuote: true, + tabWidth: 2, + printWidth: 80, + }); + await this.fileWriter(formatted, filePath); + + const classNameMatch = fixedTsFile.match(/export class (\w+) extends/); + if (!classNameMatch) { + throw new Error(`Failed to extract class name from generated construct for geo resource: ${resourceName}`); + } + const constructClassName = classNameMatch[1]; + + const paramMap = new Map( + parameters + .filter( + (p): p is { ParameterKey: string; ParameterValue: string } => p.ParameterKey !== undefined && p.ParameterValue !== undefined, + ) + .map((p) => [p.ParameterKey, p.ParameterValue]), + ); + + let userPoolIdParamName = ''; + const groupRoles: Array<{ readonly paramName: string; readonly groupName: string }> = []; + for (const [key] of paramMap) { + if (key.startsWith('auth') && key.endsWith('UserPoolId')) { + userPoolIdParamName = key; + } else if (key.startsWith('authuserPoolGroups') && key.endsWith('GroupRole')) { + const groupName = key.slice('authuserPoolGroups'.length, -'GroupRole'.length); + groupRoles.push({ paramName: key, groupName }); + } + } + + const base: GeoCodegenResultBase = { + constructClassName, + constructFileName, + resourceName, + userPoolIdParamName, + groupRoles, + isDefault: paramMap.get('isDefault') ?? 'false', + }; + + switch (service) { + case 'Map': + return { + ...base, + serviceName: 'Map', + mapName: paramMap.get('mapName') ?? resourceName, + mapStyle: paramMap.get('mapStyle') ?? '', + }; + case 'PlaceIndex': + return { + ...base, + serviceName: 'PlaceIndex', + indexName: paramMap.get('indexName') ?? resourceName, + dataProvider: paramMap.get('dataProvider') ?? '', + dataSourceIntendedUse: paramMap.get('dataSourceIntendedUse') ?? '', + }; + case 'GeofenceCollection': + return { + ...base, + serviceName: 'GeofenceCollection', + collectionName: paramMap.get('collectionName') ?? resourceName, + }; + default: { + const _exhaustiveCheck: never = service; + throw new Error(`Unsupported geo service type: ${_exhaustiveCheck}`); + } + } + } + + private async getNestedStackPhysicalName(logicalId: string): Promise { + if (!this.cfnClient || !this.rootStackName) return undefined; + + const response = await this.cfnClient.send( + new DescribeStackResourcesCommand({ StackName: this.rootStackName, LogicalResourceId: logicalId }), + ); + return response.StackResources?.[0]?.PhysicalResourceId; + } + + private async getNestedStackParameters(logicalId: string): Promise { + if (!this.cfnClient || !this.rootStackName) return []; + + const nestedStackName = await this.getNestedStackPhysicalName(logicalId); + if (!nestedStackName) return []; + + const response = await this.cfnClient.send(new DescribeStacksCommand({ StackName: nestedStackName })); + return response.Stacks?.[0]?.Parameters ?? []; + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + private async preTransmute(template: any, logicalId: string): Promise { + const result = JSON.parse(JSON.stringify(template)); + + // Rename env → branchName + if (result.Parameters?.env) { + result.Parameters['branchName'] = result.Parameters.env; + delete result.Parameters.env; + } + + const updateRefs = (obj: unknown): void => { + if (typeof obj === 'object' && obj !== null) { + const record = obj as Record; + if (record.Ref === 'env') { + record.Ref = 'branchName'; + } + Object.values(record).forEach(updateRefs); + } + }; + updateRefs(result.Resources); + + // Replace Fn::Join patterns that construct group role names from + // UserPoolId + GroupRole with direct Ref to the GroupRole parameter. + // This preserves CDK tokens for cross-stack dependency tracking. + if (result.Parameters) { + const groupRoleParams = Object.keys(result.Parameters).filter( + (key: string) => key.startsWith('authuserPoolGroups') && key.endsWith('GroupRole'), + ); + + const replaceGroupRoleJoins = (obj: unknown): void => { + if (typeof obj !== 'object' || obj === null) return; + const record = obj as Record; + + for (const [key, value] of Object.entries(record)) { + if (typeof value === 'object' && value !== null && 'Fn::Join' in value) { + const joinValue = value as { 'Fn::Join': [string, unknown[]] }; + const [separator, parts] = joinValue['Fn::Join']; + if ( + separator === '-' && + Array.isArray(parts) && + parts.length === 2 && + typeof parts[0] === 'object' && + parts[0] !== null && + 'Ref' in parts[0] && + typeof parts[1] === 'string' && + parts[1].endsWith('GroupRole') + ) { + const groupRoleSuffix = parts[1]; + const matchingParam = groupRoleParams.find((p) => p.endsWith(groupRoleSuffix)); + if (matchingParam) { + record[key] = { Ref: matchingParam }; + } + } + } else { + replaceGroupRoleJoins(value); + } + } + }; + replaceGroupRoleJoins(result.Resources); + } + + // Resolve CFN conditions using deployed stack parameters + const parameters = await this.getNestedStackParameters(logicalId); + if (parameters.length > 0) { + const resolved = new CFNConditionResolver(result).resolve(parameters); + delete resolved.Conditions; + return resolved; + } + + return result; + } + + /** + * Fixes Fn::FindInMap dictionary lookups generated by cdk-from-cfn. + * + * cdk-from-cfn translates CFN Fn::FindInMap into plain dictionary lookups + * which fail at CDK synth time because this.region is a CDK Token. + * This replaces them with cdk.CfnMapping + findInMap() calls. + */ + private postTransmute(tsCode: string): string { + const mappingVarNames: string[] = []; + let result = tsCode.replace( + /const (\w+):\s*Record>\s*=\s*\{([\s\S]*?)\n(\s*)\};/g, + (_match, varName: string, mappingBody: string, indent: string) => { + mappingVarNames.push(varName); + const constructId = varName.charAt(0).toUpperCase() + varName.slice(1); + return `const ${varName} = new cdk.CfnMapping(this, '${constructId}', {\n${indent} mapping: {${mappingBody}\n${indent} },\n${indent}});`; + }, + ); + + for (const varName of mappingVarNames) { + const lookupRegex = new RegExp(`${varName}\\[([^\\]]+)\\]\\[(['"])([^'"]+)\\2\\]`, 'g'); + result = result.replace(lookupRegex, (_match, expr: string, quote: string, key: string) => { + return `${varName}.findInMap(${expr}, ${quote}${key}${quote})`; + }); + } + + return result; + } +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +async function getCfnTemplateFromS3(s3Url: string, s3Client: S3Client): Promise { + const url = new URL(s3Url); + let bucket: string; + let key: string; + + const virtualHostMatch = url.hostname.match(/^(.+)\.s3[.-].*\.amazonaws\.com$/); + + if (virtualHostMatch) { + bucket = virtualHostMatch[1]; + key = url.pathname.slice(1); + } else { + const splitPath = url.pathname.split('/'); + bucket = splitPath[1]; + key = splitPath.slice(2).join('/'); + } + + const response = await s3Client.send(new GetObjectCommand({ Bucket: bucket, Key: key })); + if (!response.Body) { + throw new Error(`Failed to retrieve S3 object: ${s3Url}`); + } + return JSON.parse(await response.Body.transformToString()); +} diff --git a/packages/amplify-cli/src/commands/gen2-migration/generate/amplify/geo/geo.generator.ts b/packages/amplify-cli/src/commands/gen2-migration/generate/amplify/geo/geo.generator.ts new file mode 100644 index 00000000000..ee0e65cb048 --- /dev/null +++ b/packages/amplify-cli/src/commands/gen2-migration/generate/amplify/geo/geo.generator.ts @@ -0,0 +1,128 @@ +import path from 'node:path'; +import fs from 'node:fs/promises'; +import ts from 'typescript'; +import { Planner } from '../../../planner'; +import { AmplifyMigrationOperation } from '../../../_operation'; +import { BackendGenerator } from '../backend.generator'; +import { DiscoveredResource, Gen1App } from '../../_infra/gen1-app'; +import { TS } from '../../_infra/ts'; +import { GeoRenderer } from './geo.renderer'; +import { GeoCfnConverter, GeoCodegenResult, GeoServiceName, GeoProviderMetadata } from './geo-cfn-converter'; + +const factory = ts.factory; + +/** + * Metadata for a single Gen1 geo resource from amplify-meta.json. + */ +interface GeoResourceMeta { + readonly service: string; + readonly providerMetadata: GeoProviderMetadata; + readonly isDefault?: boolean; +} + +/** + * Generates geo resource files and contributes to backend.ts. + * + * Handles all three geo service types (Map, PlaceIndex, GeofenceCollection). + * For each resource, generates a CDK construct file via cdk-from-cfn and a + * per-resource resource.ts. Then generates a top-level geo/resource.ts + * aggregator that imports all sub-resources and calls backend.addOutput() + * with geo configuration. Contributes defineGeo import and call to backend.ts. + */ +export class GeoGenerator implements Planner { + private readonly gen1App: Gen1App; + private readonly backendGenerator: BackendGenerator; + private readonly outputDir: string; + private readonly renderer: GeoRenderer; + private readonly resource: DiscoveredResource; + + public constructor(gen1App: Gen1App, backendGenerator: BackendGenerator, outputDir: string, resource: DiscoveredResource) { + this.gen1App = gen1App; + this.backendGenerator = backendGenerator; + this.outputDir = outputDir; + this.renderer = new GeoRenderer(); + this.resource = resource; + } + + /** + * Plans geo generation operations for all geo resources. + */ + public async plan(): Promise { + const geoCategory = this.gen1App.meta('geo'); + if (!geoCategory) return []; + + const geoDir = path.join(this.outputDir, 'amplify', 'geo'); + const allCodegenResults: GeoCodegenResult[] = []; + + const operations: AmplifyMigrationOperation[] = []; + + for (const [resourceName, resourceMeta] of Object.entries(geoCategory)) { + const meta = resourceMeta as GeoResourceMeta; + const service = meta.service as GeoServiceName; + + operations.push({ + resource: this.resource, + validate: () => undefined, + describe: async () => [`Generate amplify/geo/${resourceName}/resource.ts`], + execute: async () => { + const fileWriter = async (content: string, filePath: string) => { + await fs.mkdir(path.dirname(filePath), { recursive: true }); + await fs.writeFile(filePath, content, 'utf-8'); + }; + + const converter = new GeoCfnConverter( + this.outputDir, + fileWriter, + this.gen1App.clients.s3, + this.gen1App.clients.cloudFormation, + this.gen1App.rootStackName, + ); + + const codegenResult = await converter.generateGeoL1Code(resourceName, service, meta.providerMetadata); + allCodegenResults.push(codegenResult); + + const nodes = this.renderer.renderResource(codegenResult); + const content = TS.printNodes(nodes); + + const resourceDir = path.join(geoDir, resourceName); + await fs.mkdir(resourceDir, { recursive: true }); + await fs.writeFile(path.join(resourceDir, 'resource.ts'), content, 'utf-8'); + }, + }); + } + + // Top-level geo/resource.ts aggregator — runs after all per-resource operations + operations.push({ + validate: () => undefined, + describe: async () => ['Generate amplify/geo/resource.ts'], + execute: async () => { + const nodes = this.renderer.renderAggregator(allCodegenResults); + const content = TS.printNodes(nodes); + + await fs.mkdir(geoDir, { recursive: true }); + await fs.writeFile(path.join(geoDir, 'resource.ts'), content, 'utf-8'); + + // Contribute to backend.ts + this.backendGenerator.addImport('./geo/resource', ['defineGeo']); + this.backendGenerator.addEarlyStatement( + factory.createVariableStatement( + undefined, + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + 'geo', + undefined, + undefined, + factory.createCallExpression(factory.createIdentifier('defineGeo'), undefined, [factory.createIdentifier('backend')]), + ), + ], + ts.NodeFlags.Const, + ), + ), + ); + }, + }); + + return operations; + } +} diff --git a/packages/amplify-cli/src/commands/gen2-migration/generate/amplify/geo/geo.renderer.ts b/packages/amplify-cli/src/commands/gen2-migration/generate/amplify/geo/geo.renderer.ts new file mode 100644 index 00000000000..910a7e3fed6 --- /dev/null +++ b/packages/amplify-cli/src/commands/gen2-migration/generate/amplify/geo/geo.renderer.ts @@ -0,0 +1,336 @@ +import ts from 'typescript'; +import { newLineIdentifier, TS } from '../../_infra/ts'; +import { GeoCodegenResult } from './geo-cfn-converter'; + +const factory = ts.factory; + +/** + * Renders per-resource and aggregator geo resource.ts files. + * Pure AST construction — no AWS calls, no side effects. + */ +export class GeoRenderer { + /** + * Renders a per-resource geo/{resourceName}/resource.ts file. + * + * Produces a defineXxx function that creates a CDK stack, + * instantiates the generated construct, and returns it. + */ + public renderResource(params: GeoCodegenResult): ts.NodeArray { + const { constructClassName, constructFileName, resourceName } = params; + + const constructImport = factory.createImportDeclaration( + undefined, + factory.createImportClause( + false, + undefined, + factory.createNamedImports([factory.createImportSpecifier(false, undefined, factory.createIdentifier(constructClassName))]), + ), + factory.createStringLiteral(`./${constructFileName}`), + ); + + const backendImport = factory.createImportDeclaration( + undefined, + factory.createImportClause( + false, + undefined, + factory.createNamedImports([factory.createImportSpecifier(false, undefined, factory.createIdentifier('Backend'))]), + ), + factory.createStringLiteral('@aws-amplify/backend'), + ); + + const branchNameConst = TS.createBranchNameDeclaration(); + const functionName = `define${resourceName.charAt(0).toUpperCase()}${resourceName.slice(1)}`; + + const createStackCall = TS.constDecl( + `${resourceName}Stack`, + factory.createCallExpression(TS.propAccess('backend', 'createStack') as ts.PropertyAccessExpression, undefined, [ + factory.createStringLiteral(`geo${resourceName}`), + ]), + ); + + const constructProps = this.buildConstructProps(params); + + const constructInstantiation = TS.constDecl( + resourceName, + factory.createNewExpression(factory.createIdentifier(constructClassName), undefined, [ + factory.createIdentifier(`${resourceName}Stack`), + factory.createStringLiteral(resourceName), + factory.createObjectLiteralExpression(constructProps, true), + ]), + ); + + const returnStatement = factory.createReturnStatement(factory.createIdentifier(resourceName)); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Backend in generated code + const arrowFunction = factory.createArrowFunction( + undefined, + undefined, + [ + factory.createParameterDeclaration( + undefined, + undefined, + factory.createIdentifier('backend'), + undefined, + factory.createTypeReferenceNode(factory.createIdentifier('Backend'), [factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)]), + ), + ], + undefined, + factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), + factory.createBlock([createStackCall, constructInstantiation, returnStatement], true), + ); + + const exportStatement = factory.createVariableStatement( + [factory.createModifier(ts.SyntaxKind.ExportKeyword)], + factory.createVariableDeclarationList( + [factory.createVariableDeclaration(factory.createIdentifier(functionName), undefined, undefined, arrowFunction)], + ts.NodeFlags.Const, + ), + ); + + return factory.createNodeArray([ + constructImport, + backendImport, + newLineIdentifier, + branchNameConst, + newLineIdentifier, + exportStatement, + ]); + } + + /** + * Renders the top-level geo/resource.ts aggregator that imports all + * sub-resources and calls backend.addOutput() with geo configuration. + */ + public renderAggregator(resources: readonly GeoCodegenResult[]): ts.NodeArray { + const resourceImports = resources.map((r) => { + const functionName = `define${r.resourceName.charAt(0).toUpperCase()}${r.resourceName.slice(1)}`; + return factory.createImportDeclaration( + undefined, + factory.createImportClause( + false, + undefined, + factory.createNamedImports([factory.createImportSpecifier(false, undefined, factory.createIdentifier(functionName))]), + ), + factory.createStringLiteral(`./${r.resourceName}/resource`), + ); + }); + + const backendImport = factory.createImportDeclaration( + undefined, + factory.createImportClause( + false, + undefined, + factory.createNamedImports([factory.createImportSpecifier(false, undefined, factory.createIdentifier('Backend'))]), + ), + factory.createStringLiteral('@aws-amplify/backend'), + ); + + const functionAssignments = resources.map((r) => { + const functionName = `define${r.resourceName.charAt(0).toUpperCase()}${r.resourceName.slice(1)}`; + return TS.constDecl( + r.resourceName, + factory.createCallExpression(factory.createIdentifier(functionName), undefined, [factory.createIdentifier('backend')]), + ); + }); + + const addOutputStatement = this.buildAddOutputStatement(resources); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Backend in generated code + const arrowFunction = factory.createArrowFunction( + undefined, + undefined, + [ + factory.createParameterDeclaration( + undefined, + undefined, + factory.createIdentifier('backend'), + undefined, + factory.createTypeReferenceNode(factory.createIdentifier('Backend'), [factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)]), + ), + ], + undefined, + factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), + factory.createBlock([...functionAssignments, addOutputStatement], true), + ); + + const exportStatement = factory.createVariableStatement( + [factory.createModifier(ts.SyntaxKind.ExportKeyword)], + factory.createVariableDeclarationList( + [factory.createVariableDeclaration(factory.createIdentifier('defineGeo'), undefined, undefined, arrowFunction)], + ts.NodeFlags.Const, + ), + ); + + return factory.createNodeArray([...resourceImports, backendImport, newLineIdentifier, exportStatement]); + } + + private buildConstructProps(params: GeoCodegenResult): ts.ObjectLiteralElementLike[] { + const props: ts.ObjectLiteralElementLike[] = []; + + // Map and PlaceIndex get authRoleName/unauthRoleName; GeofenceCollection does not + if (params.serviceName === 'Map' || params.serviceName === 'PlaceIndex') { + props.push(factory.createPropertyAssignment(factory.createIdentifier('authRoleName'), createAuthRoleAccess())); + props.push(factory.createPropertyAssignment(factory.createIdentifier('unauthRoleName'), createUnauthRoleAccess())); + } + + if (params.userPoolIdParamName) { + props.push(factory.createPropertyAssignment(factory.createIdentifier(params.userPoolIdParamName), createUserPoolIdAccess())); + } + + for (const groupRole of params.groupRoles) { + props.push( + factory.createPropertyAssignment(factory.createIdentifier(groupRole.paramName), createGroupRoleAccess(groupRole.groupName)), + ); + } + + props.push(...this.getServiceSpecificProps(params)); + props.push(factory.createShorthandPropertyAssignment(factory.createIdentifier('branchName'))); + props.push(factory.createPropertyAssignment(factory.createIdentifier('isDefault'), factory.createStringLiteral(params.isDefault))); + + return props; + } + + private getServiceSpecificProps(params: GeoCodegenResult): ts.PropertyAssignment[] { + switch (params.serviceName) { + case 'Map': + return [ + factory.createPropertyAssignment(factory.createIdentifier('mapName'), factory.createStringLiteral(params.mapName)), + factory.createPropertyAssignment(factory.createIdentifier('mapStyle'), factory.createStringLiteral(params.mapStyle)), + ]; + case 'PlaceIndex': + return [ + factory.createPropertyAssignment(factory.createIdentifier('indexName'), factory.createStringLiteral(params.indexName)), + factory.createPropertyAssignment(factory.createIdentifier('dataProvider'), factory.createStringLiteral(params.dataProvider)), + factory.createPropertyAssignment( + factory.createIdentifier('dataSourceIntendedUse'), + factory.createStringLiteral(params.dataSourceIntendedUse), + ), + ]; + case 'GeofenceCollection': + return [ + factory.createPropertyAssignment(factory.createIdentifier('collectionName'), factory.createStringLiteral(params.collectionName)), + ]; + default: { + const _exhaustiveCheck: never = params; + throw new Error(`Unsupported geo service type: ${(_exhaustiveCheck as GeoCodegenResult).serviceName}`); + } + } + } + + private buildAddOutputStatement(resources: readonly GeoCodegenResult[]): ts.ExpressionStatement { + const maps = resources.filter((r) => r.serviceName === 'Map'); + const placeIndexes = resources.filter((r) => r.serviceName === 'PlaceIndex'); + const geofenceCollections = resources.filter((r) => r.serviceName === 'GeofenceCollection'); + + const geoProps: ts.ObjectLiteralElementLike[] = []; + + const firstResource = maps[0] ?? placeIndexes[0] ?? geofenceCollections[0]; + geoProps.push( + factory.createPropertyAssignment(factory.createIdentifier('aws_region'), TS.propAccess(firstResource.resourceName, 'region')), + ); + + if (maps.length > 0) { + geoProps.push(this.buildMapsSection(maps)); + } + if (placeIndexes.length > 0) { + geoProps.push(this.buildSearchIndicesSection(placeIndexes)); + } + if (geofenceCollections.length > 0) { + geoProps.push(this.buildGeofenceCollectionsSection(geofenceCollections)); + } + + return factory.createExpressionStatement( + factory.createCallExpression(TS.propAccess('backend', 'addOutput') as ts.PropertyAccessExpression, undefined, [ + factory.createObjectLiteralExpression( + [factory.createPropertyAssignment(factory.createIdentifier('geo'), factory.createObjectLiteralExpression(geoProps, true))], + true, + ), + ]), + ); + } + + private buildMapsSection(maps: readonly GeoCodegenResult[]): ts.PropertyAssignment { + const mapItems = maps.map((m) => + factory.createPropertyAssignment( + factory.createComputedPropertyName(TS.propAccess(m.resourceName, 'name')), + factory.createObjectLiteralExpression([ + factory.createPropertyAssignment(factory.createIdentifier('style'), TS.propAccess(m.resourceName, 'style')), + ]), + ), + ); + const defaultMap = maps.find((m) => m.serviceName === 'Map' && m.isDefault === 'true') ?? maps[0]; + + return factory.createPropertyAssignment( + factory.createIdentifier('maps'), + factory.createObjectLiteralExpression( + [ + factory.createPropertyAssignment(factory.createIdentifier('items'), factory.createObjectLiteralExpression(mapItems, true)), + factory.createPropertyAssignment(factory.createIdentifier('default'), TS.propAccess(defaultMap.resourceName, 'name')), + ], + true, + ), + ); + } + + private buildSearchIndicesSection(placeIndexes: readonly GeoCodegenResult[]): ts.PropertyAssignment { + const indexItems = placeIndexes.map((p) => TS.propAccess(p.resourceName, 'name')); + const defaultIndex = placeIndexes.find((p) => p.serviceName === 'PlaceIndex' && p.isDefault === 'true') ?? placeIndexes[0]; + + return factory.createPropertyAssignment( + factory.createIdentifier('search_indices'), + factory.createObjectLiteralExpression( + [ + factory.createPropertyAssignment(factory.createIdentifier('items'), factory.createArrayLiteralExpression(indexItems)), + factory.createPropertyAssignment(factory.createIdentifier('default'), TS.propAccess(defaultIndex.resourceName, 'name')), + ], + true, + ), + ); + } + + private buildGeofenceCollectionsSection(geofenceCollections: readonly GeoCodegenResult[]): ts.PropertyAssignment { + const collectionItems = geofenceCollections.map((g) => TS.propAccess(g.resourceName, 'name')); + const defaultCollection = + geofenceCollections.find((g) => g.serviceName === 'GeofenceCollection' && g.isDefault === 'true') ?? geofenceCollections[0]; + + return factory.createPropertyAssignment( + factory.createIdentifier('geofence_collections'), + factory.createObjectLiteralExpression( + [ + factory.createPropertyAssignment(factory.createIdentifier('items'), factory.createArrayLiteralExpression(collectionItems)), + factory.createPropertyAssignment(factory.createIdentifier('default'), TS.propAccess(defaultCollection.resourceName, 'name')), + ], + true, + ), + ); + } +} + +/** backend.auth.resources.authenticatedUserIamRole.roleName */ +function createAuthRoleAccess(): ts.PropertyAccessExpression { + return TS.propAccess('backend', 'auth', 'resources', 'authenticatedUserIamRole', 'roleName') as ts.PropertyAccessExpression; +} + +/** backend.auth.resources.unauthenticatedUserIamRole.roleName */ +function createUnauthRoleAccess(): ts.PropertyAccessExpression { + return TS.propAccess('backend', 'auth', 'resources', 'unauthenticatedUserIamRole', 'roleName') as ts.PropertyAccessExpression; +} + +/** backend.auth.resources.userPool.userPoolId */ +function createUserPoolIdAccess(): ts.PropertyAccessExpression { + return TS.propAccess('backend', 'auth', 'resources', 'userPool', 'userPoolId') as ts.PropertyAccessExpression; +} + +/** backend.auth.resources.groups['groupName'].role.roleName */ +function createGroupRoleAccess(groupName: string): ts.PropertyAccessExpression { + return factory.createPropertyAccessExpression( + factory.createPropertyAccessExpression( + factory.createElementAccessExpression( + TS.propAccess('backend', 'auth', 'resources', 'groups') as ts.PropertyAccessExpression, + factory.createStringLiteral(groupName), + ), + factory.createIdentifier('role'), + ), + factory.createIdentifier('roleName'), + ); +} diff --git a/packages/amplify-cli/src/commands/gen2-migration/refactor/refactor.ts b/packages/amplify-cli/src/commands/gen2-migration/refactor/refactor.ts index e16ba074fef..66d63a291b8 100644 --- a/packages/amplify-cli/src/commands/gen2-migration/refactor/refactor.ts +++ b/packages/amplify-cli/src/commands/gen2-migration/refactor/refactor.ts @@ -42,8 +42,13 @@ export class AmplifyMigrationRefactorStep extends AmplifyMigrationStep { case 'function:Lambda': case 'api:AppSync': case 'api:API Gateway': + case 'geo:Map': + case 'geo:PlaceIndex': assessment.record('refactor', resource, { supported: true }); break; + case 'geo:GeofenceCollection': + assessment.record('refactor', resource, { supported: false }); + break; case 'unsupported': assessment.record('refactor', resource, { supported: false }); break; @@ -103,7 +108,13 @@ export class AmplifyMigrationRefactorStep extends AmplifyMigrationStep { case 'function:Lambda': case 'api:AppSync': case 'api:API Gateway': + case 'geo:Map': + case 'geo:PlaceIndex': break; + case 'geo:GeofenceCollection': + throw new AmplifyError('MigrationError', { + message: `Unsupported resource '${resource.resourceName}' (${resource.category}:${resource.service}). GeofenceCollection refactor is not supported.`, + }); case 'unsupported': throw new AmplifyError('MigrationError', { message: `Unsupported resource '${resource.resourceName}' (${resource.category}:${resource.service}). Run 'amplify gen2-migration assess' to check migration readiness.`, @@ -162,7 +173,13 @@ export class AmplifyMigrationRefactorStep extends AmplifyMigrationStep { case 'function:Lambda': case 'api:AppSync': case 'api:API Gateway': + case 'geo:Map': + case 'geo:PlaceIndex': break; + case 'geo:GeofenceCollection': + throw new AmplifyError('MigrationError', { + message: `Unsupported resource '${resource.resourceName}' (${resource.category}:${resource.service}). GeofenceCollection refactor is not supported. Cannot rollback.`, + }); case 'unsupported': throw new AmplifyError('MigrationError', { message: `Unsupported resource '${resource.resourceName}' (${resource.category}:${resource.service}). Cannot rollback.`, diff --git a/yarn.lock b/yarn.lock index 14b3730a9c3..cf14c3b8d9a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -235,6 +235,45 @@ __metadata: languageName: unknown linkType: soft +"@amplify-migration-apps/store-locator@workspace:amplify-migration-apps/store-locator/_snapshot.post.generate": + version: 0.0.0-use.local + resolution: "@amplify-migration-apps/store-locator@workspace:amplify-migration-apps/store-locator/_snapshot.post.generate" + dependencies: + "@aws-amplify/backend": ^1.18.0 + "@aws-amplify/backend-cli": ^1.8.0 + "@aws-amplify/backend-data": ^1.6.2 + "@aws-amplify/geo": ^3.0.92 + "@aws-amplify/ui-react": ^6.13.2 + "@aws-amplify/ui-react-geo": ^2.2.13 + "@aws-sdk/client-cognito-identity-provider": ^3.1016.0 + "@eslint/js": ^9.39.1 + "@types/aws-lambda": ^8.10.92 + "@types/node": "*" + "@types/react": ^19.2.5 + "@types/react-dom": ^19.2.3 + "@vitejs/plugin-react": ^5.1.1 + aws-amplify: ^6.16.0 + aws-cdk: ^2 + aws-cdk-lib: ^2 + axios: latest + ci-info: ^4.3.1 + constructs: ^10.0.0 + esbuild: ^0.27.0 + eslint: ^9.39.1 + eslint-plugin-react-hooks: ^7.0.1 + eslint-plugin-react-refresh: ^0.4.24 + globals: ^16.5.0 + maplibre-gl: ^2.4.0 + maplibre-gl-js-amplify: ^4.0.2 + react: ^19.2.0 + react-dom: ^19.2.0 + tsx: ^4.20.6 + typescript: ~5.9.3 + typescript-eslint: ^8.46.4 + vite: ^7.2.4 + languageName: unknown + linkType: soft + "@apideck/better-ajv-errors@npm:^0.3.1": version: 0.3.6 resolution: "@apideck/better-ajv-errors@npm:0.3.6" @@ -1748,7 +1787,7 @@ __metadata: aws-sdk-client-mock: ^4.1.0 aws-sdk-client-mock-jest: ^4.1.0 bottleneck: 2.19.5 - cdk-from-cfn: ^0.271.0 + cdk-from-cfn: ^0.291.0 chalk: ^4.1.1 ci-info: ^3.8.0 cli-table3: ^0.6.0 @@ -2163,6 +2202,21 @@ __metadata: languageName: node linkType: hard +"@aws-amplify/geo@npm:^3.0.92": + version: 3.0.93 + resolution: "@aws-amplify/geo@npm:3.0.93" + dependencies: + "@aws-sdk/client-location": 3.982.0 + "@aws-sdk/types": 3.973.1 + "@turf/boolean-clockwise": 6.5.0 + camelcase-keys: 6.2.2 + tslib: ^2.5.0 + peerDependencies: + "@aws-amplify/core": ^6.1.0 + checksum: cd277e4c1219f6d7871780d9bf68dcfa27db7cf1c8abd5b029d002d60df5bc1e68851989802d62ec3ce43e5cc0a5eecfcd6a4ff87b994b9b084d45e096548ded + languageName: node + linkType: hard + "@aws-amplify/graphql-api-construct@npm:1.21.0": version: 1.21.0 resolution: "@aws-amplify/graphql-api-construct@npm:1.21.0" @@ -3284,7 +3338,26 @@ __metadata: languageName: node linkType: hard -"@aws-amplify/ui-react@npm:^6.10.1, @aws-amplify/ui-react@npm:^6.13.0, @aws-amplify/ui-react@npm:^6.13.1": +"@aws-amplify/ui-react-geo@npm:^2.2.13": + version: 2.3.2 + resolution: "@aws-amplify/ui-react-geo@npm:2.3.2" + dependencies: + "@aws-amplify/ui-react-core": 3.6.2 + mapbox-gl: 1.13.1 + maplibre-gl: 2.1.9 + maplibre-gl-js-amplify: ^4.0.2 + react-map-gl: 7.0.23 + tslib: ^2.5.2 + peerDependencies: + "@aws-amplify/geo": ^3.0.59 + aws-amplify: ^6.14.3 + react: ^16.14 || ^17 || ^18 || ^19 + react-dom: ^16.14 || ^17 || ^18 || ^19 + checksum: 2b1dc7d24b87d165baf80bf833add37441e366dab0636672466fbf909443b5fee75f698a9a9fab2c1147183079cd5250f87c811264210833468299372db38c55 + languageName: node + linkType: hard + +"@aws-amplify/ui-react@npm:^6.10.1, @aws-amplify/ui-react@npm:^6.13.0, @aws-amplify/ui-react@npm:^6.13.1, @aws-amplify/ui-react@npm:^6.13.2": version: 6.15.2 resolution: "@aws-amplify/ui-react@npm:6.15.2" dependencies: @@ -4668,6 +4741,53 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-cognito-identity-provider@npm:^3.1016.0": + version: 3.1016.0 + resolution: "@aws-sdk/client-cognito-identity-provider@npm:3.1016.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": ^3.973.24 + "@aws-sdk/credential-provider-node": ^3.972.25 + "@aws-sdk/middleware-host-header": ^3.972.8 + "@aws-sdk/middleware-logger": ^3.972.8 + "@aws-sdk/middleware-recursion-detection": ^3.972.8 + "@aws-sdk/middleware-user-agent": ^3.972.25 + "@aws-sdk/region-config-resolver": ^3.972.9 + "@aws-sdk/types": ^3.973.6 + "@aws-sdk/util-endpoints": ^3.996.5 + "@aws-sdk/util-user-agent-browser": ^3.972.8 + "@aws-sdk/util-user-agent-node": ^3.973.11 + "@smithy/config-resolver": ^4.4.13 + "@smithy/core": ^3.23.12 + "@smithy/fetch-http-handler": ^5.3.15 + "@smithy/hash-node": ^4.2.12 + "@smithy/invalid-dependency": ^4.2.12 + "@smithy/middleware-content-length": ^4.2.12 + "@smithy/middleware-endpoint": ^4.4.27 + "@smithy/middleware-retry": ^4.4.44 + "@smithy/middleware-serde": ^4.2.15 + "@smithy/middleware-stack": ^4.2.12 + "@smithy/node-config-provider": ^4.3.12 + "@smithy/node-http-handler": ^4.5.0 + "@smithy/protocol-http": ^5.3.12 + "@smithy/smithy-client": ^4.12.7 + "@smithy/types": ^4.13.1 + "@smithy/url-parser": ^4.2.12 + "@smithy/util-base64": ^4.3.2 + "@smithy/util-body-length-browser": ^4.2.2 + "@smithy/util-body-length-node": ^4.2.3 + "@smithy/util-defaults-mode-browser": ^4.3.43 + "@smithy/util-defaults-mode-node": ^4.2.47 + "@smithy/util-endpoints": ^3.3.3 + "@smithy/util-middleware": ^4.2.12 + "@smithy/util-retry": ^4.2.12 + "@smithy/util-utf8": ^4.2.2 + tslib: ^2.6.2 + checksum: 0e664d492a912afd24645b38b0ea9a062ff3b8424784e1d930566047c83bda35823aefaeaa05e6c3e5f288be686e67f3e01362a03d0951abdf21cfcf5e997484 + languageName: node + linkType: hard + "@aws-sdk/client-cognito-identity@npm:3.1007.0, @aws-sdk/client-cognito-identity@npm:^3.919.0": version: 3.1007.0 resolution: "@aws-sdk/client-cognito-identity@npm:3.1007.0" @@ -5806,6 +5926,54 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-location@npm:3.982.0": + version: 3.982.0 + resolution: "@aws-sdk/client-location@npm:3.982.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": ^3.973.6 + "@aws-sdk/credential-provider-node": ^3.972.5 + "@aws-sdk/middleware-host-header": ^3.972.3 + "@aws-sdk/middleware-logger": ^3.972.3 + "@aws-sdk/middleware-recursion-detection": ^3.972.3 + "@aws-sdk/middleware-user-agent": ^3.972.6 + "@aws-sdk/region-config-resolver": ^3.972.3 + "@aws-sdk/types": ^3.973.1 + "@aws-sdk/util-endpoints": 3.982.0 + "@aws-sdk/util-user-agent-browser": ^3.972.3 + "@aws-sdk/util-user-agent-node": ^3.972.4 + "@smithy/config-resolver": ^4.4.6 + "@smithy/core": ^3.22.0 + "@smithy/fetch-http-handler": ^5.3.9 + "@smithy/hash-node": ^4.2.8 + "@smithy/invalid-dependency": ^4.2.8 + "@smithy/middleware-content-length": ^4.2.8 + "@smithy/middleware-endpoint": ^4.4.12 + "@smithy/middleware-retry": ^4.4.29 + "@smithy/middleware-serde": ^4.2.9 + "@smithy/middleware-stack": ^4.2.8 + "@smithy/node-config-provider": ^4.3.8 + "@smithy/node-http-handler": ^4.4.8 + "@smithy/protocol-http": ^5.3.8 + "@smithy/smithy-client": ^4.11.1 + "@smithy/types": ^4.12.0 + "@smithy/url-parser": ^4.2.8 + "@smithy/util-base64": ^4.3.0 + "@smithy/util-body-length-browser": ^4.2.0 + "@smithy/util-body-length-node": ^4.2.1 + "@smithy/util-defaults-mode-browser": ^4.3.28 + "@smithy/util-defaults-mode-node": ^4.2.31 + "@smithy/util-endpoints": ^3.2.8 + "@smithy/util-middleware": ^4.2.8 + "@smithy/util-retry": ^4.2.8 + "@smithy/util-stream": ^4.5.10 + "@smithy/util-utf8": ^4.2.0 + tslib: ^2.6.2 + checksum: 92039a4c23fe94e258f30e94d2ada3d7f08f42324f1a537003b352d0eb2e9e3ffe0b6031beb9cd9e9c685fe5e051e5e2cea562c221fafe9d50dfb79805ecf3ac + languageName: node + linkType: hard + "@aws-sdk/client-location@npm:^3.919.0": version: 3.1007.0 resolution: "@aws-sdk/client-location@npm:3.1007.0" @@ -7854,6 +8022,27 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/core@npm:^3.973.24": + version: 3.973.24 + resolution: "@aws-sdk/core@npm:3.973.24" + dependencies: + "@aws-sdk/types": ^3.973.6 + "@aws-sdk/xml-builder": ^3.972.15 + "@smithy/core": ^3.23.12 + "@smithy/node-config-provider": ^4.3.12 + "@smithy/property-provider": ^4.2.12 + "@smithy/protocol-http": ^5.3.12 + "@smithy/signature-v4": ^5.3.12 + "@smithy/smithy-client": ^4.12.7 + "@smithy/types": ^4.13.1 + "@smithy/util-base64": ^4.3.2 + "@smithy/util-middleware": ^4.2.12 + "@smithy/util-utf8": ^4.2.2 + tslib: ^2.6.2 + checksum: ab6899a7951931ea4622c7b346db0d9ff39244c306236184847840bfc527ac7e719338292e2ac154505e12f3ce64f5cc363a646f63f7559b0d7d46088f65f812 + languageName: node + linkType: hard + "@aws-sdk/crc64-nvme@npm:3.965.0": version: 3.965.0 resolution: "@aws-sdk/crc64-nvme@npm:3.965.0" @@ -7986,6 +8175,19 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-env@npm:^3.972.22": + version: 3.972.22 + resolution: "@aws-sdk/credential-provider-env@npm:3.972.22" + dependencies: + "@aws-sdk/core": ^3.973.24 + "@aws-sdk/types": ^3.973.6 + "@smithy/property-provider": ^4.2.12 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: e38dc838d46493b0a93240d08482a357d0dc8ffb448e8a41b07848f4d28592a50a6192b3d91a1406cc2a9a2fa3e02819db82e67da21ac764fef7a4f6e2253e89 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-http@npm:3.622.0": version: 3.622.0 resolution: "@aws-sdk/credential-provider-http@npm:3.622.0" @@ -8092,6 +8294,24 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-http@npm:^3.972.24": + version: 3.972.24 + resolution: "@aws-sdk/credential-provider-http@npm:3.972.24" + dependencies: + "@aws-sdk/core": ^3.973.24 + "@aws-sdk/types": ^3.973.6 + "@smithy/fetch-http-handler": ^5.3.15 + "@smithy/node-http-handler": ^4.5.0 + "@smithy/property-provider": ^4.2.12 + "@smithy/protocol-http": ^5.3.12 + "@smithy/smithy-client": ^4.12.7 + "@smithy/types": ^4.13.1 + "@smithy/util-stream": ^4.5.20 + tslib: ^2.6.2 + checksum: 7e7eb88ec8cf57d3b0a787873cc1b8f88b57132b6fbd3dfea33dbc81fae828e24bd548686dd479c79af832ad1c25bc796ed95045d60d471196512d3aad12dd33 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-imds@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-imds@npm:3.186.0" @@ -8294,6 +8514,28 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-ini@npm:^3.972.24": + version: 3.972.24 + resolution: "@aws-sdk/credential-provider-ini@npm:3.972.24" + dependencies: + "@aws-sdk/core": ^3.973.24 + "@aws-sdk/credential-provider-env": ^3.972.22 + "@aws-sdk/credential-provider-http": ^3.972.24 + "@aws-sdk/credential-provider-login": ^3.972.24 + "@aws-sdk/credential-provider-process": ^3.972.22 + "@aws-sdk/credential-provider-sso": ^3.972.24 + "@aws-sdk/credential-provider-web-identity": ^3.972.24 + "@aws-sdk/nested-clients": ^3.996.14 + "@aws-sdk/types": ^3.973.6 + "@smithy/credential-provider-imds": ^4.2.12 + "@smithy/property-provider": ^4.2.12 + "@smithy/shared-ini-file-loader": ^4.4.7 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 626483f218000bcdcbeffca6c2e16df04ea2a06ac2f87b4b839d25380debf3408688d54ce76fdb12118879bf7f0ad8ba8aedd8a23bf8898cd00688a754b1e884 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-login@npm:3.966.0": version: 3.966.0 resolution: "@aws-sdk/credential-provider-login@npm:3.966.0" @@ -8326,6 +8568,22 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-login@npm:^3.972.24": + version: 3.972.24 + resolution: "@aws-sdk/credential-provider-login@npm:3.972.24" + dependencies: + "@aws-sdk/core": ^3.973.24 + "@aws-sdk/nested-clients": ^3.996.14 + "@aws-sdk/types": ^3.973.6 + "@smithy/property-provider": ^4.2.12 + "@smithy/protocol-http": ^5.3.12 + "@smithy/shared-ini-file-loader": ^4.4.7 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 9edf24ae5d9291b69118efb542bbc3bc4ef742137b730bfbb4ac5b014297de1f37fedf44e896d8929f441a53c52e14b66ebf382de78bf7e2dd408a85f08b735c + languageName: node + linkType: hard + "@aws-sdk/credential-provider-node@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-node@npm:3.186.0" @@ -8500,6 +8758,26 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-node@npm:^3.972.25": + version: 3.972.25 + resolution: "@aws-sdk/credential-provider-node@npm:3.972.25" + dependencies: + "@aws-sdk/credential-provider-env": ^3.972.22 + "@aws-sdk/credential-provider-http": ^3.972.24 + "@aws-sdk/credential-provider-ini": ^3.972.24 + "@aws-sdk/credential-provider-process": ^3.972.22 + "@aws-sdk/credential-provider-sso": ^3.972.24 + "@aws-sdk/credential-provider-web-identity": ^3.972.24 + "@aws-sdk/types": ^3.973.6 + "@smithy/credential-provider-imds": ^4.2.12 + "@smithy/property-provider": ^4.2.12 + "@smithy/shared-ini-file-loader": ^4.4.7 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: d2b452cdd5142ee25148263d45e8f29d48d7bf6d5ba07d9faaf4e7795746c2b2906d1350edc5cf79bdf1822b6ece455765fff0bfc33ce76a8510b3b68064e904 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-process@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-process@npm:3.186.0" @@ -8594,6 +8872,20 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-process@npm:^3.972.22": + version: 3.972.22 + resolution: "@aws-sdk/credential-provider-process@npm:3.972.22" + dependencies: + "@aws-sdk/core": ^3.973.24 + "@aws-sdk/types": ^3.973.6 + "@smithy/property-provider": ^4.2.12 + "@smithy/shared-ini-file-loader": ^4.4.7 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 236048b759be7b588f5acacb7601b5589de88f45a946c425f1c4e542bd268c156083d7e2900b5c5c0d3a91a4debe3b2868d0f35d4979ad4945cc7d42c7b6acca + languageName: node + linkType: hard + "@aws-sdk/credential-provider-sso@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-sso@npm:3.186.0" @@ -8716,6 +9008,22 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-sso@npm:^3.972.24": + version: 3.972.24 + resolution: "@aws-sdk/credential-provider-sso@npm:3.972.24" + dependencies: + "@aws-sdk/core": ^3.973.24 + "@aws-sdk/nested-clients": ^3.996.14 + "@aws-sdk/token-providers": 3.1015.0 + "@aws-sdk/types": ^3.973.6 + "@smithy/property-provider": ^4.2.12 + "@smithy/shared-ini-file-loader": ^4.4.7 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 0ab0a263aec8e196044ddb3dd9577c4997117ca5991a4a9b892678c64bcfbd097bf767a776a5ca1a66999ba0b3b9df34e0b9555545f4a2cfa27b658bcdb29f79 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-web-identity@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/credential-provider-web-identity@npm:3.186.0" @@ -8801,6 +9109,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-web-identity@npm:^3.972.24": + version: 3.972.24 + resolution: "@aws-sdk/credential-provider-web-identity@npm:3.972.24" + dependencies: + "@aws-sdk/core": ^3.973.24 + "@aws-sdk/nested-clients": ^3.996.14 + "@aws-sdk/types": ^3.973.6 + "@smithy/property-provider": ^4.2.12 + "@smithy/shared-ini-file-loader": ^4.4.7 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 481a8e75cc77e7e87f76de5e146e4f5608d62914c90fa68a6a5589ada3293b1522f87557e7a1921ae41f2f743fdc808ec2f3d2d9aa9a22595fc57edd00894f99 + languageName: node + linkType: hard + "@aws-sdk/credential-providers@npm:3.721.0": version: 3.721.0 resolution: "@aws-sdk/credential-providers@npm:3.721.0" @@ -9430,6 +9753,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-host-header@npm:^3.972.8": + version: 3.972.8 + resolution: "@aws-sdk/middleware-host-header@npm:3.972.8" + dependencies: + "@aws-sdk/types": ^3.973.6 + "@smithy/protocol-http": ^5.3.12 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: f3019810e447a53788c546b94bc40a20c543aa067abf6235643d8e24689f8d4edec211297ac464380fb58c79f99803d1a152027798a3b401eab225e679a85d07 + languageName: node + linkType: hard + "@aws-sdk/middleware-location-constraint@npm:3.965.0": version: 3.965.0 resolution: "@aws-sdk/middleware-location-constraint@npm:3.965.0" @@ -9527,6 +9862,17 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-logger@npm:^3.972.8": + version: 3.972.8 + resolution: "@aws-sdk/middleware-logger@npm:3.972.8" + dependencies: + "@aws-sdk/types": ^3.973.6 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 79240b2a34d020f90f54982a4744b0a6bc5b5a7de6442f3b6657b2f10a76d9a1d3bcc2887a1d96d0aa5da4a09b3ce2a77df7a0d4e7e2973d1797ff6d8e8800a9 + languageName: node + linkType: hard + "@aws-sdk/middleware-recursion-detection@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/middleware-recursion-detection@npm:3.186.0" @@ -9601,6 +9947,19 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-recursion-detection@npm:^3.972.8": + version: 3.972.8 + resolution: "@aws-sdk/middleware-recursion-detection@npm:3.972.8" + dependencies: + "@aws-sdk/types": ^3.973.6 + "@aws/lambda-invoke-store": ^0.2.2 + "@smithy/protocol-http": ^5.3.12 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 8d8ef442befd65dd9175294ae292e2b421171c0c9db9389a6f504b97e055dc9c3b51a80c711792fbc31cd3b4976f1d71d30a378063416553e17a59f70e7eb6d1 + languageName: node + linkType: hard + "@aws-sdk/middleware-retry@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/middleware-retry@npm:3.186.0" @@ -9967,6 +10326,22 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-user-agent@npm:^3.972.25": + version: 3.972.25 + resolution: "@aws-sdk/middleware-user-agent@npm:3.972.25" + dependencies: + "@aws-sdk/core": ^3.973.24 + "@aws-sdk/types": ^3.973.6 + "@aws-sdk/util-endpoints": ^3.996.5 + "@smithy/core": ^3.23.12 + "@smithy/protocol-http": ^5.3.12 + "@smithy/types": ^4.13.1 + "@smithy/util-retry": ^4.2.12 + tslib: ^2.6.2 + checksum: d52d62a8d46ce56fdd8255ef931640890386ed49d73c46701e4dffea70bc931fd3c2429d5ed45e85995d1f32eb77e072496e4f58f167a05caf501b8ac962e2b2 + languageName: node + linkType: hard + "@aws-sdk/middleware-websocket@npm:^3.972.12": version: 3.972.12 resolution: "@aws-sdk/middleware-websocket@npm:3.972.12" @@ -10125,6 +10500,52 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/nested-clients@npm:^3.996.14": + version: 3.996.14 + resolution: "@aws-sdk/nested-clients@npm:3.996.14" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": ^3.973.24 + "@aws-sdk/middleware-host-header": ^3.972.8 + "@aws-sdk/middleware-logger": ^3.972.8 + "@aws-sdk/middleware-recursion-detection": ^3.972.8 + "@aws-sdk/middleware-user-agent": ^3.972.25 + "@aws-sdk/region-config-resolver": ^3.972.9 + "@aws-sdk/types": ^3.973.6 + "@aws-sdk/util-endpoints": ^3.996.5 + "@aws-sdk/util-user-agent-browser": ^3.972.8 + "@aws-sdk/util-user-agent-node": ^3.973.11 + "@smithy/config-resolver": ^4.4.13 + "@smithy/core": ^3.23.12 + "@smithy/fetch-http-handler": ^5.3.15 + "@smithy/hash-node": ^4.2.12 + "@smithy/invalid-dependency": ^4.2.12 + "@smithy/middleware-content-length": ^4.2.12 + "@smithy/middleware-endpoint": ^4.4.27 + "@smithy/middleware-retry": ^4.4.44 + "@smithy/middleware-serde": ^4.2.15 + "@smithy/middleware-stack": ^4.2.12 + "@smithy/node-config-provider": ^4.3.12 + "@smithy/node-http-handler": ^4.5.0 + "@smithy/protocol-http": ^5.3.12 + "@smithy/smithy-client": ^4.12.7 + "@smithy/types": ^4.13.1 + "@smithy/url-parser": ^4.2.12 + "@smithy/util-base64": ^4.3.2 + "@smithy/util-body-length-browser": ^4.2.2 + "@smithy/util-body-length-node": ^4.2.3 + "@smithy/util-defaults-mode-browser": ^4.3.43 + "@smithy/util-defaults-mode-node": ^4.2.47 + "@smithy/util-endpoints": ^3.3.3 + "@smithy/util-middleware": ^4.2.12 + "@smithy/util-retry": ^4.2.12 + "@smithy/util-utf8": ^4.2.2 + tslib: ^2.6.2 + checksum: ed88e2cedd31f4aea533011e0f4fae57ad3a67cce95c7daf1633541e4fc9c5cd08e0d32615c07ef94b60516142f6685eb2176714123befa75856db9e8e08f01a + languageName: node + linkType: hard + "@aws-sdk/node-config-provider@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/node-config-provider@npm:3.186.0" @@ -10335,6 +10756,19 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/region-config-resolver@npm:^3.972.9": + version: 3.972.9 + resolution: "@aws-sdk/region-config-resolver@npm:3.972.9" + dependencies: + "@aws-sdk/types": ^3.973.6 + "@smithy/config-resolver": ^4.4.13 + "@smithy/node-config-provider": ^4.3.12 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 2f5bee01355f955ff7f6dbd06c893366bfd9612e969ed7c4bd56ab6f00a00113a743eddc02da36dde137f4e6b7346aa796283a1e5c1d84f399ea0dfd7218424e + languageName: node + linkType: hard + "@aws-sdk/s3-request-presigner@npm:^3.919.0": version: 3.1007.0 resolution: "@aws-sdk/s3-request-presigner@npm:3.1007.0" @@ -10507,6 +10941,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/token-providers@npm:3.1015.0": + version: 3.1015.0 + resolution: "@aws-sdk/token-providers@npm:3.1015.0" + dependencies: + "@aws-sdk/core": ^3.973.24 + "@aws-sdk/nested-clients": ^3.996.14 + "@aws-sdk/types": ^3.973.6 + "@smithy/property-provider": ^4.2.12 + "@smithy/shared-ini-file-loader": ^4.4.7 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: fa32c25e5e6fcf875ba5d59de4549663fbde78ee46a22f6ee734e18054c6efac6e321eb7a6657b0135a36b1916b76a58d670af27e226b17d28b07356677bfea6 + languageName: node + linkType: hard + "@aws-sdk/token-providers@npm:3.614.0": version: 3.614.0 resolution: "@aws-sdk/token-providers@npm:3.614.0" @@ -10661,6 +11110,16 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/types@npm:^3.973.6": + version: 3.973.6 + resolution: "@aws-sdk/types@npm:3.973.6" + dependencies: + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 3a5c65313a3faadf854dd1055e5768c0477ecd10e8a597d0c0041fb69efdcefc399bf263f86fef93754d2d9a91d4f0eb78f5f1de14779657f84a24218a457fc3 + languageName: node + linkType: hard + "@aws-sdk/url-parser-native@npm:3.6.1": version: 3.6.1 resolution: "@aws-sdk/url-parser-native@npm:3.6.1" @@ -10963,6 +11422,19 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-endpoints@npm:^3.996.5": + version: 3.996.5 + resolution: "@aws-sdk/util-endpoints@npm:3.996.5" + dependencies: + "@aws-sdk/types": ^3.973.6 + "@smithy/types": ^4.13.1 + "@smithy/url-parser": ^4.2.12 + "@smithy/util-endpoints": ^3.3.3 + tslib: ^2.6.2 + checksum: 6356b7b040758af210f6b3d6807c11538e8a6888093ebe8a172949532a170c1f3f0bf93db86f6a75f071749219c3da2a88e63954f53031e8c3f9a092d7d97db9 + languageName: node + linkType: hard + "@aws-sdk/util-format-url@npm:3.609.0": version: 3.609.0 resolution: "@aws-sdk/util-format-url@npm:3.609.0" @@ -11150,6 +11622,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-user-agent-browser@npm:^3.972.8": + version: 3.972.8 + resolution: "@aws-sdk/util-user-agent-browser@npm:3.972.8" + dependencies: + "@aws-sdk/types": ^3.973.6 + "@smithy/types": ^4.13.1 + bowser: ^2.11.0 + tslib: ^2.6.2 + checksum: b5153800fab17e3e079c87d0668b65625755c91a47646aabcfc434aad18d6fc0c8921b544a234cd89d11a0b29eef1b73087515438c185ea5bcff75ecb8c2e800 + languageName: node + linkType: hard + "@aws-sdk/util-user-agent-node@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/util-user-agent-node@npm:3.186.0" @@ -11266,6 +11750,25 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-user-agent-node@npm:^3.973.11": + version: 3.973.11 + resolution: "@aws-sdk/util-user-agent-node@npm:3.973.11" + dependencies: + "@aws-sdk/middleware-user-agent": ^3.972.25 + "@aws-sdk/types": ^3.973.6 + "@smithy/node-config-provider": ^4.3.12 + "@smithy/types": ^4.13.1 + "@smithy/util-config-provider": ^4.2.2 + tslib: ^2.6.2 + peerDependencies: + aws-crt: ">=1.0.0" + peerDependenciesMeta: + aws-crt: + optional: true + checksum: 3ef8bafaaa6e3b989527b196abeef983a0c1c4177257d77dd6a034105288bc88cf256edfacac41abd3bf84f2a14312ef41a114883df5c04e4ad62f84d4eb1cd0 + languageName: node + linkType: hard + "@aws-sdk/util-utf8-browser@npm:3.186.0": version: 3.186.0 resolution: "@aws-sdk/util-utf8-browser@npm:3.186.0" @@ -11367,6 +11870,17 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/xml-builder@npm:^3.972.15": + version: 3.972.15 + resolution: "@aws-sdk/xml-builder@npm:3.972.15" + dependencies: + "@smithy/types": ^4.13.1 + fast-xml-parser: 5.5.8 + tslib: ^2.6.2 + checksum: e1185fd46da270e717c63c67314a6e65e6fb599c5fe40ef4969a230e377003338119dcc11921b1602314e5f0578a5eec79f0cea8c38200b046d2401ae2001a21 + languageName: node + linkType: hard + "@aws/lambda-invoke-store@npm:^0.0.1": version: 0.0.1 resolution: "@aws/lambda-invoke-store@npm:0.0.1" @@ -16210,6 +16724,177 @@ __metadata: languageName: node linkType: hard +"@mapbox/extent@npm:0.4.0": + version: 0.4.0 + resolution: "@mapbox/extent@npm:0.4.0" + checksum: 2c287dcd5e3d2654727f81bb375034cf9c88c828524ff881d72fe20cfd561072d80c652fa58691785211c63f231e9e6dd2c0567a626c2f74198e835d6bfcf669 + languageName: node + linkType: hard + +"@mapbox/geojson-area@npm:^0.2.2": + version: 0.2.2 + resolution: "@mapbox/geojson-area@npm:0.2.2" + dependencies: + wgs84: 0.0.0 + checksum: 46a85e14877bbd24486f4352810b2d078ce072f4a81120b9481eb967334e5cc9d2c5ae8b2ddab2dfbe1c0822b18758b39f078339b43a18754ef514a32e95fb1c + languageName: node + linkType: hard + +"@mapbox/geojson-coords@npm:0.0.2": + version: 0.0.2 + resolution: "@mapbox/geojson-coords@npm:0.0.2" + dependencies: + "@mapbox/geojson-normalize": 0.0.1 + geojson-flatten: ^1.0.4 + checksum: 490709b75cb2cd348a2300ff847e28e5f1f7cf4fdb652ba170ddd3b1c2ad7f9c3261bd8128b82273ef8c85aac6dba171bdf24428aec1b8b993cd3ec7635bc446 + languageName: node + linkType: hard + +"@mapbox/geojson-extent@npm:^1.0.0": + version: 1.0.1 + resolution: "@mapbox/geojson-extent@npm:1.0.1" + dependencies: + "@mapbox/extent": 0.4.0 + "@mapbox/geojson-coords": 0.0.2 + rw: ~0.1.4 + traverse: ~0.6.6 + bin: + geojson-extent: bin/geojson-extent + checksum: d02666aac92d3107b1d32471d9b8cd44ced9c93748f92858f347e9d19044dbeaa3b675c16d154547e52ea35ceaa475ef66abdb29691dd6202beb07c7ccc92c0b + languageName: node + linkType: hard + +"@mapbox/geojson-normalize@npm:0.0.1, @mapbox/geojson-normalize@npm:^0.0.1": + version: 0.0.1 + resolution: "@mapbox/geojson-normalize@npm:0.0.1" + bin: + geojson-normalize: geojson-normalize + checksum: c51e7fa1462a9152493e2b639ce0b50d4c59ed8615f79c6be509312e4db2f29741cae50ecba1b8e290ce50c50f00c892039df3a5306d15712e51a6a28fcd4ecf + languageName: node + linkType: hard + +"@mapbox/geojson-rewind@npm:^0.5.0, @mapbox/geojson-rewind@npm:^0.5.1, @mapbox/geojson-rewind@npm:^0.5.2": + version: 0.5.2 + resolution: "@mapbox/geojson-rewind@npm:0.5.2" + dependencies: + get-stream: ^6.0.1 + minimist: ^1.2.6 + bin: + geojson-rewind: geojson-rewind + checksum: 631f89ba5b656cb1e02197c242b231f98da0afb96815fa26481497176d6bd5f2aac77af4950da91c954094694acbc26382bd3d38146705737e8ff06442d95a12 + languageName: node + linkType: hard + +"@mapbox/geojson-types@npm:^1.0.2": + version: 1.0.2 + resolution: "@mapbox/geojson-types@npm:1.0.2" + checksum: aa0a2cb95a358d8756ab5aa70356bcbd6f554a4571703a88a09e7db6580061d6ef4054db5fe3ecb2817c383b8b5433746a8f46712dc606b32063f73b154f99fc + languageName: node + linkType: hard + +"@mapbox/jsonlint-lines-primitives@npm:^2.0.2": + version: 2.0.2 + resolution: "@mapbox/jsonlint-lines-primitives@npm:2.0.2" + checksum: 5814e42fc453700132f93ea742aabcef9a3c98d9bf17d4c1106f82d1dcd91bbc93052e66e29014323b9b2a41b020c743d897e4a96cc4ed2f734482d587d8c2b2 + languageName: node + linkType: hard + +"@mapbox/mapbox-gl-draw@npm:1.3.0": + version: 1.3.0 + resolution: "@mapbox/mapbox-gl-draw@npm:1.3.0" + dependencies: + "@mapbox/geojson-area": ^0.2.2 + "@mapbox/geojson-extent": ^1.0.0 + "@mapbox/geojson-normalize": ^0.0.1 + "@mapbox/point-geometry": ^0.1.0 + hat: 0.0.3 + lodash.isequal: ^4.5.0 + xtend: ^4.0.2 + checksum: fcf7d33273fcb3cc7a7a9626b1ab0ede859150fcbab9dccde0373e42319b4a33fa768684f371268a97c062eba009e9230b39117081c9cfa06ba7ac60b8368bb2 + languageName: node + linkType: hard + +"@mapbox/mapbox-gl-supported@npm:^1.5.0": + version: 1.5.0 + resolution: "@mapbox/mapbox-gl-supported@npm:1.5.0" + peerDependencies: + mapbox-gl: ">=0.32.1 <2.0.0" + checksum: 5b7712e8b546e598dc5152632504cad53081211b64ddc4447825840ddca703275bc36599167b9550ab906ca8a9554936bcdae562073fdef24b8d38d78ee262fb + languageName: node + linkType: hard + +"@mapbox/mapbox-gl-supported@npm:^2.0.1": + version: 2.0.1 + resolution: "@mapbox/mapbox-gl-supported@npm:2.0.1" + checksum: d4876381cbc2fb401851eebb5195bd2e14b08c0351e9628fb18cfa15e89ce0ab19ac98bdbe6a6c13c6de359b44e07cad0fd2189cd2bfd981a16727618204551d + languageName: node + linkType: hard + +"@mapbox/point-geometry@npm:0.1.0, @mapbox/point-geometry@npm:^0.1.0, @mapbox/point-geometry@npm:~0.1.0": + version: 0.1.0 + resolution: "@mapbox/point-geometry@npm:0.1.0" + checksum: e4d861908574cb3165f5ad37b000416ebc90a2d6b3e0073191e6b6dc5074a6159d84ac5114d78557399bb429134f0d05bfb529e7902d1cb2b36d722b72ab662c + languageName: node + linkType: hard + +"@mapbox/tiny-sdf@npm:^1.1.1": + version: 1.2.5 + resolution: "@mapbox/tiny-sdf@npm:1.2.5" + checksum: de0252388a628ddb491c986c715f0b63ca6a74f5dac16d3e51eb75a21935a31e34fba5db47c81cc59a462d782021fc68b2e3cc119b2d6cabe15d31e311674d6c + languageName: node + linkType: hard + +"@mapbox/tiny-sdf@npm:^2.0.4, @mapbox/tiny-sdf@npm:^2.0.5": + version: 2.0.7 + resolution: "@mapbox/tiny-sdf@npm:2.0.7" + checksum: f117d8537ee4b5ee2deed54b9b426792744c15a649681305b4fb21b608b7c6a815015f015cd612923cc8efa30424d0440abfc1af2c85eda00a726024bb4f3ede + languageName: node + linkType: hard + +"@mapbox/unitbezier@npm:^0.0.0": + version: 0.0.0 + resolution: "@mapbox/unitbezier@npm:0.0.0" + checksum: af1943ebeb7532317a5cedfc38d0e580b7bd76cc5c43988df65541d377f3e3fa7d68c201dda20f5239213a4bc81ec5d13146354107196ffc4f14d6f39b8343b5 + languageName: node + linkType: hard + +"@mapbox/unitbezier@npm:^0.0.1": + version: 0.0.1 + resolution: "@mapbox/unitbezier@npm:0.0.1" + checksum: 97f39d4fbdf9579d0a1a8be0d536eb113a805d36459e774014f488a7ca6cc9dcfc77ab7a2ebe5af395ad50da6efb4dbf2566de0db3f62b6b8675cddbace8f86a + languageName: node + linkType: hard + +"@mapbox/vector-tile@npm:^1.3.1": + version: 1.3.1 + resolution: "@mapbox/vector-tile@npm:1.3.1" + dependencies: + "@mapbox/point-geometry": ~0.1.0 + checksum: ffb271b95c383923768295e72bdf95e428efb906434b864ea04d3853a8373cf0de19f039bd6615f7cf018fbfb4dbf4599f27ebaa86c2b7b09f7d69187f8d7da1 + languageName: node + linkType: hard + +"@mapbox/whoots-js@npm:^3.1.0": + version: 3.1.0 + resolution: "@mapbox/whoots-js@npm:3.1.0" + checksum: fe9e959a9049bcbc2c05d9d1156e050191ad697a1bd95e41cdfa069051ff1d6f2930ced234a8d68d5a0bf78091feab30d76497418ec800d90f0aac8691fe4fd4 + languageName: node + linkType: hard + +"@maplibre/maplibre-gl-geocoder@npm:1.5.0": + version: 1.5.0 + resolution: "@maplibre/maplibre-gl-geocoder@npm:1.5.0" + dependencies: + lodash.debounce: ^4.0.6 + subtag: ^0.5.0 + suggestions-list: ^0.0.2 + xtend: ^4.0.1 + peerDependencies: + maplibre-gl: ">=1.14.0" + checksum: 99b911f0081ef41c446ecc8458ce124a6405ff87e449444ca029cbc579d4d727701863e21ee5f1407da80e9f61a788615384bae91fe086562c69e48d077996ff + languageName: node + linkType: hard + "@microsoft/api-extractor-model@npm:7.33.4": version: 7.33.4 resolution: "@microsoft/api-extractor-model@npm:7.33.4" @@ -18318,6 +19003,16 @@ __metadata: languageName: node linkType: hard +"@smithy/abort-controller@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/abort-controller@npm:4.2.12" + dependencies: + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 839bee519c6bc4cf405395f71a07d0b5b42c22ce1c0163a157a61e18804d5dacd4ade1a3b2b69fea26462eecff4c92593726e96318f16ea8adfb419e7f3dab43 + languageName: node + linkType: hard + "@smithy/chunked-blob-reader-native@npm:^4.2.3": version: 4.2.3 resolution: "@smithy/chunked-blob-reader-native@npm:4.2.3" @@ -18364,6 +19059,20 @@ __metadata: languageName: node linkType: hard +"@smithy/config-resolver@npm:^4.4.13": + version: 4.4.13 + resolution: "@smithy/config-resolver@npm:4.4.13" + dependencies: + "@smithy/node-config-provider": ^4.3.12 + "@smithy/types": ^4.13.1 + "@smithy/util-config-provider": ^4.2.2 + "@smithy/util-endpoints": ^3.3.3 + "@smithy/util-middleware": ^4.2.12 + tslib: ^2.6.2 + checksum: 4087584b0c5a5207a847b951072eedbf485c0e908ec750270c5f0fe7a15dd9e22857ced0fc24a6fdfde4d4937219b5f4f12c63cbc0f6371d161512b00af293cb + languageName: node + linkType: hard + "@smithy/core@npm:^2.3.2, @smithy/core@npm:^2.4.0, @smithy/core@npm:^2.5.5, @smithy/core@npm:^2.5.7": version: 2.5.7 resolution: "@smithy/core@npm:2.5.7" @@ -18398,6 +19107,24 @@ __metadata: languageName: node linkType: hard +"@smithy/core@npm:^3.23.12": + version: 3.23.12 + resolution: "@smithy/core@npm:3.23.12" + dependencies: + "@smithy/protocol-http": ^5.3.12 + "@smithy/types": ^4.13.1 + "@smithy/url-parser": ^4.2.12 + "@smithy/util-base64": ^4.3.2 + "@smithy/util-body-length-browser": ^4.2.2 + "@smithy/util-middleware": ^4.2.12 + "@smithy/util-stream": ^4.5.20 + "@smithy/util-utf8": ^4.2.2 + "@smithy/uuid": ^1.1.2 + tslib: ^2.6.2 + checksum: 48add70de8829d8fa4dd62e808e5850dd60e7dcd4f08f2720f573479de1f88a688b1268dc6158476549a9d3e1510df445d3f4b8768f5b2d32fc2fbe3ee3feb65 + languageName: node + linkType: hard + "@smithy/credential-provider-imds@npm:^3.2.0, @smithy/credential-provider-imds@npm:^3.2.8": version: 3.2.8 resolution: "@smithy/credential-provider-imds@npm:3.2.8" @@ -18424,6 +19151,19 @@ __metadata: languageName: node linkType: hard +"@smithy/credential-provider-imds@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/credential-provider-imds@npm:4.2.12" + dependencies: + "@smithy/node-config-provider": ^4.3.12 + "@smithy/property-provider": ^4.2.12 + "@smithy/types": ^4.13.1 + "@smithy/url-parser": ^4.2.12 + tslib: ^2.6.2 + checksum: 23cadc858a8eb16da9212c7741f53bf92e8ff8bbae0c42194ec076c8cac40b7c2f4e2e2079bfedf5b85384a534876693d7631a27ecae2f4a67af313bb0994869 + languageName: node + linkType: hard + "@smithy/eventstream-codec@npm:^3.1.10, @smithy/eventstream-codec@npm:^3.1.2": version: 3.1.10 resolution: "@smithy/eventstream-codec@npm:3.1.10" @@ -18573,6 +19313,19 @@ __metadata: languageName: node linkType: hard +"@smithy/fetch-http-handler@npm:^5.3.15": + version: 5.3.15 + resolution: "@smithy/fetch-http-handler@npm:5.3.15" + dependencies: + "@smithy/protocol-http": ^5.3.12 + "@smithy/querystring-builder": ^4.2.12 + "@smithy/types": ^4.13.1 + "@smithy/util-base64": ^4.3.2 + tslib: ^2.6.2 + checksum: 456f98b8bba5214a01aa9ca73ab4088a529ad6473a72cc74747d676d2c5225748167eb3cddccbc2ef884141965132dab49d19b7599414e899c9c36f71a04ce85 + languageName: node + linkType: hard + "@smithy/hash-blob-browser@npm:^4.2.12, @smithy/hash-blob-browser@npm:^4.2.8": version: 4.2.12 resolution: "@smithy/hash-blob-browser@npm:4.2.12" @@ -18609,6 +19362,18 @@ __metadata: languageName: node linkType: hard +"@smithy/hash-node@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/hash-node@npm:4.2.12" + dependencies: + "@smithy/types": ^4.13.1 + "@smithy/util-buffer-from": ^4.2.2 + "@smithy/util-utf8": ^4.2.2 + tslib: ^2.6.2 + checksum: 4da4aaf39d1c2c3eec7a93cd02a055532583238ad3e80247cab211a3490cbff6e1e1a51abfd0502ef98be3f9f416a263c1382f28fad1aff38efaf129ce4b8a3d + languageName: node + linkType: hard + "@smithy/hash-stream-node@npm:^4.2.11, @smithy/hash-stream-node@npm:^4.2.7": version: 4.2.11 resolution: "@smithy/hash-stream-node@npm:4.2.11" @@ -18640,6 +19405,16 @@ __metadata: languageName: node linkType: hard +"@smithy/invalid-dependency@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/invalid-dependency@npm:4.2.12" + dependencies: + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 688f3c312d07ea72ec98c2a58fdb230bd6b43c122f88a411cb9643c0c6085e2a3a27f36f9c3cc0024b32fa831b4b6353e74933a8f746e18acc09c20ca579384e + languageName: node + linkType: hard + "@smithy/is-array-buffer@npm:^2.2.0": version: 2.2.0 resolution: "@smithy/is-array-buffer@npm:2.2.0" @@ -18711,6 +19486,17 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-content-length@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/middleware-content-length@npm:4.2.12" + dependencies: + "@smithy/protocol-http": ^5.3.12 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 2800bf2cad2fe6c4eb9edb29e6637b4b937edf89db2a3f95594c93a74ae48144dd1a826712a02a5f3b4e3648a29092f4e573e4828ae88a33b25f87531c329430 + languageName: node + linkType: hard + "@smithy/middleware-endpoint@npm:^3.1.0, @smithy/middleware-endpoint@npm:^3.2.6, @smithy/middleware-endpoint@npm:^3.2.8": version: 3.2.8 resolution: "@smithy/middleware-endpoint@npm:3.2.8" @@ -18743,6 +19529,22 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-endpoint@npm:^4.4.27": + version: 4.4.27 + resolution: "@smithy/middleware-endpoint@npm:4.4.27" + dependencies: + "@smithy/core": ^3.23.12 + "@smithy/middleware-serde": ^4.2.15 + "@smithy/node-config-provider": ^4.3.12 + "@smithy/shared-ini-file-loader": ^4.4.7 + "@smithy/types": ^4.13.1 + "@smithy/url-parser": ^4.2.12 + "@smithy/util-middleware": ^4.2.12 + tslib: ^2.6.2 + checksum: 630dacce0adf4d6b04727bfb53235d7439aef75b1afe7aee1468a42f26b777fae9fb53df5b7e502ba44d06ba060d5dc635ff6e82383a1a5a1464a6c63dbbf0ca + languageName: node + linkType: hard + "@smithy/middleware-retry@npm:^3.0.14, @smithy/middleware-retry@npm:^3.0.15, @smithy/middleware-retry@npm:^3.0.31": version: 3.0.34 resolution: "@smithy/middleware-retry@npm:3.0.34" @@ -18777,6 +19579,23 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-retry@npm:^4.4.44": + version: 4.4.44 + resolution: "@smithy/middleware-retry@npm:4.4.44" + dependencies: + "@smithy/node-config-provider": ^4.3.12 + "@smithy/protocol-http": ^5.3.12 + "@smithy/service-error-classification": ^4.2.12 + "@smithy/smithy-client": ^4.12.7 + "@smithy/types": ^4.13.1 + "@smithy/util-middleware": ^4.2.12 + "@smithy/util-retry": ^4.2.12 + "@smithy/uuid": ^1.1.2 + tslib: ^2.6.2 + checksum: 389fc3425b37d0223e782f8c0eb4f6900f7f76c42c658b59fbd4efc73102b4f93ef836b08d70af23dbd2ce4e9404f875d8e66f84ccf80d115cfaf4edfc331e18 + languageName: node + linkType: hard + "@smithy/middleware-serde@npm:^3.0.11, @smithy/middleware-serde@npm:^3.0.3": version: 3.0.11 resolution: "@smithy/middleware-serde@npm:3.0.11" @@ -18798,6 +19617,18 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-serde@npm:^4.2.15": + version: 4.2.15 + resolution: "@smithy/middleware-serde@npm:4.2.15" + dependencies: + "@smithy/core": ^3.23.12 + "@smithy/protocol-http": ^5.3.12 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 651c775eafba0cea9fe67e9d24afc73d31d371949b9bdfb109aa242f9899fb8334504e37b00a6b51e6f9f522daa68c89fb7cc451e50faa4cf8990d23a2470c67 + languageName: node + linkType: hard + "@smithy/middleware-stack@npm:^3.0.11, @smithy/middleware-stack@npm:^3.0.3": version: 3.0.11 resolution: "@smithy/middleware-stack@npm:3.0.11" @@ -18818,6 +19649,16 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-stack@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/middleware-stack@npm:4.2.12" + dependencies: + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: d06ec807249bb7f13cf4c6ce078a871dbeddb5b0c07536da62942245d2723ec380df4e631ab3c5b3ba7dc9626a609d11fcd48d53c8b0f9b6c9f1239b83d49f40 + languageName: node + linkType: hard + "@smithy/node-config-provider@npm:^3.1.12, @smithy/node-config-provider@npm:^3.1.4": version: 3.1.12 resolution: "@smithy/node-config-provider@npm:3.1.12" @@ -18842,6 +19683,18 @@ __metadata: languageName: node linkType: hard +"@smithy/node-config-provider@npm:^4.3.12": + version: 4.3.12 + resolution: "@smithy/node-config-provider@npm:4.3.12" + dependencies: + "@smithy/property-provider": ^4.2.12 + "@smithy/shared-ini-file-loader": ^4.4.7 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 97087669ae1c834bc00ab10ade383a746c411a04788b7104d9f4e921ce7d24c5d77257f9ac8b8c842f886a2d658acd948e133eb95f1ee768cfbe49456441e91c + languageName: node + linkType: hard + "@smithy/node-http-handler@npm:^3.1.4, @smithy/node-http-handler@npm:^3.3.2, @smithy/node-http-handler@npm:^3.3.3": version: 3.3.3 resolution: "@smithy/node-http-handler@npm:3.3.3" @@ -18868,6 +19721,19 @@ __metadata: languageName: node linkType: hard +"@smithy/node-http-handler@npm:^4.5.0": + version: 4.5.0 + resolution: "@smithy/node-http-handler@npm:4.5.0" + dependencies: + "@smithy/abort-controller": ^4.2.12 + "@smithy/protocol-http": ^5.3.12 + "@smithy/querystring-builder": ^4.2.12 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: b4bbbb47a047a13558a22b3bd22c507dbe91aab36d6859bc77c97253be37966b51ff8c6ab84ebba3ab6dbebf951eec2df004bd8af826a832c0fa033a0d10a8b9 + languageName: node + linkType: hard + "@smithy/property-provider@npm:^3.1.11, @smithy/property-provider@npm:^3.1.3": version: 3.1.11 resolution: "@smithy/property-provider@npm:3.1.11" @@ -18888,6 +19754,16 @@ __metadata: languageName: node linkType: hard +"@smithy/property-provider@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/property-provider@npm:4.2.12" + dependencies: + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: d4dc0d6c61e3b1f947b1e66074dc527f1a8499fef00627c6e97f01822d357c80db8853a4283d8206075b7fba6b9c59d648dc94ab4b08902acf2a2cb97533dc39 + languageName: node + linkType: hard + "@smithy/protocol-http@npm:^4.1.0, @smithy/protocol-http@npm:^4.1.4, @smithy/protocol-http@npm:^4.1.8": version: 4.1.8 resolution: "@smithy/protocol-http@npm:4.1.8" @@ -18908,6 +19784,16 @@ __metadata: languageName: node linkType: hard +"@smithy/protocol-http@npm:^5.3.12": + version: 5.3.12 + resolution: "@smithy/protocol-http@npm:5.3.12" + dependencies: + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: f71f8e54d42637acbef9f01e3974a8ad46187ae020366de4dc84dac7ba8413a8a6fb21369c83b660afa110fc5a56d185c7e48de7d2cf45351ebb1b29aa77962b + languageName: node + linkType: hard + "@smithy/querystring-builder@npm:^3.0.11, @smithy/querystring-builder@npm:^3.0.3, @smithy/querystring-builder@npm:^3.0.7": version: 3.0.11 resolution: "@smithy/querystring-builder@npm:3.0.11" @@ -18930,6 +19816,17 @@ __metadata: languageName: node linkType: hard +"@smithy/querystring-builder@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/querystring-builder@npm:4.2.12" + dependencies: + "@smithy/types": ^4.13.1 + "@smithy/util-uri-escape": ^4.2.2 + tslib: ^2.6.2 + checksum: 171c0d4da2fd024466741e6ee1c05cac5664e0da82c4ac5afd3218278925c25ed00bc3518e02481f4daf3f366034f273fb1cb579f146f10d0edee14dc5676c21 + languageName: node + linkType: hard + "@smithy/querystring-parser@npm:^3.0.11, @smithy/querystring-parser@npm:^3.0.3": version: 3.0.11 resolution: "@smithy/querystring-parser@npm:3.0.11" @@ -18950,6 +19847,16 @@ __metadata: languageName: node linkType: hard +"@smithy/querystring-parser@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/querystring-parser@npm:4.2.12" + dependencies: + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: be23cd6e68cd14cb2aaa82a06ae92c1202344a91a74f1d0098adaca0cf9e02bc08a112322a56e34873c7a0877445e49b2795ca3e181292239f42b9a2598af068 + languageName: node + linkType: hard + "@smithy/service-error-classification@npm:^3.0.11, @smithy/service-error-classification@npm:^3.0.3": version: 3.0.11 resolution: "@smithy/service-error-classification@npm:3.0.11" @@ -18968,6 +19875,15 @@ __metadata: languageName: node linkType: hard +"@smithy/service-error-classification@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/service-error-classification@npm:4.2.12" + dependencies: + "@smithy/types": ^4.13.1 + checksum: a37ec7bded03f7578473b002bf99771853f9e59ecc53e85fb0501a794b5ff121259225af981f55788ad7adc57ef85ab536de1d2a1c2f5556117426e5485f7da9 + languageName: node + linkType: hard + "@smithy/shared-ini-file-loader@npm:^3.1.12, @smithy/shared-ini-file-loader@npm:^3.1.4": version: 3.1.12 resolution: "@smithy/shared-ini-file-loader@npm:3.1.12" @@ -18988,6 +19904,16 @@ __metadata: languageName: node linkType: hard +"@smithy/shared-ini-file-loader@npm:^4.4.7": + version: 4.4.7 + resolution: "@smithy/shared-ini-file-loader@npm:4.4.7" + dependencies: + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 817a1d1b19f7f681ae5972db44416ba215f422da964eda04eae9ed1a31c05ae8ce3bed69c1429c9c42b9d1ec3493933731d2c3ef4b3858431cfdb51aa40b1b93 + languageName: node + linkType: hard + "@smithy/signature-v4@npm:^4.1.0, @smithy/signature-v4@npm:^4.2.4": version: 4.2.4 resolution: "@smithy/signature-v4@npm:4.2.4" @@ -19020,6 +19946,22 @@ __metadata: languageName: node linkType: hard +"@smithy/signature-v4@npm:^5.3.12": + version: 5.3.12 + resolution: "@smithy/signature-v4@npm:5.3.12" + dependencies: + "@smithy/is-array-buffer": ^4.2.2 + "@smithy/protocol-http": ^5.3.12 + "@smithy/types": ^4.13.1 + "@smithy/util-hex-encoding": ^4.2.2 + "@smithy/util-middleware": ^4.2.12 + "@smithy/util-uri-escape": ^4.2.2 + "@smithy/util-utf8": ^4.2.2 + tslib: ^2.6.2 + checksum: 7163c533c6ffebd93c2f7266b22c0d82488746846e50e795afcb15becd8431cfe993006a99b09828e5905ca56a7ffa6080a3537e092f3a57d661f64c5f0f11a7 + languageName: node + linkType: hard + "@smithy/smithy-client@npm:^3.1.12, @smithy/smithy-client@npm:^3.2.0, @smithy/smithy-client@npm:^3.5.1, @smithy/smithy-client@npm:^3.7.0": version: 3.7.0 resolution: "@smithy/smithy-client@npm:3.7.0" @@ -19050,6 +19992,21 @@ __metadata: languageName: node linkType: hard +"@smithy/smithy-client@npm:^4.12.7": + version: 4.12.7 + resolution: "@smithy/smithy-client@npm:4.12.7" + dependencies: + "@smithy/core": ^3.23.12 + "@smithy/middleware-endpoint": ^4.4.27 + "@smithy/middleware-stack": ^4.2.12 + "@smithy/protocol-http": ^5.3.12 + "@smithy/types": ^4.13.1 + "@smithy/util-stream": ^4.5.20 + tslib: ^2.6.2 + checksum: 7acb0c314bff3adff4625fe7cef773c9205d66debbef116972f88fd1456974944cb1f123c0fd6c5b3489640d4d5de370b0bdf70e9d7b7a63ff57bf6de81ceb4c + languageName: node + linkType: hard + "@smithy/types@npm:^1.1.0": version: 1.2.0 resolution: "@smithy/types@npm:1.2.0" @@ -19086,6 +20043,15 @@ __metadata: languageName: node linkType: hard +"@smithy/types@npm:^4.13.1": + version: 4.13.1 + resolution: "@smithy/types@npm:4.13.1" + dependencies: + tslib: ^2.6.2 + checksum: 775ed9748d9290b8816d933bfb9726eb9301ef2fe9fba1bfbc1966372b9f0d4dd1d3b611aca3c000094bed2ca9d821e10fe2795a75df5bc305bc8845a1e413f7 + languageName: node + linkType: hard + "@smithy/url-parser@npm:^3.0.11, @smithy/url-parser@npm:^3.0.3": version: 3.0.11 resolution: "@smithy/url-parser@npm:3.0.11" @@ -19108,6 +20074,17 @@ __metadata: languageName: node linkType: hard +"@smithy/url-parser@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/url-parser@npm:4.2.12" + dependencies: + "@smithy/querystring-parser": ^4.2.12 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: ff6b127f0bb8ddd6934018277a2ae73ecb036259ec9e0ea4e136da47b39d089ee29ff92fcdbc79613b3c8224f180bcf914289bd71709e9ccc4a444c5f0423086 + languageName: node + linkType: hard + "@smithy/util-base64@npm:^3.0.0": version: 3.0.0 resolution: "@smithy/util-base64@npm:3.0.0" @@ -19239,6 +20216,18 @@ __metadata: languageName: node linkType: hard +"@smithy/util-defaults-mode-browser@npm:^4.3.43": + version: 4.3.43 + resolution: "@smithy/util-defaults-mode-browser@npm:4.3.43" + dependencies: + "@smithy/property-provider": ^4.2.12 + "@smithy/smithy-client": ^4.12.7 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: cac43b7057ae43005208943675880458a4a974d6c2ee25f0846ffc6fb270503d051dce25c14bed5665f7d32aa2dd4ff6257c8fe7603807438ce0c1522002c9c0 + languageName: node + linkType: hard + "@smithy/util-defaults-mode-node@npm:^3.0.14, @smithy/util-defaults-mode-node@npm:^3.0.15, @smithy/util-defaults-mode-node@npm:^3.0.31": version: 3.0.34 resolution: "@smithy/util-defaults-mode-node@npm:3.0.34" @@ -19269,6 +20258,21 @@ __metadata: languageName: node linkType: hard +"@smithy/util-defaults-mode-node@npm:^4.2.47": + version: 4.2.47 + resolution: "@smithy/util-defaults-mode-node@npm:4.2.47" + dependencies: + "@smithy/config-resolver": ^4.4.13 + "@smithy/credential-provider-imds": ^4.2.12 + "@smithy/node-config-provider": ^4.3.12 + "@smithy/property-provider": ^4.2.12 + "@smithy/smithy-client": ^4.12.7 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 912b5fe1566534b1549f8ff10d222139ef8ef0821cbf89c6975629ce043c379c80ac83cf339977bac62e368ff597892e064f2e765ef4887cf8cd170e8b7dce43 + languageName: node + linkType: hard + "@smithy/util-endpoints@npm:^2.0.5, @smithy/util-endpoints@npm:^2.1.7": version: 2.1.7 resolution: "@smithy/util-endpoints@npm:2.1.7" @@ -19291,6 +20295,17 @@ __metadata: languageName: node linkType: hard +"@smithy/util-endpoints@npm:^3.3.3": + version: 3.3.3 + resolution: "@smithy/util-endpoints@npm:3.3.3" + dependencies: + "@smithy/node-config-provider": ^4.3.12 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: ba80337fa6216e8912d5f78bc192c625807ba212071a8504b40b0bcf2b28d293fbd9b180da1ebcd1d15faf60291a6ff534e288266a29dc9cd600bf5eb1d51579 + languageName: node + linkType: hard + "@smithy/util-hex-encoding@npm:2.0.0": version: 2.0.0 resolution: "@smithy/util-hex-encoding@npm:2.0.0" @@ -19338,6 +20353,16 @@ __metadata: languageName: node linkType: hard +"@smithy/util-middleware@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/util-middleware@npm:4.2.12" + dependencies: + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 0fd7e7e8b5b02023928e7ad27f1c44a312524c393c39aa064c3c371e521035028116a5aa16d8011068b288179eb862bef917d798419b9f2a2843bf4ea3897e2b + languageName: node + linkType: hard + "@smithy/util-retry@npm:^3.0.11, @smithy/util-retry@npm:^3.0.3": version: 3.0.11 resolution: "@smithy/util-retry@npm:3.0.11" @@ -19360,6 +20385,17 @@ __metadata: languageName: node linkType: hard +"@smithy/util-retry@npm:^4.2.12": + version: 4.2.12 + resolution: "@smithy/util-retry@npm:4.2.12" + dependencies: + "@smithy/service-error-classification": ^4.2.12 + "@smithy/types": ^4.13.1 + tslib: ^2.6.2 + checksum: 1a8bff8da85d6637310286a3a52f557622cc9bb9dc75d9770640701a9565a3a995aeb34ed68acf333f60bb871dc49e9db196c5a35913b33944e02811f3cfcca2 + languageName: node + linkType: hard + "@smithy/util-stream@npm:^3.1.3, @smithy/util-stream@npm:^3.3.2, @smithy/util-stream@npm:^3.3.4": version: 3.3.4 resolution: "@smithy/util-stream@npm:3.3.4" @@ -19392,6 +20428,22 @@ __metadata: languageName: node linkType: hard +"@smithy/util-stream@npm:^4.5.10, @smithy/util-stream@npm:^4.5.20": + version: 4.5.20 + resolution: "@smithy/util-stream@npm:4.5.20" + dependencies: + "@smithy/fetch-http-handler": ^5.3.15 + "@smithy/node-http-handler": ^4.5.0 + "@smithy/types": ^4.13.1 + "@smithy/util-base64": ^4.3.2 + "@smithy/util-buffer-from": ^4.2.2 + "@smithy/util-hex-encoding": ^4.2.2 + "@smithy/util-utf8": ^4.2.2 + tslib: ^2.6.2 + checksum: c21a5a0639197ebb915efd43cb3b03699733c5bb3f56f14abc8abc7af96456d8fcd4f6391ce70d38075a138c9fc4e2bdf215b00c491d47b599c2ab69186c117d + languageName: node + linkType: hard + "@smithy/util-uri-escape@npm:^3.0.0": version: 3.0.0 resolution: "@smithy/util-uri-escape@npm:3.0.0" @@ -19766,6 +20818,41 @@ __metadata: languageName: node linkType: hard +"@turf/along@npm:^6.0.1, @turf/along@npm:^6.5.0": + version: 6.5.0 + resolution: "@turf/along@npm:6.5.0" + dependencies: + "@turf/bearing": ^6.5.0 + "@turf/destination": ^6.5.0 + "@turf/distance": ^6.5.0 + "@turf/helpers": ^6.5.0 + "@turf/invariant": ^6.5.0 + checksum: adfcda37ce8b20d58a18a4b5e0080c8bb8fe17c73006d18b6b412ed2c8c3c1e4ba836a3ac064636148d6f8d1b0be81a0da9335e10d88da3ad909175b99605201 + languageName: node + linkType: hard + +"@turf/bbox@npm:*": + version: 7.3.4 + resolution: "@turf/bbox@npm:7.3.4" + dependencies: + "@turf/helpers": 7.3.4 + "@turf/meta": 7.3.4 + "@types/geojson": ^7946.0.10 + tslib: ^2.8.1 + checksum: d68b9a3a5da99806e66f5b96a62ac639529e0a5f95de391685e5c3a1b21ccf2da113b58dd8b87964756d0a00bca19c024db3ce262b693dbe3c356610ccc68070 + languageName: node + linkType: hard + +"@turf/bearing@npm:^6.5.0": + version: 6.5.0 + resolution: "@turf/bearing@npm:6.5.0" + dependencies: + "@turf/helpers": ^6.5.0 + "@turf/invariant": ^6.5.0 + checksum: 9c6d5bb85289fee408592ffe8768987512dad1793130364bd43cd8a420ec1ea7b376ce35e22c3fdd91c051eaaa70de4682709111c5cf0ca93681fe9ef238a406 + languageName: node + linkType: hard + "@turf/boolean-clockwise@npm:6.5.0": version: 6.5.0 resolution: "@turf/boolean-clockwise@npm:6.5.0" @@ -19776,13 +20863,53 @@ __metadata: languageName: node linkType: hard -"@turf/helpers@npm:^6.5.0": +"@turf/circle@npm:^6.0.1, @turf/circle@npm:^6.5.0": + version: 6.5.0 + resolution: "@turf/circle@npm:6.5.0" + dependencies: + "@turf/destination": ^6.5.0 + "@turf/helpers": ^6.5.0 + checksum: 319fadc9cdc7b9992bc30e3cb40d7fa435ddb8f59c49dd6ca94658446000fee45e7bafa26ab74dcb0300a4ad5bc2dbeb1143609aa47bde6e9c21f968019cda40 + languageName: node + linkType: hard + +"@turf/destination@npm:^6.5.0": + version: 6.5.0 + resolution: "@turf/destination@npm:6.5.0" + dependencies: + "@turf/helpers": ^6.5.0 + "@turf/invariant": ^6.5.0 + checksum: 3f26d0e6426f224d8a7b0ee6c3a6df21934a345701948354e3062818f4e49ebad89d4218f357fc1e5bfe3e5059a1d97845a355467efe8db4cb07935b7746ef66 + languageName: node + linkType: hard + +"@turf/distance@npm:^6.0.1, @turf/distance@npm:^6.5.0": + version: 6.5.0 + resolution: "@turf/distance@npm:6.5.0" + dependencies: + "@turf/helpers": ^6.5.0 + "@turf/invariant": ^6.5.0 + checksum: 7419d7bd541ae22c116054728252f793df3c7a0b342c928625478cc1c92a7df21f190051db07b66452a21f6ae5d211674d0db3e9aa6c3ab6ffa05e339aac88dc + languageName: node + linkType: hard + +"@turf/helpers@npm:6.x, @turf/helpers@npm:^6.1.4, @turf/helpers@npm:^6.5.0": version: 6.5.0 resolution: "@turf/helpers@npm:6.5.0" checksum: 786cbe0c0027f85db286fb3a0b7be04bb29bd63ec07760a49735ef32e9c5b4a7c059a8f691fafa31c7e0e9be34c281e014dc24077438bae01a09b492a680fb6f languageName: node linkType: hard +"@turf/helpers@npm:7.3.4": + version: 7.3.4 + resolution: "@turf/helpers@npm:7.3.4" + dependencies: + "@types/geojson": ^7946.0.10 + tslib: ^2.8.1 + checksum: e10cc2e9d4e25c46e79310847a9b1a3c8613558defaa8bcc0b2e8622d106c875e4e4c7895942bc89687ab72b12bdce0835cac10362118f8eeb3c0939042a5ccd + languageName: node + linkType: hard + "@turf/invariant@npm:^6.5.0": version: 6.5.0 resolution: "@turf/invariant@npm:6.5.0" @@ -19792,6 +20919,87 @@ __metadata: languageName: node linkType: hard +"@turf/length@npm:^6.0.2, @turf/length@npm:^6.5.0": + version: 6.5.0 + resolution: "@turf/length@npm:6.5.0" + dependencies: + "@turf/distance": ^6.5.0 + "@turf/helpers": ^6.5.0 + "@turf/meta": ^6.5.0 + checksum: 8d532395066c908144829252a754139ea540940c83a1cee5e4f567ce0d25c140cf847062d5608c563e0debefa181fa4b530c09ca3c78a592b40dfb8877c77e5f + languageName: node + linkType: hard + +"@turf/line-intersect@npm:^6.5.0": + version: 6.5.0 + resolution: "@turf/line-intersect@npm:6.5.0" + dependencies: + "@turf/helpers": ^6.5.0 + "@turf/invariant": ^6.5.0 + "@turf/line-segment": ^6.5.0 + "@turf/meta": ^6.5.0 + geojson-rbush: 3.x + checksum: fe339af2e2348254d2ff5782a91abf935bfe322634eb5e9280098ecab3528575d8fdedf38ad7dd46b49c7932fc42e3d7de3a5f47f91d32f63b5398f2eada3632 + languageName: node + linkType: hard + +"@turf/line-segment@npm:^6.5.0": + version: 6.5.0 + resolution: "@turf/line-segment@npm:6.5.0" + dependencies: + "@turf/helpers": ^6.5.0 + "@turf/invariant": ^6.5.0 + "@turf/meta": ^6.5.0 + checksum: 5fa92ca0b3dbb909c957eefd8d98eda2dcb9ea924854507f1f8f8c2ad304d78c84734affd4601d10eda6732e808857020fccb2eaa91a76981fcce3eeafa72757 + languageName: node + linkType: hard + +"@turf/line-slice@npm:^6.5.0": + version: 6.5.0 + resolution: "@turf/line-slice@npm:6.5.0" + dependencies: + "@turf/helpers": ^6.5.0 + "@turf/invariant": ^6.5.0 + "@turf/nearest-point-on-line": ^6.5.0 + checksum: 3ff84d0bd0f201808e596d977d7cc1d6318085f26816728a05fae1a4405afa191dbbf387c6f039b9dbc739874441c21765c2b6f1f0e1b7f62d636df9ea6d7efb + languageName: node + linkType: hard + +"@turf/meta@npm:6.x, @turf/meta@npm:^6.5.0": + version: 6.5.0 + resolution: "@turf/meta@npm:6.5.0" + dependencies: + "@turf/helpers": ^6.5.0 + checksum: 9df6cb5af7af98a477ddcd744fb44e4e890fe8a67afa50bb24cad7d9c15af67362d24f1f8890d706a9c369b18285b0ba42430509add769ad868ac452703bb59b + languageName: node + linkType: hard + +"@turf/meta@npm:7.3.4": + version: 7.3.4 + resolution: "@turf/meta@npm:7.3.4" + dependencies: + "@turf/helpers": 7.3.4 + "@types/geojson": ^7946.0.10 + tslib: ^2.8.1 + checksum: 756bb9e227323fbd9262fbe8323962f0d82852a6452e9e4db1ac5f6947081a450b9389a71b15f109d1d0621cc1b45cc1b68ee4b6c8eaf7e01442ef5cb2dee71b + languageName: node + linkType: hard + +"@turf/nearest-point-on-line@npm:^6.5.0": + version: 6.5.0 + resolution: "@turf/nearest-point-on-line@npm:6.5.0" + dependencies: + "@turf/bearing": ^6.5.0 + "@turf/destination": ^6.5.0 + "@turf/distance": ^6.5.0 + "@turf/helpers": ^6.5.0 + "@turf/invariant": ^6.5.0 + "@turf/line-intersect": ^6.5.0 + "@turf/meta": ^6.5.0 + checksum: 034641131e823bf5f458d88916edc8c593fbee61b6c52562a363d0072dbea14a11e28179671ca108662083ea677ccc6702d039ef36f408c30cf9e70bc50279e5 + languageName: node + linkType: hard + "@tybys/wasm-util@npm:^0.10.0": version: 0.10.1 resolution: "@tybys/wasm-util@npm:0.10.1" @@ -20159,6 +21367,20 @@ __metadata: languageName: node linkType: hard +"@types/geojson@npm:*, @types/geojson@npm:^7946.0.10, @types/geojson@npm:^7946.0.8": + version: 7946.0.16 + resolution: "@types/geojson@npm:7946.0.16" + checksum: 1ff24a288bd5860b766b073ead337d31d73bdc715e5b50a2cee5cb0af57a1ed02cc04ef295f5fa68dc40fe3e4f104dd31282b2b818a5ba3231bc1001ba084e3c + languageName: node + linkType: hard + +"@types/geojson@npm:7946.0.8": + version: 7946.0.8 + resolution: "@types/geojson@npm:7946.0.8" + checksum: add7dc52bf551260e8cad132f70ed868fb28722a1f633bd05846fc79e5e8652f1d2cecd0a309498b1d4bd6850ac45f4535924b43aeee1aced56b014408022ad6 + languageName: node + linkType: hard + "@types/glob@npm:*": version: 8.1.0 resolution: "@types/glob@npm:8.1.0" @@ -20361,6 +21583,33 @@ __metadata: languageName: node linkType: hard +"@types/mapbox-gl@npm:^2.6.0": + version: 2.7.21 + resolution: "@types/mapbox-gl@npm:2.7.21" + dependencies: + "@types/geojson": "*" + checksum: 51bcf2a0481a53a8f8148af9b7f0f9e4d1be2ebdd9390194e4e4a0f8c8375446004c8624e67b4a255384cf0a0ae0c5b9eb99fa865acadca0ac0b0f5853f3f957 + languageName: node + linkType: hard + +"@types/mapbox__point-geometry@npm:*, @types/mapbox__point-geometry@npm:^0.1.2": + version: 0.1.4 + resolution: "@types/mapbox__point-geometry@npm:0.1.4" + checksum: 670191664ea0a6ccb4563500fe815a9aba029ba2f0528d42f9eb560ccb44f6542ba8674e2a3f6d41bd10ad8855b4df4782b5340c980ca182ef9fe6752f2737b8 + languageName: node + linkType: hard + +"@types/mapbox__vector-tile@npm:^1.3.0": + version: 1.3.4 + resolution: "@types/mapbox__vector-tile@npm:1.3.4" + dependencies: + "@types/geojson": "*" + "@types/mapbox__point-geometry": "*" + "@types/pbf": "*" + checksum: 082907ed9cf96b82327dabf3b4c3a14746a825e4a81f0abf46b50e2557f25cbda652725d8af002e5edcc344a83c85e1a4b71a2d39ef4d829c243344a85ac13a6 + languageName: node + linkType: hard + "@types/mime-types@npm:^2.1.1": version: 2.1.4 resolution: "@types/mime-types@npm:2.1.4" @@ -20471,6 +21720,13 @@ __metadata: languageName: node linkType: hard +"@types/pbf@npm:*, @types/pbf@npm:^3.0.2": + version: 3.0.5 + resolution: "@types/pbf@npm:3.0.5" + checksum: c32348c6c81e6c31fe4a1f59983e3a9904727b809fb1e5ddec4fad49abaf93070ec26ee0c04c6516536c181c945b3c7d9e226549eaac3b2e12cb7b57f549a49c + languageName: node + linkType: hard + "@types/pluralize@npm:^0.0.29": version: 0.0.29 resolution: "@types/pluralize@npm:0.0.29" @@ -23111,7 +24367,7 @@ __metadata: languageName: node linkType: hard -"aws-amplify@npm:^6.14.1, aws-amplify@npm:^6.15.7, aws-amplify@npm:^6.15.8": +"aws-amplify@npm:^6.14.1, aws-amplify@npm:^6.15.7, aws-amplify@npm:^6.15.8, aws-amplify@npm:^6.16.0": version: 6.16.3 resolution: "aws-amplify@npm:6.16.3" dependencies: @@ -23319,7 +24575,7 @@ __metadata: languageName: node linkType: hard -"axios@npm:1.13.6, axios@npm:^1.11.0, axios@npm:^1.8.3": +"axios@npm:1.13.6, axios@npm:^1.11.0, axios@npm:^1.8.3, axios@npm:latest": version: 1.13.6 resolution: "axios@npm:1.13.6" dependencies: @@ -24490,10 +25746,10 @@ __metadata: languageName: node linkType: hard -"cdk-from-cfn@npm:^0.271.0": - version: 0.271.0 - resolution: "cdk-from-cfn@npm:0.271.0" - checksum: dc7812dadc7808139138565e26bf321c65d9d07b73bd2cdad0aa70f7d02f9cced25214756b949ed389eac96ef47fdfed37bea4de24bec6331b0f8fcc2d859a7f +"cdk-from-cfn@npm:^0.291.0": + version: 0.291.0 + resolution: "cdk-from-cfn@npm:0.291.0" + checksum: f8014f8aded5d1b2091b5bbc9d825a958bf92c75f0cf11bf7b48c47756672e82c4ff71e043af15e5d7e6db6f09d8e1bbbb48f5fb01e955796a585069b13ffa43 languageName: node linkType: hard @@ -26044,6 +27300,13 @@ __metadata: languageName: node linkType: hard +"csscolorparser@npm:~1.0.3": + version: 1.0.3 + resolution: "csscolorparser@npm:1.0.3" + checksum: 57b30e1dd3e639fb74d63d3ee5a078ae6d0aaba26bc731fdec1a0f50fd77c2531a1fca2bbe07c18e0569255f92064cda0747e0115955fdb8c037332798ca634f + languageName: node + linkType: hard + "cssdb@npm:^7.1.0": version: 7.11.2 resolution: "cssdb@npm:7.11.2" @@ -26265,6 +27528,13 @@ __metadata: languageName: node linkType: hard +"debounce@npm:^1.2.1": + version: 1.2.1 + resolution: "debounce@npm:1.2.1" + checksum: 6c9320aa0973fc42050814621a7a8a78146c1975799b5b3cc1becf1f77ba9a5aa583987884230da0842a03f385def452fad5d60db97c3d1c8b824e38a8edf500 + languageName: node + linkType: hard + "debug@npm:2.6.9, debug@npm:^2.6.0": version: 2.6.9 resolution: "debug@npm:2.6.9" @@ -26944,6 +28214,13 @@ __metadata: languageName: node linkType: hard +"earcut@npm:^2.2.2, earcut@npm:^2.2.3, earcut@npm:^2.2.4": + version: 2.2.4 + resolution: "earcut@npm:2.2.4" + checksum: 01ca51830edd2787819f904ae580087d37351f6048b4565e7add4b3da8a86b7bc19262ab2aa7fdc64129ab03af2d9cec8cccee4d230c82275f97ef285c79aafb + languageName: node + linkType: hard + "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -29238,7 +30515,7 @@ __metadata: languageName: node linkType: hard -"fuzzy@npm:^0.1.3": +"fuzzy@npm:^0.1.1, fuzzy@npm:^0.1.3": version: 0.1.3 resolution: "fuzzy@npm:0.1.3" checksum: 584fcd57a03431707a6d0c1c4a41f17368cdb23d37dcb176d6cbbeeaecaac51be15dec229b3547acfb7db052cb066fcd86db907d40112ac4a3d3a368f88e7105 @@ -29268,6 +30545,33 @@ __metadata: languageName: node linkType: hard +"geojson-flatten@npm:^1.0.4": + version: 1.1.1 + resolution: "geojson-flatten@npm:1.1.1" + checksum: 7d8eb78f34fad41894c140cb13e32941c56923a07812805e7d12c8dd56f58d64c5689fbf9646bbaa828b461cc1c0718b15816248066902ce7d49d501a5305edd + languageName: node + linkType: hard + +"geojson-rbush@npm:3.x": + version: 3.2.0 + resolution: "geojson-rbush@npm:3.2.0" + dependencies: + "@turf/bbox": "*" + "@turf/helpers": 6.x + "@turf/meta": 6.x + "@types/geojson": 7946.0.8 + rbush: ^3.0.1 + checksum: 6d8b9e512cb076af62983bbe1783760dfdca8f5ce37ee731b55e1dc984ff5a4868cf2d30f9e8fa8ff3d682e3498e256876bff5057fc9b00920287021ff42fe39 + languageName: node + linkType: hard + +"geojson-vt@npm:^3.2.1": + version: 3.2.1 + resolution: "geojson-vt@npm:3.2.1" + checksum: db2fc1a452067ee8436fa86e5a138f6ebd3d64893e0af097bc1cc960ec63d67c0ce77444711e9583036192d6bf9ce754bf9b56a76789684fc0fea4d52321fffc + languageName: node + linkType: hard + "get-caller-file@npm:^2.0.1, get-caller-file@npm:^2.0.5": version: 2.0.5 resolution: "get-caller-file@npm:2.0.5" @@ -29371,7 +30675,7 @@ __metadata: languageName: node linkType: hard -"get-stream@npm:^6.0.0": +"get-stream@npm:^6.0.0, get-stream@npm:^6.0.1": version: 6.0.1 resolution: "get-stream@npm:6.0.1" checksum: 49825d57d3fd6964228e6200a58169464b8e8970489b3acdc24906c782fb7f01f9f56f8e6653c4a50713771d6658f7cfe051e5eb8c12e334138c9c918b296341 @@ -29518,6 +30822,13 @@ __metadata: languageName: node linkType: hard +"gl-matrix@npm:^3.2.1, gl-matrix@npm:^3.4.3": + version: 3.4.4 + resolution: "gl-matrix@npm:3.4.4" + checksum: 9aa022ffac0d158212ad0cd29939864ad919ac31cd5dc5a5d35e9d66bb62679ddf152ff7b2173ded20131045e40572b87f31b26a920be2a7583a1516b13b5b4b + languageName: node + linkType: hard + "glob-parent@npm:^6.0.2": version: 6.0.2 resolution: "glob-parent@npm:6.0.2" @@ -30110,6 +31421,13 @@ __metadata: languageName: node linkType: hard +"grid-index@npm:^1.1.0": + version: 1.1.0 + resolution: "grid-index@npm:1.1.0" + checksum: 0ba2a622a52badc86642a002abee79b48c207092347e869528253e634573b9b55494db649fbd1779122d797aaa3b59e284023a96a7a5c666c7375f0e320f8f57 + languageName: node + linkType: hard + "growl@npm:^1.10.5": version: 1.10.5 resolution: "growl@npm:1.10.5" @@ -30340,6 +31658,13 @@ __metadata: languageName: node linkType: hard +"hat@npm:0.0.3": + version: 0.0.3 + resolution: "hat@npm:0.0.3" + checksum: 9d502b26b612ed3e66491296873119574e61a4ef99dfc5501f7bf86115fde35d0f76b1167257c8224c88092eda04e40feda805ad5b86c3b90203f4e15fd99f53 + languageName: node + linkType: hard + "he@npm:^1.2.0": version: 1.2.0 resolution: "he@npm:1.2.0" @@ -30748,7 +32073,7 @@ __metadata: languageName: node linkType: hard -"ieee754@npm:^1.1.13, ieee754@npm:^1.1.4, ieee754@npm:^1.2.1": +"ieee754@npm:^1.1.12, ieee754@npm:^1.1.13, ieee754@npm:^1.1.4, ieee754@npm:^1.2.1": version: 1.2.1 resolution: "ieee754@npm:1.2.1" checksum: b0782ef5e0935b9f12883a2e2aa37baa75da6e66ce6515c168697b42160807d9330de9a32ec1ed73149aea02e0d822e572bca6f1e22bdcbd2149e13b050b17bb @@ -33329,6 +34654,13 @@ __metadata: languageName: node linkType: hard +"kdbush@npm:^3.0.0": + version: 3.0.0 + resolution: "kdbush@npm:3.0.0" + checksum: 3fc8795870bd04f60627e7345b26fd0644beb91bc4164912c9d9378b39c674ba01c31db68ecaf6266d51c9ad81bf5b770b7effa51eeee37553d38293a094a686 + languageName: node + linkType: hard + "keyboard-key@npm:^1.1.0": version: 1.1.0 resolution: "keyboard-key@npm:1.1.0" @@ -33780,13 +35112,20 @@ __metadata: languageName: node linkType: hard -"lodash.debounce@npm:^4.0.8": +"lodash.debounce@npm:^4.0.6, lodash.debounce@npm:^4.0.8": version: 4.0.8 resolution: "lodash.debounce@npm:4.0.8" checksum: 762998a63e095412b6099b8290903e0a8ddcb353ac6e2e0f2d7e7d03abd4275fe3c689d88960eb90b0dde4f177554d51a690f22a343932ecbc50a5d111849987 languageName: node linkType: hard +"lodash.isequal@npm:^4.5.0": + version: 4.5.0 + resolution: "lodash.isequal@npm:4.5.0" + checksum: dfdb2356db19631a4b445d5f37868a095e2402292d59539a987f134a8778c62a2810c2452d11ae9e6dcac71fc9de40a6fedcb20e2952a15b431ad8b29e50e28f + languageName: node + linkType: hard + "lodash.ismatch@npm:^4.4.0": version: 4.4.0 resolution: "lodash.ismatch@npm:4.4.0" @@ -34155,6 +35494,136 @@ __metadata: languageName: node linkType: hard +"mapbox-gl@npm:1.13.1": + version: 1.13.1 + resolution: "mapbox-gl@npm:1.13.1" + dependencies: + "@mapbox/geojson-rewind": ^0.5.0 + "@mapbox/geojson-types": ^1.0.2 + "@mapbox/jsonlint-lines-primitives": ^2.0.2 + "@mapbox/mapbox-gl-supported": ^1.5.0 + "@mapbox/point-geometry": ^0.1.0 + "@mapbox/tiny-sdf": ^1.1.1 + "@mapbox/unitbezier": ^0.0.0 + "@mapbox/vector-tile": ^1.3.1 + "@mapbox/whoots-js": ^3.1.0 + csscolorparser: ~1.0.3 + earcut: ^2.2.2 + geojson-vt: ^3.2.1 + gl-matrix: ^3.2.1 + grid-index: ^1.1.0 + minimist: ^1.2.5 + murmurhash-js: ^1.0.0 + pbf: ^3.2.1 + potpack: ^1.0.1 + quickselect: ^2.0.0 + rw: ^1.3.3 + supercluster: ^7.1.0 + tinyqueue: ^2.0.3 + vt-pbf: ^3.1.1 + checksum: d507b1ce27fe77ed68250096a60a929ea4149fcab3f7037f60a7b73709391a6f78413aa4e98fd2f5e37388cb1a040b5cc15cbf8b164fdb65d98362ba726523d6 + languageName: node + linkType: hard + +"maplibre-gl-draw-circle@npm:^0.1.1": + version: 0.1.1 + resolution: "maplibre-gl-draw-circle@npm:0.1.1" + dependencies: + "@mapbox/mapbox-gl-draw": 1.3.0 + "@turf/along": ^6.0.1 + "@turf/circle": ^6.0.1 + "@turf/distance": ^6.0.1 + "@turf/helpers": ^6.1.4 + "@turf/length": ^6.0.2 + checksum: 6ed336f93954bf0dd0b41c1cd226eba2450525a66ddfa8f7951a67889a2c1fc466d21d58e9475ab446e3d718254730fcc1c13b616c76b7e34668088935a923ce + languageName: node + linkType: hard + +"maplibre-gl-js-amplify@npm:^4.0.2": + version: 4.0.2 + resolution: "maplibre-gl-js-amplify@npm:4.0.2" + dependencies: + "@mapbox/mapbox-gl-draw": 1.3.0 + "@maplibre/maplibre-gl-geocoder": 1.5.0 + "@turf/along": ^6.5.0 + "@turf/circle": ^6.5.0 + "@turf/distance": ^6.5.0 + "@turf/helpers": ^6.5.0 + "@turf/length": ^6.5.0 + "@turf/line-slice": ^6.5.0 + debounce: ^1.2.1 + maplibre-gl-draw-circle: ^0.1.1 + peerDependencies: + "@aws-amplify/geo": 3.x.x + aws-amplify: 6.x.x + maplibre-gl: 1.x.x || 2.x.x + checksum: 6a03d1457626914c17cf9c3d8bf8de3f437fa0e68b2d659c510db153089105740c8fe24b8ca95e5a711994f2cadb512c290ef86d4e75c0e77adf6d56d761144a + languageName: node + linkType: hard + +"maplibre-gl@npm:2.1.9": + version: 2.1.9 + resolution: "maplibre-gl@npm:2.1.9" + dependencies: + "@mapbox/geojson-rewind": ^0.5.1 + "@mapbox/jsonlint-lines-primitives": ^2.0.2 + "@mapbox/mapbox-gl-supported": ^2.0.1 + "@mapbox/point-geometry": ^0.1.0 + "@mapbox/tiny-sdf": ^2.0.4 + "@mapbox/unitbezier": ^0.0.1 + "@mapbox/vector-tile": ^1.3.1 + "@mapbox/whoots-js": ^3.1.0 + "@types/geojson": ^7946.0.8 + "@types/mapbox__point-geometry": ^0.1.2 + "@types/mapbox__vector-tile": ^1.3.0 + "@types/pbf": ^3.0.2 + csscolorparser: ~1.0.3 + earcut: ^2.2.3 + geojson-vt: ^3.2.1 + gl-matrix: ^3.4.3 + murmurhash-js: ^1.0.0 + pbf: ^3.2.1 + potpack: ^1.0.2 + quickselect: ^2.0.0 + supercluster: ^7.1.4 + tinyqueue: ^2.0.3 + vt-pbf: ^3.1.3 + checksum: 9f4c6c60e7a45a79c28f3125eee1e14a5092efedbb4c555c0fa6d6ac0715372cd9844433cc802ef149fbfe97ebb3aac3fda5bb26b4a1e756aad440dba5ed355f + languageName: node + linkType: hard + +"maplibre-gl@npm:^2.4.0": + version: 2.4.0 + resolution: "maplibre-gl@npm:2.4.0" + dependencies: + "@mapbox/geojson-rewind": ^0.5.2 + "@mapbox/jsonlint-lines-primitives": ^2.0.2 + "@mapbox/mapbox-gl-supported": ^2.0.1 + "@mapbox/point-geometry": ^0.1.0 + "@mapbox/tiny-sdf": ^2.0.5 + "@mapbox/unitbezier": ^0.0.1 + "@mapbox/vector-tile": ^1.3.1 + "@mapbox/whoots-js": ^3.1.0 + "@types/geojson": ^7946.0.10 + "@types/mapbox__point-geometry": ^0.1.2 + "@types/mapbox__vector-tile": ^1.3.0 + "@types/pbf": ^3.0.2 + csscolorparser: ~1.0.3 + earcut: ^2.2.4 + geojson-vt: ^3.2.1 + gl-matrix: ^3.4.3 + global-prefix: ^3.0.0 + murmurhash-js: ^1.0.0 + pbf: ^3.2.1 + potpack: ^1.0.2 + quickselect: ^2.0.0 + supercluster: ^7.1.5 + tinyqueue: ^2.0.3 + vt-pbf: ^3.1.3 + checksum: 98d5860fb222e836b06e9f66635fb9559df0c3abc39180a0ddd5c4f2b21eb68243716b95148bd51f3dce6a3d4fa7aa97546d4e29162991c1317062f1434ba38d + languageName: node + linkType: hard + "markdown-it@npm:^12.2.0": version: 12.3.2 resolution: "markdown-it@npm:12.3.2" @@ -34873,6 +36342,13 @@ __metadata: languageName: node linkType: hard +"murmurhash-js@npm:^1.0.0": + version: 1.0.0 + resolution: "murmurhash-js@npm:1.0.0" + checksum: f8569e16db0ba6f953bf88286e97cf737f1efe97b224e537c9308566ab963a067c7eca5b636fb473d6413c4cc3b79690b78ff7ab0f290e75db91c6fde0df92b4 + languageName: node + linkType: hard + "mute-stream@npm:0.0.7": version: 0.0.7 resolution: "mute-stream@npm:0.0.7" @@ -36374,6 +37850,18 @@ __metadata: languageName: node linkType: hard +"pbf@npm:^3.2.1": + version: 3.3.0 + resolution: "pbf@npm:3.3.0" + dependencies: + ieee754: ^1.1.12 + resolve-protobuf-schema: ^2.1.0 + bin: + pbf: bin/pbf + checksum: 79e5dc59a9391789de84b0a6d713fad0dd1e5ce6eb721536af8c9ec49feae04fdebab9f077b760bba858e615a95ac714a7d248ecb43736e904bb8396885e16d6 + languageName: node + linkType: hard + "pbkdf2@npm:^3.1.2, pbkdf2@npm:^3.1.5": version: 3.1.5 resolution: "pbkdf2@npm:3.1.5" @@ -37499,6 +38987,13 @@ __metadata: languageName: node linkType: hard +"potpack@npm:^1.0.1, potpack@npm:^1.0.2": + version: 1.0.2 + resolution: "potpack@npm:1.0.2" + checksum: 670c23898a4257130858b960c2e654d3327c0f6a7e7091ff5846f213e65af8f9476320b995b8ad561a47a4d1c359c7ef347de57d22e7b02597051abb52bc85c4 + languageName: node + linkType: hard + "prebuild-install@npm:^7.1.1": version: 7.1.3 resolution: "prebuild-install@npm:7.1.3" @@ -37805,6 +39300,13 @@ __metadata: languageName: node linkType: hard +"protocol-buffers-schema@npm:^3.3.1": + version: 3.6.0 + resolution: "protocol-buffers-schema@npm:3.6.0" + checksum: 23a08612e5cc903f917ae3b680216ccaf2d889c61daa68d224237f455182fa96fff16872ac94b1954b5dd26fc7e8ce7e9360c54d54ea26218d107b2f059fca37 + languageName: node + linkType: hard + "protocols@npm:^2.0.0, protocols@npm:^2.0.1": version: 2.0.2 resolution: "protocols@npm:2.0.2" @@ -38033,6 +39535,13 @@ __metadata: languageName: node linkType: hard +"quickselect@npm:^2.0.0": + version: 2.0.0 + resolution: "quickselect@npm:2.0.0" + checksum: 6c8d591bc73beae4c1996b7b7138233a7dbbbdde29b7b6d822a02d08cd220fd27613f47d6e9635989b12e250d42ef9da3448de1ed12ad962974e207ab3c3562c + languageName: node + linkType: hard + "raf@npm:^3.4.1": version: 3.4.1 resolution: "raf@npm:3.4.1" @@ -38080,6 +39589,15 @@ __metadata: languageName: node linkType: hard +"rbush@npm:^3.0.1": + version: 3.0.1 + resolution: "rbush@npm:3.0.1" + dependencies: + quickselect: ^2.0.0 + checksum: 55311586c30cdedaa2220de6f1da45fe1fa806263afbf7b6f4c0078983830c2abc7771187896d68bfc9078cb279079fb4c84971831da4b74384aab2c2c417758 + languageName: node + linkType: hard + "rc@npm:1.2.8, rc@npm:^1.2.7, rc@npm:^1.2.8": version: 1.2.8 resolution: "rc@npm:1.2.8" @@ -38220,6 +39738,18 @@ __metadata: languageName: node linkType: hard +"react-map-gl@npm:7.0.23": + version: 7.0.23 + resolution: "react-map-gl@npm:7.0.23" + dependencies: + "@types/mapbox-gl": ^2.6.0 + peerDependencies: + mapbox-gl: "*" + react: ">=16.3.0" + checksum: 3c4b98278c73426e3aa333dc92e6c9352af9b75de99ef82d14e98b47a47dfc6c4a86649a80246accc5b212ba90b7f3e8344b4ed5714dc98717a9ae3fe8238564 + languageName: node + linkType: hard + "react-native-get-random-values@npm:^1.4.0": version: 1.11.0 resolution: "react-native-get-random-values@npm:1.11.0" @@ -38842,6 +40372,15 @@ __metadata: languageName: node linkType: hard +"resolve-protobuf-schema@npm:^2.1.0": + version: 2.1.0 + resolution: "resolve-protobuf-schema@npm:2.1.0" + dependencies: + protocol-buffers-schema: ^3.3.1 + checksum: 8e656b9072b1c001952f851251413bc79d8c771c3015f607b75e1ca3b8bd7c4396068dd19cdbb3019affa03f6457d2c0fd38d981ffd714215cd2e7c2b67221a7 + languageName: node + linkType: hard + "resolve-url-loader@npm:^5.0.0": version: 5.0.0 resolution: "resolve-url-loader@npm:5.0.0" @@ -39190,6 +40729,20 @@ __metadata: languageName: node linkType: hard +"rw@npm:^1.3.3": + version: 1.3.3 + resolution: "rw@npm:1.3.3" + checksum: b1e1ef37d1e79d9dc7050787866e30b6ddcb2625149276045c262c6b4d53075ddc35f387a856a8e76f0d0df59f4cd58fe24707e40797ebee66e542b840ed6a53 + languageName: node + linkType: hard + +"rw@npm:~0.1.4": + version: 0.1.4 + resolution: "rw@npm:0.1.4" + checksum: 2defba766085374cf49adc725a0b811ee2b9a0d344d323b51ca96a2222ffc8c72faaa2806df60bed396e206d0ee47319632b1ed9049db71de963135f5f3981de + languageName: node + linkType: hard + "rxjs@npm:^6.4.0, rxjs@npm:^6.6.0": version: 6.6.7 resolution: "rxjs@npm:6.6.7" @@ -40713,6 +42266,13 @@ __metadata: languageName: node linkType: hard +"subtag@npm:^0.5.0": + version: 0.5.0 + resolution: "subtag@npm:0.5.0" + checksum: f2827c76458cc1871c12c98d11d519c6027dee796c250fee0c5dc47d8afbab634afe9fe992de51887c5dd7172dd115501dcfc077f098bae81471f241260eb115 + languageName: node + linkType: hard + "sucrase@npm:^3.35.0": version: 3.35.1 resolution: "sucrase@npm:3.35.1" @@ -40731,6 +42291,25 @@ __metadata: languageName: node linkType: hard +"suggestions-list@npm:^0.0.2": + version: 0.0.2 + resolution: "suggestions-list@npm:0.0.2" + dependencies: + fuzzy: ^0.1.1 + xtend: ^4.0.0 + checksum: 76ffa6031c355b1c89b340ee6e24a0deee479357e51f3c4a1d9a7c12a6fd96b6351c465043d9948da52c0eb7888e96cadba737c9aeb2720231eaec9398bf807a + languageName: node + linkType: hard + +"supercluster@npm:^7.1.0, supercluster@npm:^7.1.4, supercluster@npm:^7.1.5": + version: 7.1.5 + resolution: "supercluster@npm:7.1.5" + dependencies: + kdbush: ^3.0.0 + checksum: bbebf45927d0019831731c94b78d1c9a1f3e2da0be9875d7ea75c6f261487e0f15d3f1822a9a49256e3c1672bdfb9138f9a5e44e2de99edb06cd1e758083e12d + languageName: node + linkType: hard + "supports-color@npm:^3.1.0": version: 3.2.3 resolution: "supports-color@npm:3.2.3" @@ -41234,6 +42813,13 @@ __metadata: languageName: node linkType: hard +"tinyqueue@npm:^2.0.3": + version: 2.0.3 + resolution: "tinyqueue@npm:2.0.3" + checksum: d7b590088f015a94a17132fa209c2f2a80c45158259af5474901fdf5932e95ea13ff6f034bcc725a6d5f66d3e5b888b048c310229beb25ad5bebb4f0a635abf2 + languageName: node + linkType: hard + "tinyrainbow@npm:^3.0.3": version: 3.0.3 resolution: "tinyrainbow@npm:3.0.3" @@ -41363,6 +42949,17 @@ __metadata: languageName: node linkType: hard +"traverse@npm:~0.6.6": + version: 0.6.11 + resolution: "traverse@npm:0.6.11" + dependencies: + gopd: ^1.2.0 + typedarray.prototype.slice: ^1.0.5 + which-typed-array: ^1.1.18 + checksum: 2b57662da3061ed2aa9977a6a3e315fc19f2cfdeb691700a88c12f4d460146abdb4d726740f47a9ca5fa84d3c50096b76ee50047d1a71c2afb168852ad264e36 + languageName: node + linkType: hard + "tree-dump@npm:^1.0.3, tree-dump@npm:^1.1.0": version: 1.1.0 resolution: "tree-dump@npm:1.1.0" @@ -41866,6 +43463,22 @@ __metadata: languageName: node linkType: hard +"typedarray.prototype.slice@npm:^1.0.5": + version: 1.0.5 + resolution: "typedarray.prototype.slice@npm:1.0.5" + dependencies: + call-bind: ^1.0.8 + define-properties: ^1.2.1 + es-abstract: ^1.23.9 + es-errors: ^1.3.0 + get-proto: ^1.0.1 + math-intrinsics: ^1.1.0 + typed-array-buffer: ^1.0.3 + typed-array-byte-offset: ^1.0.4 + checksum: 4995828640f8079cfbc9e3b4b8fc2e0eeb109edd1a2596806325ae07306dba1cd947e6ed6f63391aa7d5af0ea4f40fddf1b6eb863f8a59869a9dfc5dcfd8eac2 + languageName: node + linkType: hard + "typedarray@npm:^0.0.6": version: 0.0.6 resolution: "typedarray@npm:0.0.6" @@ -42787,6 +44400,17 @@ __metadata: languageName: node linkType: hard +"vt-pbf@npm:^3.1.1, vt-pbf@npm:^3.1.3": + version: 3.1.3 + resolution: "vt-pbf@npm:3.1.3" + dependencies: + "@mapbox/point-geometry": 0.1.0 + "@mapbox/vector-tile": ^1.3.1 + pbf: ^3.2.1 + checksum: a568801ae25f0ffe65ef697bf520c996c8a4067f73f355c0d5815238de90322c8ca207c61220206141cfe6f5b525de875b7eb26e22979a1b768b96d03b93dca7 + languageName: node + linkType: hard + "wait-port@npm:^0.2.7": version: 0.2.14 resolution: "wait-port@npm:0.2.14" @@ -43047,6 +44671,13 @@ __metadata: languageName: node linkType: hard +"wgs84@npm:0.0.0": + version: 0.0.0 + resolution: "wgs84@npm:0.0.0" + checksum: 4f4094c7149fbb50e89ab415aeb2db565c66746be18702ea82ab75c6e6e2a58b552d0898f4b8d6a16bf5824a14917577e46e04a8b20fbf9f09f06d755d381c0b + languageName: node + linkType: hard + "whatwg-fetch@npm:^2.0.4": version: 2.0.4 resolution: "whatwg-fetch@npm:2.0.4" @@ -43153,7 +44784,7 @@ __metadata: languageName: node linkType: hard -"which-typed-array@npm:^1.1.16, which-typed-array@npm:^1.1.19, which-typed-array@npm:^1.1.2": +"which-typed-array@npm:^1.1.16, which-typed-array@npm:^1.1.18, which-typed-array@npm:^1.1.19, which-typed-array@npm:^1.1.2": version: 1.1.20 resolution: "which-typed-array@npm:1.1.20" dependencies: @@ -43723,7 +45354,7 @@ __metadata: languageName: node linkType: hard -"xtend@npm:^4.0.0, xtend@npm:~4.0.1": +"xtend@npm:^4.0.0, xtend@npm:^4.0.1, xtend@npm:^4.0.2, xtend@npm:~4.0.1": version: 4.0.2 resolution: "xtend@npm:4.0.2" checksum: 366ae4783eec6100f8a02dff02ac907bf29f9a00b82ac0264b4d8b832ead18306797e283cf19de776538babfdcb2101375ec5646b59f08c52128ac4ab812ed0e