crossplane / crossplane/upjet

Call TerraformConversions in Terraform Plugin Framework External Client

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

Description

### What problem are you facing?

When we work on adding s3 directory bucket resource (framework resource), we noticed that we could not determine the fields that are singleton lists from the schema JSON. We added the following function to set the field's MaxItems to 1 manually.
```
func setMaxItemsConstraintsOnFrameworkResources() config.ResourceOption {
return func(r *config.Resource) {
switch r.Name {
case "aws_s3_directory_bucket":
r.TerraformResource.Schema["location"].MaxItems = 1
default:
return
}
}
}
```
Then we encountered the following issue:

![Screenshot 2024-08-29 at 18 32 02](https://github.com/user-attachments/assets/18055732-620e-4d66-a0f9-aa6eb013f0c1)

This issue is caused by the fact that we cannot call TerraformConversions in the [Terraform Plugin Framework External Client.](https://github.com/crossplane/upjet/blob/main/pkg/controller/external_tfpluginfw.go)

PR [discussion](https://github.com/crossplane-contrib/provider-upjet-aws/pull/1429#discussion_r1710053800)

### How could Upjet help solve your problem?

Implement the feature that caused the above issue.

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.