Updated on the 23rd of October, 2021: Terraform AWS provider now supports Dedicated Hosts natively
In November 2021, AWS announced the support for Mac mini instances.
I believe this is huge, even despite the number of constraints this solution has. This offering opens the door to seamless macOS CI/CD integration into existing AWS infrastructure.
So here is a quick-start example of creating the dedicated host and the instance altogether using Terraform.
I intentionally used some hardcoded values for the sake of simplicity in the example.
Simple as that, yes. Now, you can integrate it into your CI system and have the Mac instance with the underlying host in a bundle.
💡 Pro tip: you can leverage the
aws_ec2_instance_type_offerings Data Source and use its output with
aws_subnet source to avoid availability zone hardcoding.
To make the code more uniform and reusable, you can wrap it into a Terraform module that accepts specific parameters (such as
availability_zone) as input variables.