generate terraform resources to use with pytest
Project description
pytest-terraform-fixture
================
🚀 Description
-----------
`--terraform-dir` で指定したディレクトリにある Terraform で作成されるリソースを動的に pytest の fixture として自動で定義してくれる pluginです
🚀 Install
-------
github から引っ張ってきて。
```sh
pip install git+https://github.com/kzmake/pytest_nifcloud_fixture
```
🚀 Usage
-----
Terraform で作成したいリソースを記述する (ここでは `instance_a` のリソースを定義したとする)
```terraform
provider "nifcloud" {
access_key = "xxxxx"
secret_key = "yyyyy"
region = "jp-east-1"
endpoint = "jp-east-1.conputing.api.nifcloud.com"
}
resource "nifcloud_instance" "instance_a" {
instance_id = "hogehogea"
image_id = "89"
key_name = "ssh_key"
instance_type = "large"
description = "pytest-terraform"
availability_zone = "east-11"
disable_api_termination = "false"
ip_type = "none"
}
```
pytest で `instance_a` をリソースを使うテストを作成します (自動的に `instance_a` をfixutreとして定義してくれる)
```python
import pytest
from python_terraform import Terraform
def test_terraform_fixture(instance_a):
# instance_a を作成するテスト
assert True
```
後は、 `*.tf` のディレクトリを指定して実行
```sh
pytest --terraform-dir={実施したい *.tf をもつディレクトリ}
```
🚀 Requirements
------------
このプロジェクトを実行するには以下が必要です:
* [python](https://www.python.org/) 3.4.+
* [terraform](https://www.terraform.io) 0.11.+
🚀 Contributing
------------
PR歓迎してます
🚀 Support and Migration
---------------------
特に無し
🚀 License
-------
- [MIT License](http://petitviolet.mit-license.org/)
================
🚀 Description
-----------
`--terraform-dir` で指定したディレクトリにある Terraform で作成されるリソースを動的に pytest の fixture として自動で定義してくれる pluginです
🚀 Install
-------
github から引っ張ってきて。
```sh
pip install git+https://github.com/kzmake/pytest_nifcloud_fixture
```
🚀 Usage
-----
Terraform で作成したいリソースを記述する (ここでは `instance_a` のリソースを定義したとする)
```terraform
provider "nifcloud" {
access_key = "xxxxx"
secret_key = "yyyyy"
region = "jp-east-1"
endpoint = "jp-east-1.conputing.api.nifcloud.com"
}
resource "nifcloud_instance" "instance_a" {
instance_id = "hogehogea"
image_id = "89"
key_name = "ssh_key"
instance_type = "large"
description = "pytest-terraform"
availability_zone = "east-11"
disable_api_termination = "false"
ip_type = "none"
}
```
pytest で `instance_a` をリソースを使うテストを作成します (自動的に `instance_a` をfixutreとして定義してくれる)
```python
import pytest
from python_terraform import Terraform
def test_terraform_fixture(instance_a):
# instance_a を作成するテスト
assert True
```
後は、 `*.tf` のディレクトリを指定して実行
```sh
pytest --terraform-dir={実施したい *.tf をもつディレクトリ}
```
🚀 Requirements
------------
このプロジェクトを実行するには以下が必要です:
* [python](https://www.python.org/) 3.4.+
* [terraform](https://www.terraform.io) 0.11.+
🚀 Contributing
------------
PR歓迎してます
🚀 Support and Migration
---------------------
特に無し
🚀 License
-------
- [MIT License](http://petitviolet.mit-license.org/)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pytest-terraform-fixture-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 300205b46228c1aa3e5a34f97f18643fce12f4cb4370c338cbe245af2eb8d85a |
|
MD5 | 166225ee5a021c2d4581e1a10a488268 |
|
BLAKE2b-256 | 72e1a4ae149e0676a51fd488c80036c473a38fcb6b697c13e67ae0afd523b9db |
Close
Hashes for pytest_terraform_fixture-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 591260e39a6ad3832c3504c266c1ca78b44b8320db4f93cbb5ce2e58af947ad5 |
|
MD5 | a0c44724019bcb067ca5e6a812c64953 |
|
BLAKE2b-256 | ea0851efd9942e9cfdfc63d347b4d61eaa237b2023a2fc194d012836bbedff3f |