This is a working demonstration of the 1Password Terraform provider.
- Run
terraform init
to install the necessary plugins - Ensure you have the 1Password CLI installed
brew install --cask 1password-cli
- Ensure you have the 1Password CLI integration enabled
- Open 1Password
- Open Settings
- Navigate to the Developer settings
- Enable Integrate with 1Password CLI
- Get your account ID and vault ID
- Run
op account ls
and copy the User ID value for the desired account - Run
export TF_VAR_onepassword_account=**copied value**
- Run
op vault ls
and authorize the request, then copy the target Vault ID - Run
export TF_VAR_onepassword_vault_id=**copied value**
- Run
When you run terraform apply
, Terraform will create a password in the vault you selected called Example Terraform-Managed Service Account with a randomly-generated password, then print the username and password as an output (obviously this is insecure for production use, but serves as a proof-of-concept).