1Password/terraform-provider-onepassword

Use the 1Password Terraform Provider to reference, create, or update items in your 1Password Vaults.

Go

405

924 commits

updated Sep 21, 2026

See the code

README

1Password Terraform provider

Use the 1Password Terraform provider to access and manage items in your 1Password vaults.

Get started

✨ Get started

This project is licensed under MIT. Use of the 1Password APIs and services accessed through these tools is governed by the 1Password API Terms of Service.

terraform {
  required_providers {
    onepassword = {
      source = "1Password/onepassword"
    }
  }
}

provider "onepassword" {
  service_account_token = "<1Password service account token>"
}

variable "vault_id" {}

# Using section_map for direct field access by label
resource "onepassword_item" "demo_credentials" {
  vault = var.vault_id

  title    = "Demo API Credentials"
  category = "login"

  section_map = {
    "api_credentials" = {
      field_map = {
        "api_key" = {
          type  = "CONCEALED"
          value = "your-api-key"
        }
        "api_secret" = {
          type = "CONCEALED"
          password_recipe = {
            length  = 32
            symbols = false
          }
        }
      }
    }
  }
}

# Access fields directly by label
output "api_key" {
  value     = onepassword_item.demo_credentials.section_map["api_credentials"].field_map["api_key"].value
  sensitive = true
}

# Using section (list) for block syntax
resource "onepassword_item" "demo_login" {
  vault = var.vault_id

  title    = "Demo Terraform Login"
  category = "password"

  username = "demo-username"

  password_recipe {
    length  = 40
    symbols = false
  }
}

🛠️ Contributing

For the contribution guidelines, see CONTRIBUTING.md.

Still not sure where or how to begin? We're happy to help! You can join the Developer Slack workspace, and ask us any questions there.

💙 Community & Support

🔐 Security

1Password requests you practice responsible disclosure if you discover a vulnerability.

Please file requests by sending an email to bugbounty@agilebits.com.

1password
1password-connect
go
secrets-management
terraform
terraform-provider

Contributors

(top 30 of 33)

JillRegan

386 commits

volodymyrZotov

293 commits

jpcoenen

65 commits

edif2008

57 commits

1Password/terraform-provider-onepassword

Use the 1Password Terraform Provider to reference, create, or update items in your 1Password Vaults.

Go

405

924 commits

updated Sep 21, 2026

See the code

README

1Password Terraform provider

Use the 1Password Terraform provider to access and manage items in your 1Password vaults.

Get started

✨ Get started

This project is licensed under MIT. Use of the 1Password APIs and services accessed through these tools is governed by the 1Password API Terms of Service.

terraform {
  required_providers {
    onepassword = {
      source = "1Password/onepassword"
    }
  }
}

provider "onepassword" {
  service_account_token = "<1Password service account token>"
}

variable "vault_id" {}

# Using section_map for direct field access by label
resource "onepassword_item" "demo_credentials" {
  vault = var.vault_id

  title    = "Demo API Credentials"
  category = "login"

  section_map = {
    "api_credentials" = {
      field_map = {
        "api_key" = {
          type  = "CONCEALED"
          value = "your-api-key"
        }
        "api_secret" = {
          type = "CONCEALED"
          password_recipe = {
            length  = 32
            symbols = false
          }
        }
      }
    }
  }
}

# Access fields directly by label
output "api_key" {
  value     = onepassword_item.demo_credentials.section_map["api_credentials"].field_map["api_key"].value
  sensitive = true
}

# Using section (list) for block syntax
resource "onepassword_item" "demo_login" {
  vault = var.vault_id

  title    = "Demo Terraform Login"
  category = "password"

  username = "demo-username"

  password_recipe {
    length  = 40
    symbols = false
  }
}

🛠️ Contributing

For the contribution guidelines, see CONTRIBUTING.md.

Still not sure where or how to begin? We're happy to help! You can join the Developer Slack workspace, and ask us any questions there.

💙 Community & Support

🔐 Security

1Password requests you practice responsible disclosure if you discover a vulnerability.

Please file requests by sending an email to bugbounty@agilebits.com.

1password
1password-connect
go
secrets-management
terraform
terraform-provider

Contributors

(top 30 of 33)

JillRegan

386 commits

volodymyrZotov

293 commits

jpcoenen

65 commits

edif2008

57 commits

Languages

Go

98.6%