Use the 1Password Terraform provider
With the 1Password Terraform provider , you can reference, create, or update items in your vaults using a 1Password Connect Server, a 1Password Service Account, or your 1Password account and biometrics.
Requirements
- Connect server
- 1Password CLI
- Install 1Password CLI.
Version 2.23.0 or later. - Optional: Create a service account.
Only required if you plan to authenticate with a service account instead of your 1Password account.
You must install 1Password CLI on the machine running Terraform. Refer to the Terraform documentation to learn how to install 1Password CLI on Terraform Cloud.
Get started
- Connect server
- 1Password CLI
To use the 1Password Terraform provider with a Connect server:
-
Specify the Connect server token.
You can set this value with the OP_CONNECT_TOKEN environment variable or with the token field in the provider configuration.
-
Specify the Connect server hostname, URL, or IP address.
You can set this value with the OP_CONNECT_HOST environment variable or with the url field in the provider configuration.
You can use the 1Password Terraform provider with 1Password CLI. You can authenticate 1Password CLI with a service account or with your 1Password account and biometrics.
Learn about the retry mechanism
The 1Password Terraform provider retry mechanism uses the provider with 1Password CLI. The reason it has a retry mechanism is that 1Password doesn't allow parallel modification on the items located in the same vault.
If you use a service account, keep in mind that each retry fast forwards to the service account rate limit.
It's recommended to limit the number of parallel resource operations. You can do this by using the -parallelism=n
flag when running terraform apply
, where n
is the number of parallel resource operations (the default is 10
).
- Service account
- 1Password account and biometrics
To use the 1Password Terraform provider with a service account:
-
Specify the 1Password CLI installation path.
You can set this value with the OP_CLI_PATH environment variable or with the