- Terraform >= 1.0
- Go >= 1.22
- TechChallengeApp
- Clone the repository
- Enter the repository directory
- Build the provider using the Go
installcommand:
go installTo use the provider, follow the steps below:
- Update
.terraformrcfile to usedev_overrides. If the file.terraformrcdoesn't exist in the home directory~, create one, then add the following code. Change<PATH>to the value returned from thego env GOBINcommand 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 changesgo installCheck 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 testto run api client unit tests. - Use
make testaccto 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