https://github.com/isometry/terraform-provider-keychain
Terraform provider for passwords in the macOS Keychain
https://github.com/isometry/terraform-provider-keychain
keychain macos terraform-provider
Last synced: about 1 year ago
JSON representation
Terraform provider for passwords in the macOS Keychain
- Host: GitHub
- URL: https://github.com/isometry/terraform-provider-keychain
- Owner: isometry
- License: mit
- Created: 2019-09-12T21:39:36.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-03-13T00:26:51.000Z (about 1 year ago)
- Last Synced: 2025-03-25T17:02:10.653Z (about 1 year ago)
- Topics: keychain, macos, terraform-provider
- Language: Go
- Homepage:
- Size: 126 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform Keychain Provider
A simple proof-of-concept Terraform provider for managing passwords in the macOS Keychain.
## Provider
```terraform
provider "keychain" {}
```
## Data Sources
### keychain_password
The `keychain_password` data source can be used to retrieve the password associated with an existing macOS Keychain item.
> WARNING: use of this data source will result in a Keychain password being copied into your Terraform state *in plaintext*. Please consider the security implications and weigh the risks before use!
#### Example Usage
```terraform
data "keychain_password" "example" {
service = "https://data.example.com"
username = "test@example.com"
}
```
#### Argument Reference
The following arguments are supported:
* `class` – (Optional) The class of item to filter on. Allowed options are `generic` for Generic Passwords and `internet` for Internet Passwords. Default: `generic`.
* `service` – (Required) The service (typically the host or website) to filter on.
* `username` – (Required) The username to filter on.
#### Attribute Reference
The only exported attribute is `password`, which is the password of the matching item, or `null` if no matching item was found.
## Resources
### keychain_password
The `keychain_password` resource can be used to create and manage macOS Keychain password items.
> WARNING: use of this resource will leave a copy of the password in your Terraform state *in plaintext*. Please consider the security implications and weigh the risks before use!
#### Example Usage
```terraform
resource "keychain_password" "example" {
class = "internet"
kind = "Internet password"
service = "https://resource.example.com"
username = "test@example.com"
password = "Passw0rd!"
}
```
#### Argument Reference
The following arguments are supported:
* `class` – (Optional) The class of item. Allowed options are `generic` for Generic Passwords and `internet` for Internet Passwords. Default: `generic`.
* `kind` – (Optional) The kind of item. Default: `terraform password`.
* `service` – (Required) The service (typically the host or website).
* `username` – (Required) The username or account name.
* `password` – (Required) The password.
#### Attribute Reference
No useful attributes are exported.