anchor.diff:  ### My instances don’t start the buildkite-agent
   
   Ensure your AMI has been [configured to auto-login as the ec2-user](#build-an-ami)
  -in the GUI. The buildkite-agent launchd job configuration requires an `Aqua`
  -session type to allow your pipelines to use Xcode and the iOS Simulator.
  +in the GUI. To allow your pipelines to use Xcode and the iOS Simulator the
  +Buildkite Agent launchd job configuration requires an `Aqua` session type.
  
positive.code: 1. Configure instance VPC subnets, security groups, and key pairs so that you
  can access the instance.
  1. Using an SSH or SSM session:
  	1. Set a password for the ec2-user using `sudo passwd ec2-user`
  	1. Enable screen sharing using `sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -restart -agent -privs -all`
  1. Using a VNC session:
  	1. Sign in as the ec2-user
  	1. Enable Automatic login for the ec2-user in System Preferences > Users & Accounts > Login Options
  	1. Disable Require password in System Preferences > Security & Privacy > General
  1. Install your required version of Xcode
  	1. Ensure you launch Xcode at least once so you are presented with the EULA prompt.
  1. Using the AWS Console, create an AMI from your instance.
  
  You do not need to install the `buildkite-agent`, it is automatically by the
  Launch Template `UserData` script.
  
  ## Associate your AMI with a Customer managed license in AWS License Manager
  
  To launch an instances using a Host Resource Group, the instance AMI must be
  associated with a Customer managed license in AWS License Manager.
  
  Using the AWS Console, open the AWS License Manager dashboard and navigate to
  Customer managed licenses. Create a new Customer managed license, enter a
  descriptive name and select a License Type of `Cores`.
  
  Once your Customer managed license has been saved, open the detail view for your
  license. Open the Associated AMIs tab and choose Associate AMI. From the list of
  Available AMIs, select your macOS AMIs and then click Associate.
  
  ## Deploy the CloudFormation template
  
  Using the VPC and AMI prepared earlier, prepare values for the following
  required parameters:
  
  * ImageId, from your API set up
  * RootVolumeSize
  * Subnets, from your VPC set up
  * SecurityGroupIds, from your VPC set up
  * IamInstanceProfile, if accessing AWS services from your builds, provide an Instance Profile ARN with an appropriate IAM role attached
  * BuildkiteAgentToken, an Agent Token from http://buildkite.com/organizations/-/agents for your Buildkite Organization
  * BuildkiteAgentQueue, the Buildkite Queue your Pipeline Steps target
  
  There are also optional parameters to configure the size of the Auto Scaling
  Group:
  
  * MinSize, defaults to 0
  * MaxSize, defaults to 3
  
  The default AWS Limit for mac1.metal is 3 dedicated hosts per account region. If
  you require more than 3 instances, request an increased limit using the AWS
  Console.
  
  ### Using the AWS Console
  
  To deploy using the AWS Console:
  
  <a href="https://console.aws.amazon.com/cloudformation/home#/stacks/new?stackName=buildkite-mac&templateURL=https://s3.amazonaws.com/buildkite-serverless-apps-us-east-1/elastic-mac/template/latest.yml"><%= image "launch-stack.svg", alt: "Launch stack button" %></a>
  
  Ensure you have selected the same region as your VPC and AMI resources, give
  your stack a unique name, and fill in the required parameters.
  
  ### Using the AWS CLI
  
  To deploy using the AWS CLI, save your parameters in a `.parameters.json` file
  and run the following commands:
  
negative.code: 
  We have built a [CloudFormation template](https://github.com/buildkite/elastic-mac-for-aws)
  that configures an Auto Scaling group, Launch Template, and Host Resource Group
  suitable for maintaining a pool of EC2 `mac1.metal` instance based Buildkite
  Agents. These agents can be used to run Buildkite Pipelines that build Xcode
  based software projects for macOS, iOS, iPadOS, tvOS, and watchOS.
  
  As you must prepare and supply your own AMI for this template, macOS support has
  **not** been incorporated into the Elastic CI Stack for AWS.
  
  Using an Auto Scaling group for your instances ensures booting your macOS
  Buildkite Agents is repeatable, and provides automatic instance replacement when
  hardware failures occur.
  
  