Skip to content

Latest commit

 

History

History
62 lines (49 loc) · 2.13 KB

README.md

File metadata and controls

62 lines (49 loc) · 2.13 KB

terraform-provider-lastpass

release Go Report Card GoDoc

The Lastpass provider is used to read, manage, or destroy secrets inside Lastpass. Goodbye secret .tfvars files 👋

⚠️ Warning: This provider uses an unofficial LastPass API. With that comes the unfortunate risk of Lastpass releasing breaking changes without previous notice.

terraform {
  required_providers {
    random = {
      source = "hashicorp/random"
      version = "3.1.0"
    }
    lastpass = {
      source = "neticdk/lastpass"
      version = "~> 1.0"
    }
  }
}

provider lastpass {
  baseurl = "https://lastpass.eu"
  trust = true
  enable_2fa = true
}

resource "random_password" "pw" {
  length = 32
  special = false
}

resource "lastpass_secret" "mysecret" {
    name = "My site"
    username = "foobar"
    password = random_password.pw.result
    share = "Shared-TeamX"
    url = "https://example.com"
    notes = <<EOF
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sed elit nec orci
cursus rhoncus. Morbi lacus turpis, volutpat in lobortis vel, mattis nec magna.
Cras gravida libero vitae nisl iaculis ultrices. Fusce odio ligula, pharetra ac
viverra semper, consequat quis risus.
EOF
}

data "lastpass_secret" "mysecret" {
    id = resource.lastpass_secret.mysecret.id
}

Documentation and examples can be found inside the Terraform registry:

License

Apache