Use the 1Password Connect Terraform Provider to reference, create, or update items in your 1Password Vaults.
Detailed documentation for using this provider can be found on the Terraform Registry docs.
terraform {
required_providers {
onepassword = {
source = "1Password/onepassword"
version = "~> 1.1.2"
}
}
}
provider "onepassword" {
url = "http://localhost:8080"
}
variable "vault_id" {}
resource "onepassword_item" "demo_login" {
vault = var.vault_id
title = "Demo Terraform Login"
category = "password"
username = "demo-username"
password_recipe {
length = 40
symbols = false
}
}
See the examples directory for a full example.
Detailed documentation for contributing to the 1Password Terraform provider can be found here.