crossplane / crossplane/upjet

Support of resources with integer `id`

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

Description

### What problem are you facing?

We've been trying to generate a Crossplane provider from Terraform resources where `id` field is explicitly defined as integer.

Generation results in `id` becoming a string, implicitly, without a warning, and for awhile it has been unclear why it happens in the first place. The related issue I opened in our provider is here:
https://github.com/grafana/crossplane-provider-grafana/issues/307

I believe the reason is in this part of upjet:
https://github.com/crossplane/upjet/blob/main/pkg/pipeline/crd.go#L64-L67

### How could Upjet help solve your problem?

Judging by the upjet code, `id` is likely expected to be present in all resources so it makes sense to add it as string when it's absent in resource definition. But if it already exists in a schema, it'd be preferable to retain the type defined there instead. That would help avoid hitting "implicit" behaviour as above. Additionally, AFAIK, Terraform does not forbid integer `id`.

I'll be happy to add the PR if such a change is acceptable.

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.