Skip to content

Commit 42281c7

Browse files
authored
add version id (#6)
* add version id * pre-commit hook with tfdocs
1 parent 1babffa commit 42281c7

File tree

2 files changed

+40
-21
lines changed

2 files changed

+40
-21
lines changed

README.md

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,51 @@ module "random_password" {
1717
```
1818

1919
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
20+
## Requirements
21+
22+
| Name | Version |
23+
|------|---------|
24+
| random | >= 2.2.0 |
25+
26+
## Providers
27+
28+
| Name | Version |
29+
|------|---------|
30+
| aws | n/a |
31+
| random | >= 2.2.0 |
32+
2033
## Inputs
2134

2235
| Name | Description | Type | Default | Required |
23-
|------|-------------|:----:|:-----:|:-----:|
24-
| cloudtrail\_log\_group | Cloudtrail Log Group name \(required if `enable\_secret\_access\_notification=true`\) | string | `"change_me"` | no |
25-
| create\_secret | If false, this module does nothing \(since tf doesn't support conditional modules\) | bool | `"true"` | no |
26-
| description | Description to add to Secret | string | `""` | no |
27-
| enable\_secret\_access\_notification | Notify SNS topic on secret access \(not recommended for most use cases\) | bool | `"false"` | no |
28-
| length | Length of string | number | n/a | yes |
29-
| min\_lower | Minimum number of lower case characters | number | `"0"` | no |
30-
| min\_numeric | Minimum number of numbers | number | `"0"` | no |
31-
| min\_special | Minimum number of special characters | number | `"0"` | no |
32-
| min\_upper | Minimum number of upper case characters | number | `"0"` | no |
33-
| name | Name \(omit to use name\_prefix\) | string | `""` | no |
34-
| name\_prefix | Name Prefix \(not used if name specified\) | string | `"terraform"` | no |
35-
| override\_special | | string | `""` | no |
36-
| pass\_version | Password version. Increment this to trigger a new password. | number | `"1"` | no |
37-
| secret\_access\_metric\_namespace | Metric namespace to use for CloudWatch metric | string | `"SecretsManager"` | no |
38-
| secret\_access\_notification\_arn | SNS topic to notify on secret access \(required if `enable\_secret\_access\_notification=true`\) | string | `""` | no |
39-
| tags | Tags to add to supported resources | map(string) | `{}` | no |
40-
| use\_lower | Use lower case characters | bool | `"true"` | no |
41-
| use\_number | Use numbers | bool | `"true"` | no |
42-
| use\_special | Use special characters | bool | `"true"` | no |
43-
| use\_upper | Use upper case characters | bool | `"true"` | no |
36+
|------|-------------|------|---------|:--------:|
37+
| cloudtrail\_log\_group | Cloudtrail Log Group name (required if `enable_secret_access_notification=true`) | `string` | `"change_me"` | no |
38+
| create\_secret | If false, this module does nothing (since tf doesn't support conditional modules) | `bool` | `true` | no |
39+
| description | Description to add to Secret | `string` | `""` | no |
40+
| enable\_secret\_access\_notification | Notify SNS topic on secret access (not recommended for most use cases) | `bool` | `false` | no |
41+
| length | Length of string | `number` | n/a | yes |
42+
| min\_lower | Minimum number of lower case characters | `number` | `0` | no |
43+
| min\_numeric | Minimum number of numbers | `number` | `0` | no |
44+
| min\_special | Minimum number of special characters | `number` | `0` | no |
45+
| min\_upper | Minimum number of upper case characters | `number` | `0` | no |
46+
| name | Name (omit to use name\_prefix) | `string` | `""` | no |
47+
| name\_prefix | Name Prefix (not used if name specified) | `string` | `"terraform"` | no |
48+
| override\_special | n/a | `string` | `""` | no |
49+
| pass\_version | Password version. Increment this to trigger a new password. | `number` | `1` | no |
50+
| secret\_access\_metric\_namespace | Metric namespace to use for CloudWatch metric | `string` | `"SecretsManager"` | no |
51+
| secret\_access\_notification\_arn | SNS topic to notify on secret access (required if `enable_secret_access_notification=true`) | `string` | `""` | no |
52+
| tags | Tags to add to supported resources | `map(string)` | `{}` | no |
53+
| use\_lower | Use lower case characters | `bool` | `true` | no |
54+
| use\_number | Use numbers | `bool` | `true` | no |
55+
| use\_special | Use special characters | `bool` | `true` | no |
56+
| use\_upper | Use upper case characters | `bool` | `true` | no |
4457

4558
## Outputs
4659

4760
| Name | Description |
4861
|------|-------------|
4962
| secret | Generated secret |
5063
| secret\_arn | The ARN of the secret |
64+
| version\_id | The unique identifier of the version of the secret. |
5165

5266
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
5367

outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ output "secret_arn" {
77
description = "The ARN of the secret"
88
value = var.create_secret ? aws_secretsmanager_secret.secret[0].arn : ""
99
}
10+
11+
output "version_id" {
12+
description = "The unique identifier of the version of the secret."
13+
value = var.create_secret ? aws_secretsmanager_secret_version.secret_val[0].version_id : ""
14+
}

0 commit comments

Comments
 (0)