Skip to content

Consider removing dependencies field from example blocks in provider metadata #30

Description

@muvaf

What problem are you facing?

Today, we produce provider metadata using TF registry docs and it has the following example block:

- name: cert
  manifest: |-
    {
      "certificate_body": "${tls_self_signed_cert.example.cert_pem}",
      "private_key": "${tls_private_key.example.private_key_pem}"
    }
  references:
    certificate_body: tls_self_signed_cert.example.cert_pem
    private_key: tls_private_key.example.private_key_pem
  dependencies:
    tls_private_key.example: |-
        {
          "algorithm": "RSA"
        }
    tls_self_signed_cert.example: |-
        {
          "allowed_uses": [
            "key_encipherment",
            "digital_signature",
            "server_auth"
          ],
          "key_algorithm": "RSA",
          "private_key_pem": "${tls_private_key.example.private_key_pem}",
          "subject": [
            {
              "common_name": "example.com",
              "organization": "ACME Examples, Inc"
            }
          ],
          "validity_period_hours": 12
        }

The dependencies map doesn't really have an impact on how we do shape our example YAMLs and it's a deviation from how the example looks in HCL and shown in TF registry because the concept doesn't have a user-facing match in Terraform.

How could Terrajet help solve your problem?

We can remove dependencies map completely, treating every manifest an element of an array where with its own name field. We can order the YAMLs when we print via sorting by kind name or matching the main resource by kind name to put it on top.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions