New – Amazon EC2 M1 Mac Situations

Final yr, throughout the re:Invent 2021 convention, I wrote a weblog put up to announce the preview of EC2 M1 Mac situations. I do know a lot of you requested entry to the preview, and we did our greatest however couldn’t fulfill everyone. Nonetheless, the wait is over. I’ve the pleasure of saying the final availability of EC2 M1 Mac situations.

EC2 Mac situations are devoted Mac mini computer systems connected via Thunderbolt to the AWS Nitro System, which lets the Mac mini seem and behave like one other EC2 occasion. It connects to your Amazon Digital Personal Cloud (Amazon VPC), boots from Amazon Elastic Block Retailer (EBS) volumes, and makes use of EBS snapshots, Amazon Machine Photographs (AMIs), safety teams and different AWS companies equivalent to Amazon CloudWatch and AWS Techniques Supervisor.

The supply of EC2 M1 Mac situations enables you to entry machines constructed across the Apple-designed M1 System on Chip (SoC). If you’re a Mac developer and re-architecting your apps to natively help Macs with Apple silicon, chances are you’ll now construct and take a look at your apps and benefit from all the advantages of AWS. Builders constructing for iPhone, iPad, Apple Watch, and Apple TV may also profit from quicker builds. EC2 M1 Mac situations ship as much as 60 p.c higher worth efficiency over the x86-based EC2 Mac situations for iPhone and Mac app construct workloads.

For instance, I examined the time it takes to scrub, construct, archive, and run the unit exams on a pattern venture I wrote. The brand new EC2 M1 Mac situations full this set of duties in 49 seconds on common. That is 47.8 p.c quicker than the identical set of duties working on the earlier technology of EC2 Mac situations.

To see how you can launch an EC2 M1 Mac occasion from the AWS Administration Console or the AWS Command Line Interface (CLI), I invite you to learn my final weblog put up on the topic.

EC2 Mac M1 Instance

In the course of the six months of the preview, we collected your suggestions and fine-tuned the service to your wants.

We’ve added a new FAQ part to our documentation to get began with EC2 M1 Mac situations. Brokers for administration and observability, equivalent to Techniques Supervisor and CloudWatch, are pre-installed on all our macOS AMIs, together with instruments such because the AWS Command Line Interface (CLI) and our AWS SDKs. EC2 M1 Mac situations combine with different AWS companies, equivalent to Amazon Elastic File System (Amazon EFS) for file storage, AWS Auto Scaling, or AWS Secrets and techniques Supervisor.

For instance, I’m utilizing Secrets and techniques Supervisor to securely retailer my construct secrets and techniques, such because the signing keys and certificates used to signal my binaries earlier than to distribute them on the App Retailer. From my laptop computer, I first be certain to export the certificates from the macOS keychain. I then add my certificates to Secrets and techniques Supervisor with this command:

aws secretsmanager create-secret            
       --name apple-signing-dev-certificate 
       --secret-binary fileb://./secrets and techniques/apple_dev_seb.p12 

On the EC2 M1 Mac occasion, to organize my occasion earlier than the construct section, I obtain the certificates, decode it (it’s base64-encoded), and retailer it within the EC2 M1 Mac occasion keychain, the place the codesign device will discover it throughout the construct.

# obtain the certificates from Secrets and techniques Supervisor
SIGNING_DEV_KEY=$($aws secretsmanager get-secret-value  
      --secret-id apple-signing-dev-certificate         
      --query SecretBinary --output textual content)

# save the certificates as a file
echo $SIGNING_DEV_KEY | base64 -d > seb_dev_certificate.p12

# import the certificates within the keychain 
safety import seb_dev_certificate.p12 
                -P "my_cert_password"   
                -T /usr/bin/safety -T /usr/bin/codesign -T /usr/bin/xcodebuild

# delete the certificates from disk
rm seb_dev_certificate.p12

There are a couple of extra configuration steps to get code signing work from the macOS command line. You may take a look at this presentation I made or my code repository for the main points.

We’re getting ready a few occasions that can assist you be taught extra about EC2 M1 Mac occasion use instances and configuration. First, we lately had a web-based webinar to discover ways to benefit from EC2 Mac situations for iOS improvement, content material is on the market so that you can eat on-demand after a free registration step. Second, we’re getting ready a one-day, in-person developer convention for later this yr. The convention agenda can be filled with technical content material and workshops. Keep tuned on social media to be taught extra about it.

Final and never least, however not associated to EC2 Mac situations, the Apple WWDC 2022 convention befell final month, from June 6–8, 2022, and the content material is on the market on-line. This can be a nice event to be taught extra about improvement for Apple methods basically.

And now, go construct 😉

— seb

Leave a Comment