{"id":19024379,"url":"https://github.com/aws-solutions/cloud-migration-factory-on-aws","last_synced_at":"2025-04-05T16:10:04.161Z","repository":{"id":41449881,"uuid":"249775638","full_name":"aws-solutions/cloud-migration-factory-on-aws","owner":"aws-solutions","description":"The Cloud Migration Factory on AWS solution is designed to coordinate and automate manual processes for large-scale migrations. This solution helps enterprises improve performance and prevents long cutover windows by providing an orchestration platform for migrating workloads to AWS at scale.","archived":false,"fork":false,"pushed_at":"2025-03-11T13:33:49.000Z","size":8961,"stargazers_count":64,"open_issues_count":5,"forks_count":64,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-03-29T15:11:15.438Z","etag":null,"topics":["automation","aws","mgn","migration"],"latest_commit_sha":null,"homepage":"https://aws.amazon.com/solutions/implementations/cloud-migration-factory-on-aws/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aws-solutions.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-24T17:38:17.000Z","updated_at":"2025-03-11T13:32:56.000Z","dependencies_parsed_at":"2023-12-18T19:43:32.706Z","dependency_job_id":"f7bd5c8a-e628-48a2-a293-8baed384504b","html_url":"https://github.com/aws-solutions/cloud-migration-factory-on-aws","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-solutions%2Fcloud-migration-factory-on-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-solutions%2Fcloud-migration-factory-on-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-solutions%2Fcloud-migration-factory-on-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-solutions%2Fcloud-migration-factory-on-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aws-solutions","download_url":"https://codeload.github.com/aws-solutions/cloud-migration-factory-on-aws/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361693,"owners_count":20926643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","aws","mgn","migration"],"created_at":"2024-11-08T20:36:33.584Z","updated_at":"2025-04-05T16:10:04.131Z","avatar_url":"https://github.com/aws-solutions.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloud Migration Factory on AWS\nCloud Migration Factory on AWS is an AWS Solutions Implementation that helps migrate a large number of servers with CloudEndure Migration in a simplified and expedited way at scale. The solution automates many of the manual, time-consuming tasks that enterprises commonly face in migrating servers from on-premise to the cloud; for example, checking prerequisites on the source machine, installing/uninstalling software on the source and target machine. Thousands of servers have been migrated to AWS using this solution. When customers deploy the solution, its AWS CloudFormation template automatically provisions and configures the necessary AWS services.\n\nThe solution also deploys Amazon CloudFront, Amazon API Gateway, AWS Lambda, Amazon Cognito, Amazon S3, and Amazon DynamoDB. To learn more about AWS Cloud Migration Factory Solution, see the AWS Solutions Implementation webpage.\n\nFor more information about the implementation guide, please visit the AWS Prescriptive Guidance:\nhttps://docs.aws.amazon.com/solutions/latest/aws-cloudendure-migration-factory-solution/welcome.html\n\nFor more information about the best practices using this solution, please visit the AWS Prescriptive Guidance:\nhttps://docs.aws.amazon.com/prescriptive-guidance/latest/migration-factory-cloudendure\n***\n## File Structure\n\n```\n|-deployment/\n    |-aws-cloud-migration-factory-solution.template                          [ CloudFormation template to deploy the base solution ]\n    |-aws-cloud-migration-factory-solution-automation.template               [ Nested CloudFormation template to deploy the remote automation feature ]\n    |-aws-cloud-migration-factory-solution-credentialmanager.template        [ Nested CloudFormation template to deploy the credential manager feature ]\n    |-aws-cloud-migration-factory-solution-mgn.template                      [ Nested CloudFormation template to deploy MGN Lambda ]\n    |-aws-cloud-migration-factory-solution-replatform.template               [ Nested CloudFormation template to deploy replatform feature ]\n    |-aws-cloud-migration-factory-solution-tracker.template                  [ Nested CloudFormation template to deploy migration tracker ]\n    |-aws-cloud-migration-factory-solution-waf-be.template                   [ Nested CloudFormation template to deploy the optional WAF in front of API Gateway and Cognito ]\n    |-aws-cloud-migration-factory-solution-waf-fe.template                   [ Nested CloudFormation template to deploy the optional WAF in front of CloudFront ]\n    |-aws-cloud-migration-factory-solution-target-account.template           [ CloudFormation template to deploy target account IAM roles ]\n    \n|-source/\n    |-backend/                     [ folder containing backend code ]\n      |-lambda_functions           [ folder containing all lambda function, each sub folder is a lambda function ]\n      |-lambda_layers              [ folder containing all lambda layers, each sub folder is a lambda layer used in one or more lambda functions as defined in the CloudFormation templates ]\n      |-lambda_unittests           [ folder containing lambda function unit tests ]\n    |-frontend/                    [ folder containing frontend code ]\n    |-integrations/                [ folder containing tool integration code ]    \n\n```\n***\n## Customization\n\nThe steps given below can be followed if you are looking to customize or extend the solution.\n\n### Build\n\nTo build your customized distributable follow given steps.\n\n- Create two S3 buckets (you can use the CLI commands below).\n- First bucket with the format '\u003cBUCKET-NAME\u003e-reference' to deploy the templates into. \n- Second bucket with the format '\u003cBUCKET-NAME\u003e-\u003cAWS_REGION\u003e' to deploy the assets into. The solution's CloudFormation template will expect the source code to be located in this bucket. \u003cAWS_REGION\u003e is where you are testing the customized solution.\n\n```\nACCOUNT_ID=$(aws sts get-caller-identity --output text --query Account --profile \u003cPROFILE_NAME\u003e)\nREGION=$(aws configure get region --profile \u003cPROFILE_NAME\u003e)\nBASE_BUCKET_NAME=cmf-deployment-$ACCOUNT_ID\nTEMPLATE_BUCKET_NAME=$BASE_BUCKET_NAME-reference\nASSET_BUCKET_NAME=$BASE_BUCKET_NAME-$REGION\naws s3 mb s3://$TEMPLATE_BUCKET_NAME/\naws s3 mb s3://$ASSET_BUCKET_NAME/\n\n# Default encryption:\naws s3api put-bucket-encryption \\\n  --bucket $TEMPLATE_BUCKET_NAME \\\n  --server-side-encryption-configuration '{\"Rules\": [{\"ApplyServerSideEncryptionByDefault\": {\"SSEAlgorithm\": \"AES256\"}}]}'\n\naws s3api put-bucket-encryption \\\n  --bucket $ASSET_BUCKET_NAME \\\n  --server-side-encryption-configuration '{\"Rules\": [{\"ApplyServerSideEncryptionByDefault\": {\"SSEAlgorithm\": \"AES256\"}}]}'\n\n# Enable public access block:\naws s3api put-public-access-block \\\n  --bucket $TEMPLATE_BUCKET_NAME \\\n  --public-access-block-configuration \"BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true\"\n\naws s3api put-public-access-block \\\n  --bucket $ASSET_BUCKET_NAME \\\n  --public-access-block-configuration \"BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true\"\n\n```\n\n_Note: For PROFILE_NAME, substitute the name of an AWS CLI profile that contains appropriate credentials for deploying in your preferred region. Remove `--profile \u003cPROFILE_NAME\u003e` from the command if you have configured the AWS CLI manually instead of using a profile._\n\n\n- Configure the solution name and version number on your terminal:\n\n```\nSOLUTION_NAME=cloud-migration-factory-on-aws\nVERSION=custom001\n```\n\n- Build the distributable using build-s3-dist.sh\n\n```\ncd ./deployment\nchmod +x ./build-s3-dist.sh\n./build-s3-dist.sh $BASE_BUCKET_NAME $SOLUTION_NAME $VERSION\n```\n\n_✅ All assets are now built. You should see templates under deployment/global-s3-assets and other artifacts (frontend and lambda binaries) under deployment/regional-s3-assets_\n\n### Deployment\n\nDeploy the distributable to an Amazon S3 bucket in your account:\n\n```\ncd ./deployment\naws s3 ls s3://$ASSET_BUCKET_NAME  # should not give an error (verifies the bucket exists)\naws s3 cp global-s3-assets/  s3://$TEMPLATE_BUCKET_NAME/$SOLUTION_NAME/$VERSION/ --recursive --acl bucket-owner-full-control --expected-bucket-owner $ACCOUNT_ID --profile \u003cPROFILE_NAME\u003e\naws s3 cp regional-s3-assets/  s3://$ASSET_BUCKET_NAME/$SOLUTION_NAME/$VERSION/ --recursive --acl bucket-owner-full-control --expected-bucket-owner $ACCOUNT_ID --profile \u003cPROFILE_NAME\u003e\n```\n\n_✅ All assets are now staged in your S3 bucket. You or any user may use S3 links for deployments_\n\n\n### Frontend development\nIn order to run the frontend app locally for development, you need to deploy the solution to your AWS account first \nand then configure the local frontend to use the deployed backend in the cloud.\nTo do so,\n- In the S3 console, locate the S3 bucket with the name `migration-factory-test-\u003cACOUNT_ID\u003e-front-end`\n- Download the file `env.js` from the above bucket, rename it to `env_dev.js` to your local development environment, and place it under `source/frontend/public/` folder next to the existing `env.js` file.\n- Run `npm run start`. The app will become available under [http://localhost:3000](http://localhost:3000) and read the settings from `env_dev.js`\n- Use a browser extension to bypass CORS errors on localhost\n- To log in, create a Cognito user in the AWS Cognito Console as described in the Implementation Guide\n\n\n***\n\n## Unit Testing Framework\nThe following unit testing frameworks are used in the solution.\n\n### Javascript/frontend\nLibraries jest with babel are used for all unit tests involving the front end code.\nThe configuration of jest and babel is maintained in the following solution files:\n```\n|-source/\n    |-frontend/\n        - babel.config.js           [ babel transformation configuration ]\n        - package.json              [ jest configuration ]\n```\nThe library mock-service-worker (msw) runs a mock backend to execute the unit tests against. See `src/setupTests.ts`.\n\n\n\nAll unit test scripts should be created in the same folder as the script or module that they are testing against. When naming the unit test script the format should be as follows:\n\n[_original script name_].test.ts  -  example for the script **Audit.ts** the test script filename should be **Audit.test.ts**\n\n#### Coverage reporting\nBy default, the jest configuration will produce a coverage report when run and which will be processed using the **jest-sonar-reporter** Results Processor in order to output a generic report format that can be ingested into SonarQube.  \nA readable version is also output to source/frontend/coverage/lcov-report/index.html.\n\n#### Running the unit tests\nTo run the unit test, ensure the working directory is set to **/source/frontend** and run the command:\n```\nnpm run test\n```\n\n### Python/backend\npython unittest is used alongside the moto library to run unit tests against the Lambda function code within the solution.  All python unit tests for Lambda functions can be found in the following folder.\n```\n|-source/\n    |-backend/\n        |-lambda_unit_test\n```\n#### Run Lambda Unit Tests\nTo run the unit test, ensure the working directory is set to the parent directory of the repository\n```\nchmod +x ./deployment/run_lambda_unit_test.sh\n./deployment/run_lambda_unit_test.sh\n```\nConfirm that all the unit test pass.\n\n##### Running a single unit test for development\nTo run a subset or single unittest add the test pattern argument to the command. The example below will run only test that have names starting with **test_lambda_ssm**.\n```\nchmod +x ./deployment/run_lambda_unit_test.sh\n./deployment/run_lambda_unit_test.sh test_lambda_ssm*\n```\n#### Coverage reporting\nCoverage reports should be output to the same directory as the unit test scripts are stored in order to be picked up by the SonarQube configuration included with the solution.\n## SonarQube - Code Quality\nThe solution is configured with a default SonarQube properties file that can be used to initialize the solution into an existing SonarQube environment along with configurations to allow coverage reports to be provided during scanning of the solution. This file is located:\n```\n|-/\n    - sonar-project.properties           [ SonarQube project properties file ]\n```\n***\n\n## License\n\nSee license [here](./LICENSE.txt)\n\n***\n\n## Collection of Anonymous Operational Metrics\nThis solution collects anonymous operational metrics to help AWS improve the quality of features of the solution. For more information, including how to disable\nthis capability, please see the [implementation guide](_https://docs.aws.amazon.com/solutions/latest/cloud-migration-factory-on-aws/collection-of-operational-metrics.html_).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-solutions%2Fcloud-migration-factory-on-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faws-solutions%2Fcloud-migration-factory-on-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-solutions%2Fcloud-migration-factory-on-aws/lists"}