# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['sentinel_mock_plan']

package_data = \
{'': ['*']}

setup_kwargs = {
    'name': 'sentinel-mock-plan',
    'version': '0.3.0',
    'description': 'Create a mock plan for Hashicorp Sentinel 0.26.2',
    'long_description': '# Sentinel Mock Plan\n\nThis project creates a mock plan for **HashiCorp Sentinel 0.26.2** using a JSON plan file generated by Terraform. It converts the plan file into a format that can be used in Sentinel policies for testing and validation.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Usage](#usage)\n\n## Overview\n\nThis project provides a Python utility that processes a JSON plan file (produced by Terraform) and converts it into a **mock plan** file compatible with HashiCorp Sentinel 0.26.2. The generated mock plan is useful for simulating infrastructure changes and running Sentinel policies without applying actual changes to cloud infrastructure.\n\n### Features:\n- Converts a JSON Terraform plan into a mock Sentinel plan.\n- Customizable input and output file options.\n- Supports overwriting existing output files.\n\n## Prerequisites\n\n- Python 3.8+\n- [Terraform](https://www.terraform.io/) (to generate the plan file)\n- HashiCorp Sentinel 0.26.2 (for testing with the generated mock plan)\n\n## Installation\n\n1. Install the package via `pip`:\n\n   ```bash\n   pip install sentinel-mock-plan\n   ```\n\n## Usage\n\nTo use this utility, first generate the Terraform plan JSON file and then run the Python script to convert it.\n\n### Generating the JSON Plan\n\n1. Initialize Terraform with the desired backend configuration:\n\n   ```bash\n   terraform init -reconfigure -backend-config=backends/dev.tfvars\n   ```\n\n2. Generate a Terraform plan:\n\n   ```bash\n   terraform plan -out=tf.plan -var-file=environments/dev.tfvars\n   ```\n\n3. Export the plan to a JSON format:\n\n   ```bash\n   terraform show -no-color -json tf.plan > plan.json\n   ```\n\n### Converting the JSON Plan to a Sentinel Mock Plan\n\nNow, run the Python utility to convert the `plan.json` file into a mock Sentinel plan:\n\n```bash\npython -m sentinel_mock_plan --infile plan.json --outfile mock-tfplan-v2.sentinel\n```\n\n#### Options:\n\n- `--infile`: Input file name (default: `plan.json`)\n- `--outfile`: Output file name (default: `mock-tfplan-v2.sentinel`)\n- `--overwrite`: Overwrite the output file if it exists\n\n### Example:\n\n```bash\npython -m sentinel_mock_plan --infile plan.json --outfile mock-tfplan-v2.sentinel --overwrite\n```\n\nThis will generate a mock plan file named `mock-tfplan-v2.sentinel` from the `plan.json` input.\n\n## Example Workflow\n\n1. Run Terraform commands:\n\n   ```bash\n   terraform init -reconfigure -backend-config=backends/dev.tfvars\n   terraform plan -out=tf.plan -var-file=environments/dev.tfvars\n   terraform show -no-color -json tf.plan > plan.json\n   ```\n\n2. Convert the JSON plan to a mock Sentinel plan:\n\n   ```bash\n   python -m sentinel_mock_plan --infile plan.json --outfile mock-tfplan-v2.sentinel\n   ```\n\n3. Use the generated mock plan in your Sentinel tests.\n',
    'author': 'Amine Laabi',
    'author_email': 'amine.laabi@outlook.fr',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'None',
    'packages': packages,
    'package_data': package_data,
    'python_requires': '>=3.12,<4.0',
}


setup(**setup_kwargs)
