xyops_secret (Resource)
A secret in the xyOps vault. Field values are write-only: they are sent to xyOps but never stored in OpenTofu plans or state, and never read back. Requires OpenTofu 1.11 or later.
A secret holds one or more variables (fields_wo). The four assignment lists control who may use them. They are lists of IDs, not secrets:
| Attribute | Who receives the variables |
|---|---|
web_hooks |
Web hooks, as {{ secrets.NAME }} in their URL, headers or body |
events |
Jobs of those events, as environment variables |
categories |
Jobs of every event in those categories |
plugins |
Those plugins when they run |
With all four empty, nothing can use the secret.
Rotating a value
OpenTofu cannot see changes to a write-only attribute. Change the value in fields_wo and increase fields_wo_version; the provider then sends the whole fields_wo map again, replacing all of the secret's variables. Changing only the value plans no change.
Schema
Required
title(String)
Optional
enabled(Boolean) Defaults totrue.notes(String)icon(String)fields_wo(Map of String, Sensitive, Write-only) Secret variables, as name = value. Names must be valid environment variable names. Sent on create, and on update only whenfields_wo_versionchanges.fields_wo_version(Number) Change this to sendfields_woagain. Required whenfields_wois set.events,categories,plugins,web_hooks(Set of String) Assignment lists, as above. Omit one to leave it unmanaged.id(String) Generated by xyOps when omitted. Changing it replaces the secret.
Read-Only
names(Set of String) Names of the secret's variables, as reported by xyOps.
Import
tofu import xyops_secret.example example
Import reads the secret's metadata (title, assignments and variable names) so the first plan is empty. Values cannot be imported: xyOps only returns them through its admin-only decrypt_secret action, which this provider never calls. After importing, leave fields_wo unset to keep the current values, or set fields_wo and fields_wo_version to replace them.
Upgrading from 0.1.2-dev.2 or earlier
The old value, category and params attributes did not match the xyOps API and are removed. Existing state is upgraded automatically: the stored value is deleted from state, and the next refresh reads names and assignments from xyOps. Replace value with fields_wo plus fields_wo_version in your configuration.
Data sources
Resources
- xyops_alert (Resource)
- xyops_api_key (Resource)
- xyops_bucket (Resource)
- xyops_category (Resource)
- xyops_channel (Resource)
- xyops_config (Resource)
- xyops_event (Resource)
- xyops_group (Resource)
- xyops_monitor (Resource)
- xyops_plugin (Resource)
- xyops_role (Resource)
- xyops_secret (Resource)
- xyops_server (Resource)
- xyops_tag (Resource)
- xyops_webhook (Resource)
- xyops_workflow (Resource)
Published from docs/ (refs/tags/v0.1.2-dev.9, 575109c770a3). Edit the source in a pull request; wiki edits are replaced on the next publish.