Error creating Migration Assistant cloudformation stack

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Migration Assistant
Elasticsearch 7.10
Opensearch 2.15

Describe the issue:
I need to migrate from Elasticsearch 7.10 to Opensearch 2.15 as a storage back end for graylog. To test the migration process I have implemented a graylog installation in k8s via helm, with elasticsearch 7.10, which I have confirmed working. I have also installed opensearch 2.15 via helm, which is also working.

I have been working through the Migration Assistant guide here:

I have completed steps 1 to 3, which has created the MigrationBootstrap cloudformation stack, including a VPC and an EC2 instance named bootstrap-dev-instance. I have ensured the EC2 instance can reach the elasticsearch and opensearch clusters, and have confirmed that they are both accessible via curl from that instance.

Step 4 of the migration guide involves running this command to deploy further cloudformation stacks:
cdk bootstrap --c contextId=migration-assistant --require-approval never

When I run that command I get an error:

App Registry mode is enabled for CFN stack tracking. Will attempt to import the App Registry application from the MIGRATIONS_APP_REGISTRY_ARN env variable of arn:aws:servicecatalog:eu-west-2:725219999999:/applications/09w564891ocjn5vp87azv5mlj0 and looking in the configured region of eu-west-2
/opensearch-migrations/deployment/cdk/opensearch-service-migration/lib/stack-composer.ts:128
            throw new Error(`No CDK context block found for contextId '${contextId}'`)
                  ^
Error: No CDK context block found for contextId 'migration-assistant'
    at StackComposer.parseContextBlock (/opensearch-migrations/deployment/cdk/opensearch-service-migration/lib/stack-composer.ts:128:19)
    at new StackComposer (/opensearch-migrations/deployment/cdk/opensearch-service-migration/lib/stack-composer.ts:153:34)
    at createApp (/opensearch-migrations/deployment/cdk/opensearch-service-migration/bin/createApp.ts:27:3)
    at Object.<anonymous> (/opensearch-migrations/deployment/cdk/opensearch-service-migration/bin/app.ts:5:22)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module.m._compile (/opensearch-migrations/deployment/cdk/opensearch-service-migration/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Object.require.extensions.<computed> [as .ts] (/opensearch-migrations/deployment/cdk/opensearch-service-migration/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1019:12)

NOTICES         (What's this? https://github.com/aws/aws-cdk/wiki/CLI-Notices)

34635	Support for this Node.js version will end soon

	Overview: Support for Node.js v18.20.2 ends on November 30,
	          2025. Please upgrade to a recent LTS version.

	Affected versions: node: >=18.0.0 <20.0.0

	More information at: https://github.com/aws/aws-cdk/issues/34635


If you don’t want to see a notice anymore, use "cdk acknowledge <id>". For example, "cdk acknowledge 34635".

Configuration:
The elasticsearch and opensearch clusters are both installed on a k8s cluster in a separate VPC, but exposed via a loadbalancer with peering connections and routing in place between that and the migration assistant VPC.
cdk.context.json has bee configured with these details (even though this is a test cluster the ARNs have been obfuscated)

A curl to either of the endpoints succeeds

{
  "default": {
    "stage": "dev",
    "targetCluster": {
      "endpoint": "https://a4a9ce2b8b81d4b5c92dbb5f782c9826-9999999999.eu-west-2.elb.amazonaws.com:9200",
      "auth": {
        "type": "basic",
        "// basic auth documentation": "The next two lines are relevant for basic auth only",
        "username": "admin",
        "passwordFromSecretArn": "arn:aws:secretsmanager:eu-west-2:725999999999:secret:migration-LtXXXX"
      }
    },
    "sourceCluster": {
      "endpoint": "http://af8e217f9ed584256a6a40bd323f157d-9999999999.eu-west-2.elb.amazonaws.com:9200",
      "version": "ES_7.10",
      "auth": {
        "type": "none"
      }
    },
    "MskEbsStorage":{
      "maxCapacity": 16384
    },
    "vpcId": "vpc-0db2faf9472ba828d",
    "reindexFromSnapshotServiceEnabled": true,
    "reindexFromSnapshotMaxShardSizeGiB": 80,

    "// settingsForCaptureAndReplay": "Enable the below services for live traffic capture and replay",
    "trafficReplayerServiceEnabled": false,

    "// help trafficReplayerExtraArgs": "Increase speedup factor in order replay requests at a faster rate to catchup",
    "trafficReplayerExtraArgs": "--speedup-factor 1.5",

    "// help capture/target proxy pt. 1 of 2": "captureProxyService and targetClusterProxyService require networking access configured to successfully deploy,",
    "// help capture/target proxy pt. 2 of 2": "consider deploying without first and enabling after ensuring cluster networking access on the migration console",
    "captureProxyServiceEnabled": false,
    "targetClusterProxyServiceEnabled": false
  }
}

Relevant Logs or Screenshots:

Hi @ajm2025, Thank you for reaching out to diagnose this issue!

Based on the provided information, the parameter passed in your case should be

contextId=default

This is due to the top level key in your context versus the documentation.

  "default": {

I agree this is confusing since it doesn’t align with the default deployed. To remedy, i’ll create a PR to update the documentation to align with the defaults here.

Please let us know if this resolved your issue!

The documentation was updated: [Backport 3.0] Add clarity to Migration Assistant documentation by aligning contextId in example with default in deployed solution by opensearch-trigger-bot[bot] · Pull Request #10077 · opensearch-project/documentation-website · GitHub.

It is now consistent with documentation found at https://docs.aws.amazon.com/solutions/latest/migration-assistant-for-amazon-opensearch-service/step-4-deploy-the-migration-stacks.html.