https://github.com/chainguard-dev/terraform-provider-chainguard
https://github.com/chainguard-dev/terraform-provider-chainguard
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/chainguard-dev/terraform-provider-chainguard
- Owner: chainguard-dev
- License: apache-2.0
- Created: 2023-07-20T22:55:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T15:52:28.000Z (about 1 year ago)
- Last Synced: 2024-04-10T18:20:37.101Z (about 1 year ago)
- Language: Go
- Homepage: https://registry.terraform.io/providers/chainguard-dev/chainguard/latest
- Size: 492 KB
- Stars: 1
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform Provider Chainguard
The Chainguard Terraform provider manages Chainguard resources (IAM groups,
identities, image repos, etc) using Terraform.The provider is written to be compatible with the [Terraform Plugin Framework](https://developer.hashicorp.com/terraform/tutorials/providers-plugin-framework/providers-plugin-framework-provider)
## Configuring the Provider
Configure the provider in your Terraform config:
```terraform
terraform {
required_providers {
chainguard = { source = "chainguard-dev/chainguard" }
}
}
```By default, the provider will attempt to refresh your Chainguard token when it's expired. You can disable this with:
```terraform
provider "chainguard" {
login_options {
disabled = true
}
}
```Additional options include specifying an identity to assume when authenticating and a verified organization name
to use a custom identity provider rather than the Auth0 defaults (GitHub, GitLab, and Google).Detailed documentation on all available resources can be found under `/docs`.
## Developing the Provider
### Requirements
- [Terraform](https://www.terraform.io/downloads.html) >= 1.5.x
- [Go](https://golang.org/doc/install) >= 1.21If you wish to work on the provider, you'll first need
[Go](http://www.golang.org) installed on your machine.### Using a locally compiled provider
If you'd like to compile the provider locally and use it instead
of pulling from the Terraform registry, you can configure your Terraform CLI to do so.```bash
cat < dev.tfrc
provider_installation {
dev_overrides {
"chainguard-dev/chainguard" = "/path/to/terraform-provider-chainguard"
}
}
EOFexport TF_CLI_CONFIG_FILE=dev.tfrc
```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 `go generate`.
### Acceptance tests
In order to run the full suite of Acceptance tests, run```sh
# Select an existing group id to root tests under
TF_ACC_GROUP_ID=foo
TF_ACC_CONSOLE_API=https://console-api.example.com
TF_ACC_AUDIENCE=https://console-api.example.com
TF_ACC_ISSUER=https://issuer.example.comTF_ACC=1 go test ./... -v
```