Skip to content

Commit

Permalink
feat: add password store put
Browse files Browse the repository at this point in the history
  • Loading branch information
fredleger committed May 12, 2023
1 parent 090b193 commit d13ded8
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 0 deletions.
10 changes: 10 additions & 0 deletions password-store/put/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added password-store/put/.tflint.hcl
Empty file.
43 changes: 43 additions & 0 deletions password-store/put/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# password-store secret writter module

Put a secret into a password-store repository.
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.3 |
| <a name="requirement_pass"></a> [pass](#requirement\_pass) | ~> 3.1.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_pass"></a> [pass](#provider\_pass) | ~> 3.1.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [pass_password.secret](https://registry.terraform.io/providers/mecodia/pass/latest/docs/resources/password) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_data"></a> [data](#input\_data) | Additional key-value pairs to store with the password | `map(string)` | `null` | no |
| <a name="input_password"></a> [password](#input\_password) | Password to store | `string` | `null` | no |
| <a name="input_path"></a> [path](#input\_path) | Password Store path to the secret | `string` | n/a | yes |
| <a name="input_yaml"></a> [yaml](#input\_yaml) | YAML representation of the secret | `string` | `null` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_body"></a> [body](#output\_body) | The body of the secret |
| <a name="output_full"></a> [full](#output\_full) | Entire secret contents |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Empty file added password-store/put/main.tf
Empty file.
9 changes: 9 additions & 0 deletions password-store/put/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
output "body" {
description = "The body of the secret"
value = resource.pass_password.secret.body
}

output "full" {
description = "Entire secret contents"
value = resource.pass_password.secret.full
}
9 changes: 9 additions & 0 deletions password-store/put/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = "~> 1.3"
required_providers {
pass = {
source = "mecodia/pass"
version = "~> 3.1.0"
}
}
}
6 changes: 6 additions & 0 deletions password-store/put/secret.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "pass_password" "secret" {
path = var.path
data = var.data
password = var.password
yaml = var.yaml
}
26 changes: 26 additions & 0 deletions password-store/put/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# bellow are specific modules variables
variable "path" {
description = "Password Store path to the secret"
type = string
}

variable "data" {
description = "Additional key-value pairs to store with the password"
type = map(string)
sensitive = true
default = null
}

variable "password" {
description = "Password to store"
type = string
sensitive = true
default = null
}

variable "yaml" {
description = "YAML representation of the secret"
type = string
sensitive = true
default = null
}

0 comments on commit d13ded8

Please sign in to comment.