hashicorp / terraform-cdk

Define infrastructure resources using programming constructs and provision them using HashiCorp Terraform
https://www.terraform.io/cdktf
Mozilla Public License 2.0
4.88k stars 456 forks source link

`cdktf-provider-kubernetes`: use correct Kubernetes classes for properties to allow reuse of custom constructs and builder #3685

Open benkeil opened 3 months ago

benkeil commented 3 months ago

Description

In Kubernetes most classes are reused in many places. A PodSpec for example is valid in a Pod, but also in a Deployment or StatefulSet. Same e.g. with Metadata.

The actual behaviour of creating and naming classes makes it impossible to reuse code that creates constructs like e.g. a PodSpec.

It would be nice if properties that reference the same class in Kubernetes also have the same classes in the generated code (Java) to make it easier to build and reuse custom constructs and functions.

class DeploymentV1 {
  metadata: Metadata
}

class SecretV1 {
  metadata: Metadata
}

References

No response

Help Wanted

Community Note