Sample Terraform provider that creates cities, houses and stores.
In order to run the API locally make sure you have docker-compose
installed on your machine.
To run the API locally, run the following command:
cd api && docker-compose up -d
provider "sendoracity" {
api_url = "http://localhost:8080"
}
resource "sendoracity_city" "city" {
name = "City"
}
resource "sendoracity_house" "house" {
city_id = sendoracity_city.city.id
address = "Somewhere in the city"
Inhbitants = 4
}
resource "sendoracity_store" "store" {
city_id = sendoracity_city.city.id
address = "Anthoer address in the city"
name = "Store"
type = "Food"
}
To run the tests, run the following command:
go test -v ./...
To build the provider, run the following command:
go build -o terraform-provider-sendoracity