feat: Add Terraform provider generation and installation instructions

This commit is contained in:
Simon Larsen
2025-08-15 11:42:03 +01:00
parent 1c6f9adbcb
commit 777c6948ad
2 changed files with 14 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
We have a terraform provider for OneUptime that can be generated by running the following command from the root of the OneUptime project:
```
npm run generate-and-install-terraform-provider-locally
```
Once the provider is generated, it will be installed locally. You can test it in TerraformTest directory. If the TerraformTest directory ahs existing state files, please delete it and run "terraform init" again.
When running terraform apply, please ensure you have added the -auto-approve flag to avoid manual approval prompts. The command should look like this:
Now, please fix this in terraform provider:
<PROMPT>

View File

@@ -75,6 +75,7 @@
"generate-openapi-spec": "export $(grep -v '^#' config.env | xargs) && node --require ts-node/register ./Scripts/OpenAPI/GenerateSpec.ts ./openapi.json",
"generate-terraform-provider": "export $(grep -v '^#' config.env | xargs) && node --require ts-node/register ./Scripts/TerraformProvider/GenerateProvider.ts",
"install-terraform-provider-locally": "bash ./Scripts/TerraformProvider/install-terraform-provider-locally.sh --force",
"generate-and-install-terraform-provider-locally": "npm run install-terraform-provider-locally",
"publish-terraform-provider": "bash ./Scripts/TerraformProvider/publish-terraform-provider.sh"
},
"repository": {