diff --git a/README.md b/README.md
index e05be60..c9eee05 100644
--- a/README.md
+++ b/README.md
@@ -200,9 +200,9 @@ Available targets:
| Name | Source | Version |
|------|--------|---------|
| [cloudwatch\_log](#module\_cloudwatch\_log) | cloudposse/cloudwatch-logs/aws | 0.6.4 |
-| [self\_signed\_cert\_ca](#module\_self\_signed\_cert\_ca) | cloudposse/ssm-tls-self-signed-cert/aws | 0.4.0 |
-| [self\_signed\_cert\_root](#module\_self\_signed\_cert\_root) | cloudposse/ssm-tls-self-signed-cert/aws | 0.4.0 |
-| [self\_signed\_cert\_server](#module\_self\_signed\_cert\_server) | cloudposse/ssm-tls-self-signed-cert/aws | 0.4.0 |
+| [self\_signed\_cert\_ca](#module\_self\_signed\_cert\_ca) | cloudposse/ssm-tls-self-signed-cert/aws | 0.5.0 |
+| [self\_signed\_cert\_root](#module\_self\_signed\_cert\_root) | cloudposse/ssm-tls-self-signed-cert/aws | 0.5.0 |
+| [self\_signed\_cert\_server](#module\_self\_signed\_cert\_server) | cloudposse/ssm-tls-self-signed-cert/aws | 0.5.0 |
| [this](#module\_this) | cloudposse/label/null | 0.25.0 |
| [vpn\_security\_group](#module\_vpn\_security\_group) | cloudposse/security-group/aws | 0.4.3 |
@@ -263,6 +263,7 @@ Available targets:
| [root\_common\_name](#input\_root\_common\_name) | Unique Common Name for Root self-signed certificate | `string` | `null` | no |
| [saml\_metadata\_document](#input\_saml\_metadata\_document) | Optional SAML metadata document. Must include this or `saml_provider_arn` | `string` | `null` | no |
| [saml\_provider\_arn](#input\_saml\_provider\_arn) | Optional SAML provider ARN. Must include this or `saml_metadata_document` | `string` | `null` | no |
+| [secret\_path\_format](#input\_secret\_path\_format) | The path format to use when writing secrets to the certificate backend.
The certificate secret path will be computed as `format(var.secret_path_format, var.name, var.secret_extensions.certificate)`
and the private key path as `format(var.secret_path_format, var.name, var.secret_extensions.private_key)`.
Thus by default, if `var.name`=`example-self-signed-cert`, then the resulting secret paths for the self-signed certificate's
PEM file and private key will be `/example-self-signed-cert.pem` and `/example-self-signed-cert.key`, respectively.
This variable can be overridden in order to create more specific certificate backend paths. | `string` | `"/%s.%s"` | no |
| [security\_group\_create\_before\_destroy](#input\_security\_group\_create\_before\_destroy) | Set `true` to enable Terraform `create_before_destroy` behavior on the created security group.
Note that changing this value will always cause the security group to be replaced. | `bool` | `true` | no |
| [security\_group\_create\_timeout](#input\_security\_group\_create\_timeout) | How long to wait for the security group to be created. | `string` | `"10m"` | no |
| [security\_group\_delete\_timeout](#input\_security\_group\_delete\_timeout) | How long to retry on `DependencyViolation` errors during security group deletion from
lingering ENIs left by certain AWS services such as Elastic Load Balancing. | `string` | `"15m"` | no |
diff --git a/docs/terraform.md b/docs/terraform.md
index 0973c8a..07d62c1 100644
--- a/docs/terraform.md
+++ b/docs/terraform.md
@@ -19,9 +19,9 @@
| Name | Source | Version |
|------|--------|---------|
| [cloudwatch\_log](#module\_cloudwatch\_log) | cloudposse/cloudwatch-logs/aws | 0.6.4 |
-| [self\_signed\_cert\_ca](#module\_self\_signed\_cert\_ca) | cloudposse/ssm-tls-self-signed-cert/aws | 0.4.0 |
-| [self\_signed\_cert\_root](#module\_self\_signed\_cert\_root) | cloudposse/ssm-tls-self-signed-cert/aws | 0.4.0 |
-| [self\_signed\_cert\_server](#module\_self\_signed\_cert\_server) | cloudposse/ssm-tls-self-signed-cert/aws | 0.4.0 |
+| [self\_signed\_cert\_ca](#module\_self\_signed\_cert\_ca) | cloudposse/ssm-tls-self-signed-cert/aws | 0.5.0 |
+| [self\_signed\_cert\_root](#module\_self\_signed\_cert\_root) | cloudposse/ssm-tls-self-signed-cert/aws | 0.5.0 |
+| [self\_signed\_cert\_server](#module\_self\_signed\_cert\_server) | cloudposse/ssm-tls-self-signed-cert/aws | 0.5.0 |
| [this](#module\_this) | cloudposse/label/null | 0.25.0 |
| [vpn\_security\_group](#module\_vpn\_security\_group) | cloudposse/security-group/aws | 0.4.3 |
@@ -82,6 +82,7 @@
| [root\_common\_name](#input\_root\_common\_name) | Unique Common Name for Root self-signed certificate | `string` | `null` | no |
| [saml\_metadata\_document](#input\_saml\_metadata\_document) | Optional SAML metadata document. Must include this or `saml_provider_arn` | `string` | `null` | no |
| [saml\_provider\_arn](#input\_saml\_provider\_arn) | Optional SAML provider ARN. Must include this or `saml_metadata_document` | `string` | `null` | no |
+| [secret\_path\_format](#input\_secret\_path\_format) | The path format to use when writing secrets to the certificate backend.
The certificate secret path will be computed as `format(var.secret_path_format, var.name, var.secret_extensions.certificate)`
and the private key path as `format(var.secret_path_format, var.name, var.secret_extensions.private_key)`.
Thus by default, if `var.name`=`example-self-signed-cert`, then the resulting secret paths for the self-signed certificate's
PEM file and private key will be `/example-self-signed-cert.pem` and `/example-self-signed-cert.key`, respectively.
This variable can be overridden in order to create more specific certificate backend paths. | `string` | `"/%s.%s"` | no |
| [security\_group\_create\_before\_destroy](#input\_security\_group\_create\_before\_destroy) | Set `true` to enable Terraform `create_before_destroy` behavior on the created security group.
Note that changing this value will always cause the security group to be replaced. | `bool` | `true` | no |
| [security\_group\_create\_timeout](#input\_security\_group\_create\_timeout) | How long to wait for the security group to be created. | `string` | `"10m"` | no |
| [security\_group\_delete\_timeout](#input\_security\_group\_delete\_timeout) | How long to retry on `DependencyViolation` errors during security group deletion from
lingering ENIs left by certain AWS services such as Elastic Load Balancing. | `string` | `"15m"` | no |
diff --git a/main.tf b/main.tf
index de10892..cb928c8 100644
--- a/main.tf
+++ b/main.tf
@@ -19,9 +19,11 @@ locals {
module "self_signed_cert_ca" {
source = "cloudposse/ssm-tls-self-signed-cert/aws"
- version = "0.4.0"
+ version = "0.5.0"
- name = "self-signed-cert-ca"
+ attributes = ["self", "signed", "cert", "ca"]
+
+ secret_path_format = var.secret_path_format
subject = {
common_name = local.ca_common_name
@@ -53,9 +55,11 @@ data "aws_ssm_parameter" "ca_key" {
module "self_signed_cert_root" {
source = "cloudposse/ssm-tls-self-signed-cert/aws"
- version = "0.4.0"
+ version = "0.5.0"
+
+ attributes = ["self", "signed", "cert", "root"]
- name = "self-signed-cert-root"
+ secret_path_format = var.secret_path_format
enabled = local.mutual_enabled
@@ -88,9 +92,11 @@ module "self_signed_cert_root" {
module "self_signed_cert_server" {
source = "cloudposse/ssm-tls-self-signed-cert/aws"
- version = "0.4.0"
+ version = "0.5.0"
+
+ attributes = ["self", "signed", "cert", "server"]
- name = "self-signed-cert-server"
+ secret_path_format = var.secret_path_format
subject = {
common_name = local.server_common_name
diff --git a/variables.tf b/variables.tf
index ec6d82c..ab917e9 100644
--- a/variables.tf
+++ b/variables.tf
@@ -147,3 +147,21 @@ variable "split_tunnel" {
type = bool
description = "Indicates whether split-tunnel is enabled on VPN endpoint. Default value is false."
}
+
+variable "secret_path_format" {
+ description = <<-EOT
+ The path format to use when writing secrets to the certificate backend.
+ The certificate secret path will be computed as `format(var.secret_path_format, var.name, var.secret_extensions.certificate)`
+ and the private key path as `format(var.secret_path_format, var.name, var.secret_extensions.private_key)`.
+ Thus by default, if `var.name`=`example-self-signed-cert`, then the resulting secret paths for the self-signed certificate's
+ PEM file and private key will be `/example-self-signed-cert.pem` and `/example-self-signed-cert.key`, respectively.
+ This variable can be overridden in order to create more specific certificate backend paths.
+ EOT
+ type = string
+ default = "/%s.%s"
+
+ validation {
+ condition = can(substr(var.secret_path_format, 0, 1) == "/")
+ error_message = "The secret path format must contain a leading slash."
+ }
+}