terraform-provider-jamfpro

command module
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MPL-2.0 Imports: 9 Imported by: 0

README

Community Terraform Provider for Jamf Pro

Release Installs Registry Lint Status Go Report Card Go Version License

[!WARNING] This provider is in public preview. While it has been tested extensively, please thoroughly test in non-production environments before production use. Features may contain bugs or undergo changes based on community feedback. Use at your own risk until general availability is reached. No guarantees or official support is provided. By using this provider, you acknowledge and agree to these conditions. For questions or issues, please consult the documentation or contact the maintainer.

[!TIP] This is a community-driven project and is not officially supported by Jamf. If you need help, want to ask questions, or connect with other users and contributors, join our community Mac Admins Slack Channel - #terraform-provider-jamfpro

Introduction

This repository hosts the Community Jamf Pro terraform Provider, built to integrate Jamf Pro's robust configuration management capabilities with Terraform's Infrastructure as Code (IaC) approach to service life cycle management. Utilizing a comprehensive JAMF Pro SDK go-api-sdk-jamfpro, which serves as a cohesive abstraction layer over both Jamf Pro and Jamf Pro Classic APIs, this provider ensures seamless API interactions and brings a wide array of resources under Terraform's management umbrella.

The jamfpro provider is engineered to enrich your CI/CD workflows with Jamf Pro's extensive device management functionalities, encompassing device enrollment, inventory tracking, security compliance, and streamlined software deployment.

Its primary goal is to enhance the efficiency of managing, deploying, and maintaining Apple devices across your infrastructure, fostering an 'everything-as-code' mindset.

Use Cases

  • Infrastructure as Code for Jamf Pro
    Manage Jamf Pro configuration (apps, groups, policies, device management, and more) as code, enabling version control, peer review, and repeatable deployments—just as you would for cloud infrastructure in Azure or GCP.

  • Automated, Auditable Change Management
    Use Terraform's plan and apply in gitOps workflows to preview, approve, and track changes to your Jamf Pro environment, ensuring all modifications are intentional, reviewed, and logged.

  • Environment Replication and Drift Detection Reproduce Jamf Pro tenant configurations across multiple environments (development, staging, production) or tenants, and detect configuration drift over time using Terraform’s state management.

  • Disaster Recovery and Rapid Rebuilds
    Store your Jamf Pro configuration in code, allowing for rapid recovery or migration of tenant settings, policies, and assignments in the event of accidental changes or tenant loss.

  • Collaboration and Delegation Empower teams to collaborate on Jamf Pro configuration using pull requests, code reviews, and CI/CD pipelines, reducing bottlenecks and enabling safe delegation of administrative tasks.

  • Bulk and Consistent Policy Enforcement Apply security, compliance, and device management policies at scale, ensuring consistency and reducing manual configuration errors across large organizations or multiple tenants.

  • Self-Service via Terraform Modules
    Build reusable Terraform modules for common Jamf Pro workloads, enabling service-owning teams to provide self-service provisioning to other engineering teams while maintaining standards and reducing manual effort.

  • Integration with Policy-as-Code (OPA/Conftest)
    Integrate with Open Policy Agent (OPA) or Conftest to enforce organizational standards, compliance, and guardrails on Jamf Pro resources before deployment, ensuring only approved configurations are applied in production.

  • Guardrailed Deployments
    Implement automated checks and guardrails in CI/CD pipelines to prevent misconfiguration and enforce best practices, reducing risk and improving governance for Jamf Pro administration.

Getting Started

Please refer to the Getting Started guide in the terraform registry for more information on how to get started.

Demo Implementation

To help you get started and understand the practical implementation of this provider, we've created a comprehensive demo repository:

This demo repository showcases a real-world implementation of the Jamf Pro Terraform provider. It's designed to:

  1. Illustrate best practices for integrating Jamf Pro with Terraform.
  2. Demonstrate a GitLab-flow based workflow for multi environment setups, integrating with Terraform Cloud.
  3. Provide practical examples of managing Jamf Pro resources as code.
  4. Offer a starting point for your own infrastructure-as-code initiatives with Jamf Pro.

We encourage you to explore this repository to:

  • Understand how to structure your Terraform configurations for Jamf Pro.
  • See examples of defining and managing various Jamf Pro resources.
  • Learn how to integrate Terraform workflows with your CI/CD pipeline.
  • Get insights into version control strategies for your Jamf Pro configurations.

Whether you're new to Terraform or looking to enhance your existing Jamf Pro management, this demo repository serves as a valuable resource to kickstart your infrastructure-as-code journey with Jamf Pro.

Requirements

(Tested with production Jamf Pro instances, with and without SSO integratioin with Microsoft Entra ID. We do not test against beta or preview versions of Jamf Pro due to potential data model changes.)

Jamf Cloud Load Balancing and Cookies

  • Jamf Cloud uses a load balancer to distribute traffic across multiple web app members (typically 2). When resource's are manipulated on a given web app member, there is up to a 60 second time box until this resources changes are propagated and reflected onto the other web app(s). This architecture can cause issues with Terraform's http client default behaviour when multiple instances are running in parallel and also due to the speed terraform operates. This results in scenarios where it's very likely that a create by terraform, followed by a read (for stating) will freqently communicate with different web app members during a terraform run. This causes stating 'unfound' resource issues.
  • To mitigate this please use the jamfpro_load_balancer_lock (which enforces a single cookie across all parallel instances of Terraform operations). This feature on first run obtains all available web cookies (jpro-ingress) from Jamf Pro and selects and applies a single one to the http client for all subsequent api calls during the terraform run. This is eqivalent to a sticky session.
  • For non Jamf Cloud customers, with load balanced configurations please use custom_cookies and configure a custom cookie to be used in all requests instead.
Concurrency

[!WARNING] Jamf Pro produces inconsistent behaviour when using the default parallelism setting of 10 with terraform. You can adjust paralellism by setting the Terraform parallelism count using terraform apply -parallelism=X to a setting of your choice. HashiCorp Docs . It's recconmended to always set parallelism to 1 to guarantee successful CRUD operations and resource stating. What this produces in a moderate performance hit is offset by reliability. Not using -parallelism=1 is at your own risk!

Community & Support

For further community support and to engage with other users of the Jamf Pro Terraform Provider, please join us on the Mac Admins Slack channel. You can ask questions, provide feedback, and share best practices with the community. Join us at:

Disclaimer

[!IMPORTANT]
While every effort is made to maintain accuracy and reliability, users should thoroughly test configurations in non-production environments before deploying to production. Always refer to official Jamf documentation for the most up-to-date information on Jamf Pro services and features.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
common/crypto
hash.go This package contains shared / common hash functions
hash.go This package contains shared / common hash functions
common/plist
common/configurationprofiles/plist/plistdiffsuppression.go contains the functions to process configuration profiles for diff suppression.
common/configurationprofiles/plist/plistdiffsuppression.go contains the functions to process configuration profiles for diff suppression.
common/shared_schemas
sharedschemas/shared_schemas.go
sharedschemas/shared_schemas.go
provider
providers.go
providers.go
services/account
accounts_data_source.go
accounts_data_source.go
services/account_group
accountgroups_data_source.go
accountgroups_data_source.go
services/activation_code
activationcode_object.go
activationcode_object.go
services/advanced_computer_search
advancedcomputersearches_data_source.go
advancedcomputersearches_data_source.go
services/advanced_mobile_device_search
advancedmobiledevicesearches_data_source.go
advancedmobiledevicesearches_data_source.go
services/advanced_user_search
advancedusersearches_data_source.go
advancedusersearches_data_source.go
services/allowed_file_extension
allowedfileextensions_object.go
allowedfileextensions_object.go
services/api_integration
apiintegrations_data_source.go
apiintegrations_data_source.go
services/api_role
apiroles_data_source.go
apiroles_data_source.go
state.go
state.go
services/category
categories_data_source.go
categories_data_source.go
services/computer_extension_attribute
computerextensionattributes_data_source.go
computerextensionattributes_data_source.go
services/department
department_data_source.go
department_data_source.go
services/device_communication_settings
Constructor file (device_communication_settings_constructor.go)
Constructor file (device_communication_settings_constructor.go)
services/device_enrollments
deviceenrollments_data_source.go
deviceenrollments_data_source.go
services/disk_encryption_configuration
diskencryptionconfigurations_object.go
diskencryptionconfigurations_object.go
services/dock_item
dockitems_data_source.go
dockitems_data_source.go
services/enrollment_customization
enrollment_customization_state.go
enrollment_customization_state.go
services/file_share_distribution_point
filesharedistributionpoints_resource.go
filesharedistributionpoints_resource.go
services/icon
icons_object.go
icons_object.go
services/macos_configuration_profile_plist_generator
macosconfigurationprofilesplistgenerator_data_source.go
macosconfigurationprofilesplistgenerator_data_source.go
services/macos_onboarding_settings
macos_onboarding_settings_constructor.go
macos_onboarding_settings_constructor.go
state.go
services/mobile_device_application
mobile_device_applications_data_source.go
mobile_device_applications_data_source.go
services/mobile_device_configuration_profile_plist
mobiledeviceconfigurationprofilesplist_data_source.go
mobiledeviceconfigurationprofilesplist_data_source.go
services/mobile_device_extension_attribute
mobiledeviceextensionattributes_data_source.go
mobiledeviceextensionattributes_data_source.go
services/mobile_device_prestage_enrollment
mobiledeviceprestageenrollments_data_source.go
mobiledeviceprestageenrollments_data_source.go
services/network_segment
resources_data_source.go
resources_data_source.go
services/package
packages_data_source.go
packages_data_source.go
services/policy
policies_resource.go
policies_resource.go
services/printer
printers_data_source.go
printers_data_source.go
services/restricted_software
restrictedsoftware_data_source.go
restrictedsoftware_data_source.go
services/script
scripts_data_source.go
scripts_data_source.go
services/self_service_branding_image
self_service_branding_image_constructor.go
self_service_branding_image_constructor.go
services/self_service_branding_ios
self_service_branding_ios_constructor.go
self_service_branding_ios_constructor.go
services/self_service_branding_macos
self_service_branding_macos_constructor.go
self_service_branding_macos_constructor.go
services/site
sites_data_source.go
sites_data_source.go
services/smart_computer_group
smartcomputergroup_data_source.go
smartcomputergroup_data_source.go
services/sso_settings
sso_settings_constructor.go
sso_settings_constructor.go
services/static_computer_group
staticcomputergroup_data_source.go
staticcomputergroup_data_source.go
services/static_mobile_device_group
staticmobiledevicegroup_data_source.go
staticmobiledevicegroup_data_source.go
state.go
services/volume_purchasing_locations
volumepurchasinglocations_data_source.go
volumepurchasinglocations_data_source.go
scripts

Jump to

Keyboard shortcuts

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