aws-solutions / cloud-migration-factory-on-aws

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.
https://aws.amazon.com/solutions/implementations/cloud-migration-factory-on-aws/
Apache License 2.0
60 stars 63 forks source link

support single type EC2 Dedicated Hosts from MGN integration #29

Open vrimkus opened 10 months ago

vrimkus commented 10 months ago

Issue When using certain EC2 Dedicated Hosts (e.g. r5d.large), they are restricted to a single Instance Type. The side effect from this is that the ec2:DescribeHosts response for these hosts will not include InstanceFamily in the HostProperties.

Currently, the MGN lambda function assumes it will be able to resolve the InstanceFamily from the response, and will unfortunately fail when it is not present.

ERROR: Host Supported Instance Family does not match required

Description of changes: This change includes logic to identify whether the ec2:DescribeHosts response contains the InstanceFamily, and if not, will instead use the InstanceType value to glean the instance family.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.