- Terraform >= 1.0
- Go >= 1.22
- TechChallengeApp
- Clone the repository
- Enter the repository directory
- Build the provider using the Go
install
command:
go install
To use the provider, follow the steps below:
- Update
.terraformrc
file to usedev_overrides
. If the file.terraformrc
doesn't exist in the home directory~
, create one, then add the following code. Change<PATH>
to the value returned from thego env GOBIN
command above.
provider_installation {
dev_overrides {
"registry.terraform.io/providers/tasklite" = "<PATH>"
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
- Initialize the provider in your Terraform configuration:
terraform {
required_providers {
tasklite = {
source = "registry.terraform.io/providers/tasklite"
}
}
}
provider "tasklite" {
host = "<HOST>" # replace it with TechChallengeApp api url
}
- Define resources using the provider:
resource "tasklite_task" "example" {
title = "Task title"
}
- Initialize Terraform and apply the configuration:
terraform plan # to check plan
terraform apply # to apply changes
go install
Check the docs
directory for more information on the provider.
If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).
To compile the provider, run go install
. This will build the provider and put the provider binary in the $GOPATH/bin
directory.
To generate or update documentation, run make generate
.
- Use
make test
to run api client unit tests. - Use
make testacc
to run API client unit tests as well as acceptance tests. Don't forget to update API server url in the task_resource_test.go file if it's other thanhttp:/127.0.0.1:3000