Skip to content

Commit 558e9fc

Browse files
authored
readme by the gpt (#4)
1 parent 0049947 commit 558e9fc

File tree

10 files changed

+67
-269
lines changed

10 files changed

+67
-269
lines changed

.github/ISSUE_TEMPLATE/BUG_REPORT.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/workflow.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 0 additions & 2 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 76 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 67 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,89 @@
1-
# Template
1+
# jamftf-python-terraform-importer
22

3-
This repository serves as a **Default Template Repository** according official [GitHub Contributing Guidelines][ProjectSetup] for healthy contributions. It brings you clean default Templates for several areas:
3+
A Python-based utility to automate the import of existing Jamf Pro resources into Terraform state files.
44

5-
- [Azure DevOps Pull Requests](.azuredevops/PULL_REQUEST_TEMPLATE.md) ([`.azuredevops\PULL_REQUEST_TEMPLATE.md`](`.azuredevops\PULL_REQUEST_TEMPLATE.md`))
6-
- [Azure Pipelines](.pipelines/pipeline.yml) ([`.pipelines/pipeline.yml`](`.pipelines/pipeline.yml`))
7-
- [GitHub Workflows](.github/workflows/)
8-
- [Super Linter](.github/workflows/linter.yml) ([`.github/workflows/linter.yml`](`.github/workflows/linter.yml`))
9-
- [Sample Workflows](.github/workflows/workflow.yml) ([`.github/workflows/workflow.yml`](`.github/workflows/workflow.yml`))
10-
- [GitHub Pull Requests](.github/PULL_REQUEST_TEMPLATE.md) ([`.github/PULL_REQUEST_TEMPLATE.md`](`.github/PULL_REQUEST_TEMPLATE.md`))
11-
- [GitHub Issues](.github/ISSUE_TEMPLATE/)
12-
- [Feature Requests](.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md) ([`.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md`](`.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md`))
13-
- [Bug Reports](.github/ISSUE_TEMPLATE/BUG_REPORT.md) ([`.github/ISSUE_TEMPLATE/BUG_REPORT.md`](`.github/ISSUE_TEMPLATE/BUG_REPORT.md`))
14-
- [Codeowners](.github/CODEOWNERS) ([`.github/CODEOWNERS`](`.github/CODEOWNERS`)) _adjust usernames once cloned_
15-
- [Wiki and Documentation](docs/) ([`docs/`](`docs/`))
16-
- [gitignore](.gitignore) ([`.gitignore`](.gitignore))
17-
- [gitattributes](.gitattributes) ([`.gitattributes`](.gitattributes))
18-
- [Changelog](CHANGELOG.md) ([`CHANGELOG.md`](`CHANGELOG.md`))
19-
- [Code of Conduct](CODE_OF_CONDUCT.md) ([`CODE_OF_CONDUCT.md`](`CODE_OF_CONDUCT.md`))
20-
- [Contribution](CONTRIBUTING.md) ([`CONTRIBUTING.md`](`CONTRIBUTING.md`))
21-
- [License](LICENSE) ([`LICENSE`](`LICENSE`)) _adjust projectname once cloned_
22-
- [Readme](README.md) ([`README.md`](`README.md`))
23-
- [Security](SECURITY.md) ([`SECURITY.md`](`SECURITY.md`))
5+
## Overview
246

7+
Managing Jamf Pro resources with Terraform enhances reproducibility, version control, and automation. However, importing existing Jamf Pro resources into Terraform can be tedious and error-prone. This tool simplifies the process by:
258

26-
## Status
9+
- Connecting to your Jamf Pro tenant via the Classic API.
10+
- Fetching specified resources (e.g., scripts, policies, configuration profiles).
11+
- Generating Terraform import blocks for each resource.
2712

28-
[![Super Linter](<https://github.com/segraef/Template/actions/workflows/linter.yml/badge.svg>)](<https://github.com/segraef/Template/actions/workflows/linter.yml>)
13+
This facilitates a smoother transition to Infrastructure as Code (IaC) practices with Jamf Pro.
2914

30-
[![Sample Workflow](<https://github.com/segraef/Template/actions/workflows/workflow.yml/badge.svg>)](<https://github.com/segraef/Template/actions/workflows/workflow.yml>)
15+
## Features
3116

32-
## Creating a repository from a template
17+
- Supports multiple Jamf Pro resource types.
18+
- Generates Terraform import blocks compatible with Terraform v1.5 and above.
19+
- Modular design for easy extension to additional resource types.
20+
- Command-line interface for straightforward operation.
3321

34-
You can [generate](https://github.com/segraef/Template/generate) a new repository with the same directory structure and files as an existing repository. More details can be found [here][CreateFromTemplate].
22+
## Prerequisites
3523

36-
## Reporting Issues and Feedback
24+
- Python 3.7 or higher
25+
- Access to a Jamf Pro instance with appropriate API credentials
26+
- Terraform v1.5 or higher
3727

38-
### Issues and Bugs
28+
## Installation
3929

40-
If you find any bugs, please file an issue in the [GitHub Issues][GitHubIssues] page. Please fill out the provided template with the appropriate information.
30+
1. Clone the repository:
4131

42-
If you are taking the time to mention a problem, even a seemingly minor one, it is greatly appreciated, and a totally valid contribution to this project. **Thank you!**
32+
```bash
33+
git clone https://github.com/deploymenttheory/jamftf-python-terraform-importer.git
34+
cd jamftf-python-terraform-importer
35+
```
4336

44-
## Feedback
37+
2. Install the required Python packages:
4538

46-
If there is a feature you would like to see in here, please file an issue or feature request in the [GitHub Issues][GitHubIssues] page to provide direct feedback.
39+
```bash
40+
pip install -r requirements.txt
41+
```
4742

48-
## Contribution
43+
## Usage
4944

50-
If you would like to become an active contributor to this repository or project, please follow the instructions provided in [`CONTRIBUTING.md`][Contributing].
45+
1. Configure your Jamf Pro API credentials and desired resources using environment variables or a JSON config file like `import_config.json`:
5146

52-
## Learn More
47+
```json
48+
{
49+
"jamfpro_macos_configuration_profile_plist": true
50+
}
51+
```
5352

54-
* [GitHub Documentation][GitHubDocs]
55-
* [Azure DevOps Documentation][AzureDevOpsDocs]
56-
* [Microsoft Azure Documentation][MicrosoftAzureDocs]
53+
2. Run the importer script:
5754

58-
<!-- References -->
55+
```bash
56+
python main.py
57+
```
5958

60-
<!-- Local -->
61-
[ProjectSetup]: <https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions>
62-
[CreateFromTemplate]: <https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/creating-a-repository-from-a-template>
63-
[GitHubDocs]: <https://docs.github.com/>
64-
[AzureDevOpsDocs]: <https://docs.microsoft.com/en-us/azure/devops/?view=azure-devops>
65-
[GitHubIssues]: <https://github.com/segraef/Template/issues>
66-
[Contributing]: CONTRIBUTING.md
59+
This will generate Terraform import blocks for the selected resource types.
6760

68-
<!-- External -->
69-
[Az]: <https://img.shields.io/powershellgallery/v/Az.svg?style=flat-square&label=Az>
70-
[AzGallery]: <https://www.powershellgallery.com/packages/Az/>
71-
[PowerShellCore]: <https://github.com/PowerShell/PowerShell/releases/latest>
61+
3. Use the generated import blocks to import resources into Terraform state:
7262

73-
<!-- Docs -->
74-
[MicrosoftAzureDocs]: <https://docs.microsoft.com/en-us/azure/>
75-
[PowerShellDocs]: <https://docs.microsoft.com/en-us/powershell/>
63+
```bash
64+
terraform import <resource_type>.<resource_name> <resource_id>
65+
```
66+
67+
## Supported Resources
68+
69+
- Scripts
70+
- Policies
71+
- Configuration Profiles
72+
- Categories
73+
- Computer Groups (Static and Smart)
74+
- Advanced Computer Searches
75+
- Computer Extension Attributes
76+
77+
Support for additional resource types can be added by extending the `Resource` class and implementing the `_get()` method.
78+
79+
## Contributing
80+
81+
Contributions are welcome! Please submit a pull request or open an issue to propose changes or enhancements.
82+
83+
## License
84+
85+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
86+
87+
---
88+
89+
For more information and updates, visit the [GitHub repository](https://github.com/deploymenttheory/jamftf-python-terraform-importer).

SECURITY.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)