- Notifications
You must be signed in to change notification settings - Fork24
License
coder/terraform-provider-coder
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Terraform provider forCoder.
We recommend usingnix to manage your development environment. If you havenix installed, you can runnix develop to enter a shell with all the necessary dependencies.
Alternatively, you can install the dependencies manually.
Follow the instructions outlined in theTerraform documentationto setup your local Terraform to use your local version rather than the registry version.
Create a file named
.terraformrcin your$HOMEdirectoryAdd the following content:
provider_installation {# Override the coder/coder provider to use your local versiondev_overrides {"coder/coder" ="/path/to/terraform-provider-coder" }# 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 {} }
(optional, but recommended) Validate your configuration:
- Create a new
main.tffile and include:
terraform {required_providers {coder={ source="coder/coder" } }}
- Run
terraform initand observe a warning likeWarning: Provider development overrides are in effect
- Create a new
Run
go build -o terraform-provider-coderto build the provider binary, which Terraform will try locate and executeAll local Terraform runs will now use your local provider!
NOTE: we vendor in this provider into
github.com/coder/coder, so if you're testing with a local clone then you should also rungo mod edit -replace github.com/coder/terraform-provider-coder=/path/to/terraform-provider-coderin your clone.
To run Terraform acceptance tests, runmake testacc. This will test the provider against the locally installed version of Terraform.
Note: ourCI workflow runs a test matrix against multiple Terraform versions.
The tests under the./integration directory perform the following steps:
- Build the local version of the provider,
- Run an in-memory Coder instance with a specified version,
- Validate the behaviour of the local provider against that specific version of Coder.
To run these integration tests locally:
Pull the version of the Coder image you wish to test:
docker pull ghcr.io/coder/coder:main-x.y.z-devel-abcd1234Run
CODER_VERSION=main-x.y.z-devel-abcd1234 make test-integration.
Note: you can specify
CODER_IMAGEif the Coder image you wish to test is hosted somewhere other thanghcr.io/coder/coder.For example,CODER_IMAGE=example.com/repo/coder CODER_VERSION=foobar make test-integration.
About
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.