crossplane / crossplane/upjet

Consider removing `dependencies` field from example blocks in provider metadata

Open
#30 0 comments 0 reactions 0 assignees View on GitHub
docgen enhancement v2
Dominant language
Go
Stars
481
Forks
131
Avg merge
2d 1h
Merged PRs (30d)
11

Description

### What problem are you facing?

Today, we produce provider metadata using TF registry docs and it has the following example block:
```yaml
- 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](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acm_certificate_validation) 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.