Cannot build Mac AMI on AWS with Terraform and ImageBuilder

I am trying to use TF to run AWS ImageBuilder to produce a MacOS AMI. I keep getting errors like this:

Error: waiting for Image Builder Image (arn:aws:imagebuilder:us-east-1:315803289066:image/gitlab-runner-macos-recipe/1.0.37/1) create: unexpected state ‘FAILED’, wanted target ‘AVAILABLE’. last error: Workflow Execution ID: ‘wf-16610f81-b50d-4f3b-81bf-0d16063b2b66’ failed with reason: An error occurred (Unsupported) when calling the RunInstances operation: The requested tenancy is not supported for this instance type. Please check the documentation for supported configurations. in workflow step LaunchBuildInstance

ImageBuilder is trying to use an invalid tenancy type for a Mac instance. Macs require dedicated hosts. I can create a dedicated host with the aws_ec2_host resource, and I can create an instance on that host with the aws_instance resource, but there does not seem to be any way to give the host ID or instance ID to the aws_imagebuilder_infrastructure_configuration resource. There is also no tenancy argument available for this resource.

I am giving it the “mac1.metal” instance type, and it should (at least in theory) be able to infer the need for a dedicated host from that instance type. But, it does not.

If someone knows how to make this work, I’d appreciate any help you can provide. If this is a known bug, that would also be useful information.

I am using version 5.92.0 of the terraform/aws provider, and my TF version is 1.5.7