title: Module for AWS Secret Manager with value/key - Terraform
body: <p>I have the following TF module to create Secret Manager resources:</p>
  <pre><code>resource &quot;aws_secretsmanager_secret&quot; &quot;secrets_manager&quot; {
    count = length(var.secrets)
    name = element(split(&quot;:&quot;, var.secrets[count.index]),0)
    description = &quot;Managed by Terraform&quot;
  }
  
  resource &quot;aws_secretsmanager_secret_version&quot; &quot;secret&quot; {
    count =  length(var.secrets)
    secret_id = aws_secretsmanager_secret.secrets_manager[count.index].id
    secret_string = &lt;&lt;EOF
     {
      &quot;${element(split(&quot;:&quot;, var.secrets[count.index]),1)}&quot;: &quot;${element(split(&quot;:&quot;, var.secrets[count.index]),2)}&quot;
     }
  EOF
  }
  </code></pre>
  <p>With:</p>
  <pre><code>module &quot;secrets_manager&quot; {
    source = &quot;./modules/secret_manager&quot;
    secrets = [
      &quot;secret_name:secret_value:secret_key&quot;,
       ...
      ]
  }
  </code></pre>
  <p>This has been working perfectly for me. Now what I want is the possibility without changing this mechanism, to create a Secret without specifying/creating a value/key.</p>
  <pre><code>module &quot;secrets_manager&quot; {
    source = &quot;./modules/secret_manager&quot;
    secrets = [
      &quot;secret_name:secret_value:secret_key&quot;,
      &quot;secret_name&quot;,
      &quot;secret_name:secret_value:secret_key&quot;,
       ...
      ]
  }
  </code></pre>
  <p>I have been trying using a map as a variable, etc ....no luck:</p>
  <pre><code> secrets_map = {
      secret_one = {
        secret_name = &quot;....&quot;
        secret_value = &quot;....&quot;
        secret_key = &quot;....&quot;
      }
  
      secret_two = {
        secret_name = &quot;....&quot;
      }
    }
  }
  </code></pre>