Skip to content

Commit 213c897

Browse files
authored
chore: add secret name output and update deps (#3)
1 parent 8c7ad4d commit 213c897

File tree

7 files changed

+79
-33
lines changed

7 files changed

+79
-33
lines changed

.github/workflows/docs.yml

+23-25
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1+
on:
2+
pull_request:
13

2-
# blocked by https://github.com/terraform-docs/gh-actions/pull/46
3-
# name: Generate terraform docs
4-
# on:
5-
# pull_request:
4+
jobs:
5+
docs:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
with:
10+
ref: ${{ github.event.pull_request.head.ref }}
611

7-
# jobs:
8-
# docs:
9-
# runs-on: ubuntu-latest
10-
# steps:
11-
# - uses: actions/checkout@v2
12-
# with:
13-
# ref: ${{ github.event.pull_request.head.ref }}
14-
15-
# - name: Render terraform docs inside the examples/basic/README.md
16-
# uses: terraform-docs/[email protected]
17-
# with:
18-
# working-dir: ./examples/basic/
19-
# git-push: "false"
20-
# config-file: ".terraform-docs.yml"
21-
22-
# - name: Render terraform docs inside the README.md
23-
# uses: terraform-docs/[email protected]
24-
# with:
25-
# working-dir: .
26-
# git-push: "true"
27-
# config-file: ".terraform-docs.yml"
12+
- name: Render terraform docs inside the examples/basic/README.md
13+
uses: terraform-docs/[email protected]
14+
with:
15+
working-dir: ./examples/basic/
16+
git-push: "false"
17+
output-file: README.md
18+
config-file: ".terraform-docs.yml"
2819

20+
- name: Render terraform docs inside the README.md
21+
uses: terraform-docs/[email protected]
22+
with:
23+
working-dir: .
24+
git-push: "true"
25+
output-file: README.md
26+
config-file: ".terraform-docs.yml"

.terraform-docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ output:
1212
```hcl
1313
module "label" {
1414
source = "cloudposse/label/null"
15-
version = "0.24.1"
15+
version = "0.25.0"
1616
1717
name = "alpha"
1818
namespace = "so"
@@ -69,4 +69,4 @@ settings:
6969
lockfile: true
7070
required: true
7171
sensitive: true
72-
type: true
72+
type: true

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Terraform module to provision and manage AWS Secrets Manager.
66
```hcl
77
module "label" {
88
source = "cloudposse/label/null"
9-
version = "0.24.1"
9+
version = "0.25.0"
1010
1111
name = "alpha"
1212
namespace = "so"
@@ -28,7 +28,6 @@ module "secrets" {
2828
version = "0.1.0"
2929
3030
secret_version = {
31-
enabled = true
3231
secret_string = jsonencode(
3332
{
3433
ssh_public_key = base64encode(module.ssh_key_pair.public_key)
@@ -110,6 +109,7 @@ module "secrets" {
110109
| <a name="output_id"></a> [id](#output\_id) | ID of the secret |
111110
| <a name="output_key_arn"></a> [key\_arn](#output\_key\_arn) | KMS key ARN |
112111
| <a name="output_kms_key_id"></a> [kms\_key\_id](#output\_kms\_key\_id) | KMS key ID |
112+
| <a name="output_name"></a> [name](#output\_name) | Name of the secret |
113113
| <a name="output_version_id"></a> [version\_id](#output\_version\_id) | The unique identifier of the version of the secret. |
114114
<!-- END_TF_DOCS -->
115115

examples/basic/README.md

+44-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
## terraform-aws-secretsmanager
2+
Terraform module to provision and manage AWS Secrets Manager.
3+
4+
## Usage
5+
6+
```hcl
7+
module "label" {
8+
source = "cloudposse/label/null"
9+
version = "0.25.0"
10+
11+
name = "alpha"
12+
namespace = "so"
13+
stage = "staging"
14+
}
15+
16+
module "ssh_key_pair" {
17+
source = "cloudposse/key-pair/aws"
18+
version = "0.18.1"
19+
20+
ssh_public_key_path = "keys/"
21+
generate_ssh_key = "true"
22+
23+
context = module.label.context
24+
}
25+
26+
module "secrets" {
27+
source = "SweetOps/secretsmanager/aws"
28+
version = "0.1.0"
29+
30+
secret_version = {
31+
secret_string = jsonencode(
32+
{
33+
ssh_public_key = base64encode(module.ssh_key_pair.public_key)
34+
ssh_private_key = base64encode(module.ssh_key_pair.private_key)
35+
}
36+
)
37+
}
38+
39+
context = module.label.context
40+
}
41+
```
42+
143
<!-- BEGIN_TF_DOCS -->
244
## Requirements
345

@@ -14,8 +56,8 @@ No providers.
1456

1557
| Name | Source | Version |
1658
|------|--------|---------|
17-
| <a name="module_label"></a> [label](#module\_label) | cloudposse/label/null | 0.24.1 |
18-
| <a name="module_secrets"></a> [secrets](#module\_secrets) | SweetOps/secretsmanager/aws | 0.1.0 |
59+
| <a name="module_label"></a> [label](#module\_label) | cloudposse/label/null | 0.25.0 |
60+
| <a name="module_secrets"></a> [secrets](#module\_secrets) | SweetOps/secretsmanager/aws | ../../ |
1961
| <a name="module_ssh_key_pair"></a> [ssh\_key\_pair](#module\_ssh\_key\_pair) | cloudposse/key-pair/aws | 0.18.1 |
2062

2163
## Resources

examples/basic/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module "label" {
22
source = "cloudposse/label/null"
3-
version = "0.24.1"
3+
version = "0.25.0"
44

55
name = "alpha"
66
namespace = "so"
@@ -19,7 +19,7 @@ module "ssh_key_pair" {
1919

2020
module "secrets" {
2121
source = "SweetOps/secretsmanager/aws"
22-
version = "0.1.0"
22+
version = "../../"
2323

2424
secret_version = {
2525
enabled = true

main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
locals {
22
enabled = module.this.enabled
3+
secret_name = one(aws_secretsmanager_secret.default[*].name)
34
secret_id = one(aws_secretsmanager_secret.default[*].id)
45
secret_arn = one(aws_secretsmanager_secret.default[*].arn)
56
version_id = one(aws_secretsmanager_secret_version.default[*].version_id)

outputs.tf

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
output "name" {
2+
value = local.secret_name
3+
description = "Name of the secret"
4+
}
5+
16
output "id" {
27
value = local.secret_id
38
description = "ID of the secret"

0 commit comments

Comments
 (0)