[!WARNING] This code is in preview and provided solely for evaluation purposes. It is NOT intended for production use and may contain bugs, incomplete features, or other issues. Use at your own risk, as it may undergo significant changes without notice until it reaches general availability, and no guarantees or support is provided. By using this code, you acknowledge and agree to these conditions. Consult the documentation or contact the maintainer if you have questions or concerns.
This repository hosts the Jamf Pro Community Provider, built to integrate Jamf Pro's robust configuration management capabilities with Terraform's Infrastructure as Code (IaC) approach. 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 a synchronized and effective IT ecosystem.
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:
We encourage you to explore this repository to:
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.
provider "jamfpro" {
jamfpro_instance_fqdn = "https://yourserver.jamfcloud.com"
auth_method = "oauth2"
client_id = "your client id"
client_secret = "your client secret"
jamfpro_load_balancer_lock = true
}
provider "jamfpro" {
jamfpro_instance_fqdn = "https://yourserver.jamfcloud.com"
auth_method = "oauth2"
client_id = "your client id"
client_secret = "your client secret"
enable_client_sdk_logs = false
client_sdk_log_export_path = "/path/to/logfile.json"
hide_sensitive_data = true
custom_cookies {
// Cookie URL is set to jamfpro_instance_fqdn
name = "cookie name"
value = "cookie value"
}
jamfpro_load_balancer_lock = true
token_refresh_buffer_period_seconds = 300
mandatory_request_delay_milliseconds = 100
}
The provider contains:
internal/provider/
),terraform-provider-jamfpro
provider.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:
This documentation provides a detailed explanation of the configuration options available in the provider.tf
file for setting up the Jamf Pro provider in Terraform.
jamfpro_load_balancer_lock
(which enforces a single cookie across all parallel instances of Terraform operations) which extracts the correct cookie on first run from Jamf Pro and utilises it thereafter across all other sessions. This is eqivalent to a sticky session.custom_cookies
and configure a custom cookie to be used in all requests instead.terraform apply -parallelism=X
(the default is 10). HashiCorp Docsjamfpro_instance_fqdn
envKeyJamfProUrlRoot
if not providedhttps://mycompany.jamfcloud.com
. This URL is used to interact with the Jamf Pro API.auth_method
basic
: Use basic authentication with a username and password.oauth2
: Use OAuth2 for authentication.client_id
envKeyOAuthClientSecret
if not providedauth_method
is oauth2
.client_secret
envKeyOAuthClientSecret
if not providedauth_method
is oauth2
.basic_auth_username
envKeyBasicAuthUsername
if not providedauth_method
is basic
.basic_auth_password
envKeyBasicAuthPassword
if not providedauth_method
is basic
.enable_client_sdk_logs
client_sdk_log_export_path
""
hide_sensitive_data
true
custom_cookies
nil
name
and a value
.
jamf_load_balancer_lock
false
token_refresh_buffer_period_seconds
300
mandatory_request_delay_milliseconds
100
For those new to using Terraform with Jamf Pro, we provide a comprehensive demo example that serves as an excellent starting point. This demo implementation utilizes:
This repository is specifically designed to kickstart your Terraform projects by providing practical, easy-to-follow examples of how to configure and deploy resources within Jamf Pro using Terraform.