feat: add import support and unit tests for provider resources

This commit is contained in:
Naeel
2026-04-14 23:00:46 +03:00
parent a2688e5f2c
commit 81852c28b1
12 changed files with 366 additions and 0 deletions
+20
View File
@@ -6,6 +6,8 @@
- `fission_function`
- `fission_http_trigger`
Все ресурсы поддерживают `terraform import` в формате `namespace/name`.
## Быстрый запуск (dev override)
1. Собрать бинарник провайдера:
@@ -41,6 +43,24 @@ TF_CLI_CONFIG_FILE=/tmp/terraformrc-fission terraform plan
TF_CLI_CONFIG_FILE=/tmp/terraformrc-fission terraform apply -auto-approve
```
## Тесты
Unit-тесты:
```bash
cd terraform/provider
go test ./...
```
Импорт существующего ресурса (пример):
```bash
terraform import fission_environment.python default/tf-python-env
terraform import fission_package.hello default/tf-hello-pkg
terraform import fission_function.hello default/tf-hello-fn
terraform import fission_http_trigger.hello default/tf-hello-route
```
## Ограничения MVP
- `fission_package.source_dir` в текущей реализации ожидает файл `main.py` в корне указанной директории.