{% for version in resources %}
resource "aws_secretsmanager_secret_version" "{{ version.secret_name_sanitized }}_{{ version.version_id_sanitized }}" {
  secret_id = "{{ version.SecretArn }}"
  
  # Note: The actual secret value should be managed outside of Terraform
  # or provided via variables to avoid storing sensitive data in state
  secret_string = jsonencode({
    placeholder = "This secret value should be managed outside of Terraform"
  })
  
  {% if version.version_stages_formatted %}
  version_stages = {{ version.version_stages_formatted | tojson }}
  {% endif %}
  
  lifecycle {
    ignore_changes = [
      secret_string,
      secret_binary
    ]
  }
}

{% endfor %}