https://github.com/terraform-lxd/terraform-provider-lxd
LXD Resource provider for Terraform
https://github.com/terraform-lxd/terraform-provider-lxd
lxd terraform terraform-provider
Last synced: 7 months ago
JSON representation
LXD Resource provider for Terraform
- Host: GitHub
- URL: https://github.com/terraform-lxd/terraform-provider-lxd
- Owner: terraform-lxd
- License: mpl-2.0
- Created: 2015-11-29T22:34:42.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2025-05-03T11:14:24.000Z (8 months ago)
- Last Synced: 2025-05-10T14:51:42.167Z (7 months ago)
- Topics: lxd, terraform, terraform-provider
- Language: Go
- Homepage: https://registry.terraform.io/providers/terraform-lxd/lxd/latest/docs
- Size: 12.7 MB
- Stars: 267
- Watchers: 9
- Forks: 75
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-starred - terraform-lxd/terraform-provider-lxd - LXD Resource provider for Terraform (terraform)
README
# terraform-provider-lxd
LXD Resource provider for Terraform
## Prerequisites
- [Terraform](http://terraform.io)
- [LXD](https://ubuntu.com/lxd)
## Installation
This provider is published in the [Terraform Registry](https://registry.terraform.io/providers/terraform-lxd/lxd/).
Follow the official instructions for declaring providers in your Terraform configuration
[here](https://www.terraform.io/docs/configuration/provider-requirements.html).
### Quick Example
Add the following to your Terraform configuration:
```hcl
terraform {
required_providers {
lxd = {
source = "terraform-lxd/lxd"
}
}
}
```
### Development
#### Setup
1. Follow these [instructions](https://golang.org/doc/install) to setup a Golang development environment.
2. Checkout the repository `git clone ...`
3. Compile from sources to a development binary:
```shell
cd terraform-provider-lxd
go build -v
```
4. Configure Terraform (`~/.terraformrc`) to use the development binary provider:
```shell
$ cat ~/.terraformrc
provider_installation {
# Use local git clone of LXD provider
dev_overrides {
"terraform-lxd/lxd" = "/home//git/terraform-provider-lxd"
}
# 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 {}
}
```
#### Testing
There are two test suites, unit and acceptance. By default the acceptance tests are not run as they require a functional
LXD environment.
##### Unit tests
```shell
make
```
##### Acceptance tests
```shell
make acc
# or run an individual test
TESTARGS="-run TestAccCachedImage_basicVM" make testacc
# increase test verbosity. options are trace, debug, info, warn, or error (default)
TF_LOG=info make testacc
```
## Documentation
Full documentation can be found in the [`docs`](docs) directory.