Skip to content

GCP.MigrationCenter reference

Source: packages/gcp/src/MigrationCenter/AssetsExportJob.ts

A Migration Center assets export job that writes inventory (and optional performance / network-dependency) data to signed-URI files.

The API has no patch method — changing format, filter, inventory flags, or labels replaces the job. Id and location are also immutable.

AssetsExportJob: Creating an Assets Export Job

Section titled “AssetsExportJob: Creating an Assets Export Job”

CSV inventory export

const job = yield* GCP.MigrationCenter.AssetsExportJob("Inventory", {
fileFormat: "CSV",
labels: { env: "test" },
});

XLSX with performance data

const job = yield* GCP.MigrationCenter.AssetsExportJob("Inventory", {
fileFormat: "XLSX",
performanceDataMaxDays: 40,
});

AssetsExportJob: Looking up an existing assets export job

Section titled “AssetsExportJob: Looking up an existing assets export job”

AssetsExportJob.lookup references an assets export job Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared assets export job.

const assetsExportJob = GCP.MigrationCenter.AssetsExportJob.lookup({
assetsExportJobId: "my-assets-export-job",
});

Source: packages/gcp/src/MigrationCenter/DiscoveryClient.ts

A Migration Center discovery client that reports on-prem asset frames for a source.

discoveryClientId, location, and source are immutable. Display name, description, service account, expiration, and labels update in place.

DiscoveryClient: Creating a Discovery Client

Section titled “DiscoveryClient: Creating a Discovery Client”
const source = yield* GCP.MigrationCenter.Source("Scanner", {
type: "SOURCE_TYPE_DISCOVERY_CLIENT",
});
const client = yield* GCP.MigrationCenter.DiscoveryClient("Agent", {
source: source.name,
serviceAccount: "scanner@my-project.iam.gserviceaccount.com",
displayName: "on-prem-agent",
});

DiscoveryClient: Looking up an existing discovery client

Section titled “DiscoveryClient: Looking up an existing discovery client”

DiscoveryClient.lookup references a discovery client Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared discovery client.

const discoveryClient = GCP.MigrationCenter.DiscoveryClient.lookup({
discoveryClientId: "my-discovery-client",
});

Source: packages/gcp/src/MigrationCenter/Group.ts

A Migration Center asset group used to bundle related assets and generate reports.

Changing groupId or location replaces the group. Display name, description, and labels update in place.

Generated name

const group = yield* GCP.MigrationCenter.Group("Workloads", {
displayName: "workloads",
labels: { env: "test" },
});

Explicit id

const group = yield* GCP.MigrationCenter.Group("Workloads", {
groupId: "app-workloads",
description: "production vms",
});

Group.lookup references a group Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared group.

const group = GCP.MigrationCenter.Group.lookup({ groupId: "my-group" });

Source: packages/gcp/src/MigrationCenter/ImportJob.ts

A Migration Center import job that ingests asset frames from uploaded payload files into a source.

importJobId, location, and assetSource are immutable. Display name and labels update in place. Nested import data files are force- deleted with the job.

const source = yield* GCP.MigrationCenter.Source("Inventory", {
type: "SOURCE_TYPE_UPLOAD",
});
const job = yield* GCP.MigrationCenter.ImportJob("Rvtools", {
assetSource: source.name,
displayName: "rvtools-import",
});

ImportJob: Looking up an existing import job

Section titled “ImportJob: Looking up an existing import job”

ImportJob.lookup references an import job Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared import job.

const importJob = GCP.MigrationCenter.ImportJob.lookup({
importJobId: "my-import-job",
});

Source: packages/gcp/src/MigrationCenter/ImportJobsImportDataFile.ts

A payload file attached to a Migration Center import job. Creating the file returns a signed URI that the client uploads inventory CSV/XLSX into.

Import data files have no labels field — Alchemy stamps ownership into the display name so list / nuke can find them. The API has no patch method; changing format or display name replaces the file.

ImportJobsImportDataFile: Creating an Import Data File

Section titled “ImportJobsImportDataFile: Creating an Import Data File”
const job = yield* GCP.MigrationCenter.ImportJob("Rvtools", {
assetSource: source.name,
});
const file = yield* GCP.MigrationCenter.ImportJobsImportDataFile("Payload", {
importJob: job.name,
format: "IMPORT_JOB_FORMAT_RVTOOLS_CSV",
displayName: "inventory",
});

ImportJobsImportDataFile: Looking up an existing import jobs import data file

Section titled “ImportJobsImportDataFile: Looking up an existing import jobs import data file”

ImportJobsImportDataFile.lookup references an import jobs import data file Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared import jobs import data file.

const importJobsImportDataFile = GCP.MigrationCenter.ImportJobsImportDataFile.lookup({
importDataFileId: "my-import-data-file",
importJob: "my-import-job",
});

Source: packages/gcp/src/MigrationCenter/PreferenceSet.ts

A Migration Center preference set capturing target-product, region, and sizing assumptions used when generating reports.

Preference sets have no labels field — Alchemy stamps ownership into the description so list / nuke can find them. Id and location are immutable. Display name, description, and VM preferences update in place.

Compute Engine defaults

const prefs = yield* GCP.MigrationCenter.PreferenceSet("Prod", {
displayName: "prod-gce",
});

Explicit VM preferences

const prefs = yield* GCP.MigrationCenter.PreferenceSet("Prod", {
virtualMachinePreferences: {
targetProduct: "COMPUTE_MIGRATION_TARGET_PRODUCT_COMPUTE_ENGINE",
regionPreferences: { preferredRegions: ["us-central1"] },
sizingOptimizationStrategy: "SIZING_OPTIMIZATION_STRATEGY_MODERATE",
commitmentPlan: "COMMITMENT_PLAN_THREE_YEARS",
},
});

PreferenceSet: Looking up an existing preference set

Section titled “PreferenceSet: Looking up an existing preference set”

PreferenceSet.lookup references a preference set Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared preference set.

const preferenceSet = GCP.MigrationCenter.PreferenceSet.lookup({
preferenceSetId: "my-preference-set",
});

Source: packages/gcp/src/MigrationCenter/ReportConfig.ts

A Migration Center report configuration that binds asset groups to preference sets for TCO reports.

Report configs have no labels field — Alchemy stamps ownership into the description so list / nuke can find them. The API has no patch method; changing assignments, display name, or description replaces the config. Nested reports are force-deleted with the config.

const group = yield* GCP.MigrationCenter.Group("Workloads", {});
const prefs = yield* GCP.MigrationCenter.PreferenceSet("Prod", {});
const config = yield* GCP.MigrationCenter.ReportConfig("Tco", {
displayName: "tco",
groupPreferencesetAssignments: [
{ group: group.name, preferenceSet: prefs.name },
],
});

ReportConfig: Looking up an existing report config

Section titled “ReportConfig: Looking up an existing report config”

ReportConfig.lookup references a report config Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared report config.

const reportConfig = GCP.MigrationCenter.ReportConfig.lookup({
reportConfigId: "my-report-config",
});

Source: packages/gcp/src/MigrationCenter/ReportConfigsReport.ts

A point-in-time Migration Center report rendered from a report config (typically a total cost of ownership view).

Reports have no labels field — Alchemy stamps ownership into the description so list / nuke can find them. The API has no patch method; changing type, display name, or description replaces the report.

const report = yield* GCP.MigrationCenter.ReportConfigsReport("Tco", {
reportConfig: config.name,
type: "TOTAL_COST_OF_OWNERSHIP",
displayName: "q1-tco",
});

ReportConfigsReport: Looking up an existing report configs report

Section titled “ReportConfigsReport: Looking up an existing report configs report”

ReportConfigsReport.lookup references a report configs report Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared report configs report.

const reportConfigsReport = GCP.MigrationCenter.ReportConfigsReport.lookup({
reportId: "my-report",
reportConfig: "my-report-config",
});

Source: packages/gcp/src/MigrationCenter/Source.ts

A Migration Center source that streams asset frames into a project.

Sources have no labels field — Alchemy stamps ownership into the description so list / nuke can find them. sourceId, location, and type are immutable. Display name, description, and priority update in place.

Upload source

const source = yield* GCP.MigrationCenter.Source("Inventory", {
type: "SOURCE_TYPE_UPLOAD",
displayName: "rvtools",
});

Discovery-client source

const source = yield* GCP.MigrationCenter.Source("Scanner", {
type: "SOURCE_TYPE_DISCOVERY_CLIENT",
description: "on-prem scanner",
});

Source.lookup references a source Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared source.

const source = GCP.MigrationCenter.Source.lookup({ sourceId: "my-source" });