Skip to main content
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 the 1Password desktop app.

Requirements

Get started

To use the 1Password Terraform provider with a Connect server:
  1. Specify the Connect server token. You can set this value with the OP_CONNECT_TOKEN environment variable or with the connect_token field in the provider configuration.
  2. Specify the Connect server hostname, URL, or IP address. You can set this value with the OP_CONNECT_HOST environment variable or with the connect_url field in the provider configuration.

Reference

The following sections contain reference information for the 1Password Terraform provider:

Configuration

The 1Password Terraform provider has fields you must set before you can use it with a 1Password Connect server, service account, or the 1Password desktop app. The following table describes each field. You can use the following environment variables to specify configuration values.

Configuration examples

The following code blocks show configuration examples.
The following examples use environment variables. Make sure to set the environment variables beforehand or use plain text.
The following example shows a provider configuration using a Connect server:
connect-example.tf

Resources

The 1Password Terraform provider has the following resources:

Item resource

The onepassword_item resource represents a 1Password item. You can import a onepassword_item with the following syntax:
Schema
The following tables describe the onepassword_item resource schema.