This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from secrethub/fix/dir-docs
Add docs for dir resource and datasource
- Loading branch information
Showing
6 changed files
with
115 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,5 @@ linters: | |
- unconvert | ||
disable-all: true | ||
exclude-use-defaults: false | ||
run: | ||
timeout: 5m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
layout: "secrethub" | ||
page_title: "secrethub_dir" | ||
sidebar_current: "docs-secrethub-datasource-dir" | ||
description: |- | ||
Read a directory | ||
--- | ||
|
||
# secrethub_dir Data Source | ||
|
||
Use this data source to read a directory already in SecretHub. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "secrethub_dir" "db" { | ||
path = "company/project/${var.environment}/db" | ||
} | ||
resource "secrethub_secret" "db_password" { | ||
path = "${data.secrethub_dir.db.path}/password" | ||
generate { | ||
length = 32 | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* `path` - (Required) The path of the directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
layout: "secrethub" | ||
page_title: "secrethub_dir" | ||
sidebar_current: "docs-secrethub-resource-dir" | ||
description: |- | ||
Creates a directory at a given path. | ||
--- | ||
|
||
# secrethub_dir Resource | ||
|
||
This resource allows you to create a directory at a given path. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "secrethub_dir" "project" { | ||
path = "company/project" | ||
} | ||
resource "secrethub_dir" "environment" { | ||
path = "${data.secrethub_dir.project.path}/${var.environment}" | ||
} | ||
resource "secrethub_dir" "database" { | ||
path = "${secrethub_dir.environment.path}/db" | ||
} | ||
resource "secrethub_secret" "db_user" { | ||
path = "${secrethub_dir.database.path}/username" | ||
value = "db_user" | ||
} | ||
resource "secrethub_secret" "db_password" { | ||
path = "${secrethub_dir.database.path}/password" | ||
generate { | ||
length = 32 | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `path` - (Required) The path of the directory. | ||
* `force_destroy` - (Optional) Whether to allow deleting this directory if it's not empty. When set to `false`, you'll get an error when trying to delete the directory if it still contains directories or secrets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters