ec2-macos-utils

module
v0.0.0-...-3bc4e7f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2025 License: Apache-2.0

README

EC2 macOS Utils

Overview

EC2 macOS Utils is a CLI-based utility that provides commands for customizing AWS EC2 Mac instances. Currently, there exists one command (grow) for resizing volumes to their maximum size. This is done by wrapping diskutil(8), gathering disk information, and resizing the disk.

Usage

The utility will be installed by default for all AMIs vended by AWS after December 8, 2021. ec2-macos-utils is also available as a cask for install and updates via AWS' Homebrew tap.

See the ec2-macos-utils docs for more information.

Global Flags

EC2 macOS Utils supports global flags that can be set with any command. The supported global flags are as follows:

  • --verbose or -v this flag enables more detailed information to be outputted.
Growing APFS Containers
ec2-macos-utils grow [flags]

The grow command resizes an APFS container to its maximum size. This is done by fetching all disk and system partition information, repairing the physical device to update partition information, calculating the amount of free space available, and resizing the container to its max size. Repairing the physical device is necessary in order to properly allocate the amount of available free space.

The grow command should be run with sudo as it requires root access in order to repair the physical disk.

See the grow docs for more information.

Building

ec2-macos-utils can be built using the provided Makefile. The default target compiles the executable with other targets provided for development & release activities. Each target has preset values that it uses but these can be overridden and tailored as needed.

Dependencies

This project requires the following build time dependencies:

  • Go
  • GNU Make
Build
make build
# or, alternatively use the default target to build:
make

This builds the ec2-macos-utils binary.

Generate Docs
make docs

This builds the ec2-macos-utils-docs binary which can be used to generate the latest command docs.

Tests
make test

This runs a cover of all Go tests in the package.

Imports
make imports

Run goimports to reformat source files according to gofmt.

Contributing

Please feel free to submit issues, fork the repository and send pull requests! See CONTRIBUTING for more information.

Security

See the Security section of CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

Directories

Path Synopsis
cmd
ec2-macos-utils command
internal
build/tools
Package tools holds references to build time tools and is not intended to be imported for use.
Package tools holds references to build time tools and is not intended to be imported for use.
cmd
Package cmd provides the functionality necessary for CLI commands in EC2 macOS Utils.
Package cmd provides the functionality necessary for CLI commands in EC2 macOS Utils.
cmd/gen-docs command
diskutil
Package diskutil provides the functionality necessary for interacting with macOS's diskutil CLI.
Package diskutil provides the functionality necessary for interacting with macOS's diskutil CLI.
diskutil/mocks
Package mock_diskutil is a generated GoMock package.
Package mock_diskutil is a generated GoMock package.
system
Package system provides the functionality necessary for interacting with the macOS system.
Package system provides the functionality necessary for interacting with the macOS system.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL