Skip to main content
⏳ Estimated read time: 2 min read
Important

You will need a StackGen Admin or DevOps access to run this command.

custom-cloud-migration-mappings

The stackgen upload custom-cloud-migration-mappings command allows you to upload custom mapping rules for cloud migration between different providers, helping automate the transformation of resources during migration.

Supported Clouds

All cloud providers.

Usage

stackgen upload custom-cloud-migration-mappings [flags]

Flags

FlagDescription
-p, --cloud-migration-mappings-file-path stringPath to cloud migration mappings file. (default "/home/user")
-h, --helpHelp for custom-cloud-migration-mappings.

Examples

stackgen upload custom-cloud-migration-mappings

This command will:

  • Look for cloud migration mappings in the default location,
  • Upload these mappings to the StackGen platform,
  • Make them available for use when migrating resources between cloud providers.

File Format

The cloud migration mappings file should be in JSON format and define how resources should be transformed between different cloud providers. Here's an example:

[
{
"name": "custom_cloud_migration_mappings",
"description": "Custom Cloud Migration Mappings Example",
"sourceCloud": "azure",
"destinationCloud": "aws",
"mappings": {
"azurerm_storage_container": {
"defaultTargetResourceType": "aws_s3_bucket",
"isCustomMapping": true,
"templateId": "test_template_id",
"attributeMapping": {
"azure_storage_container": {
"name": {
"aws_sr_s3_bucket": "name"
}
}
}
},
"azurerm_monitor_metric_alert": {
"defaultTargetResourceType": "aws_xray_group",
"migrationResourceClass": "monitoring",
"isCustomMapping": false
}
}
}
]

Each mapping definition in the array includes:

  • name: An identifier for the mapping set.
  • description: A brief explanation of the mapping purpose.
  • sourceCloud: The original cloud provider (e.g., "azure").
  • destinationCloud: The target cloud provider (e.g., "aws").
  • mappings: Resource type mappings with the following properties:
    • defaultTargetResourceType: The target resource type.
    • isCustomMapping: Boolean indicating if this is a custom mapping.
    • templateId: (Optional) Reference to a template ID.
    • attributeMapping: Detailed mapping of source resource attributes to target resource attributes.
    • migrationResourceClass: (Optional) Classification category for the resource.
note
  • Custom mappings enhance StackGen's ability to translate between cloud providers.
  • Validate your mapping file before uploading to ensure proper JSON format.