terraform-1password-cli

1Password offers an official Terraform provider, however it requires setting up a [1Password Connect] server, for which I am too lazy. (Especially given that I just want to use this to manage my personal infra.)

This module only requires the 1Password CLI to be installed to work.

The op:// URL syntax description can be found here.

Example usage:

module "op" {
  source  = "irth/1password-cli/external"
  version = "1.0.1"
  secrets = {
    ovh = {
      application_key    = "op://Terraform/ovh/application_key"
      application_secret = "op://Terraform/ovh/application_secret"
      consumer_key       = "op://Terraform/ovh/consumer_key"
    }
    vercel = {
      api_token = "op://Terraform/vercel/api_token"
    }
  }
}

provider "ovh" {
  application_key    = module.op.secrets.ovh.application_key
  application_secret = module.op.secrets.ovh.application_secret
  consumer_key       = module.op.secrets.ovh.consumer_key
  endpoint           = "ovh-eu"
}

provider "vercel" {
  api_token = module.op.secrets.vercel.api_token
}

Requirements

No requirements.

Providers

Name Version
external n/a

Modules

No modules.

Resources

Name Type
external_external.this data source

Inputs

Name Description Type Default Required
secrets Mapping of secret names to op:// paths. Can contain nested mappings. map(any) {} no

Outputs

Name Description
secrets Secrets extracted from 1password. Reflects the structure of the "secrets" input variable.