pulumi / pulumi-terraform-provider

Use any Terraform provider with Pulumi
Apache License 2.0
4 stars 0 forks source link

Codegen missing properties for terraform nested objects #9

Closed automagic closed 1 month ago

automagic commented 1 month ago

What happened?

When bridging a more complex terraform provider, the generated python code seems to be missing setters on properties representing nested objects in the HCL.

Specifically I bridged the Instacluster provider here: https://registry.terraform.io/providers/instaclustr/instaclustr/latest

I would expect there would be a property / setter for data_centeres as an array of inputs, but there is no such input property on the object.

However, there is an output property data_centres on the generated KafkaClusterV2 object, which indicates that there should be a corresponding input. All other nested objects seem to have the same issue.

Example

The following terraform HCL code demonstrates the usage of the 'data_centre' nested object, as an example.

resource "instaclustr_kafka_cluster_v2" "example" {
  auto_create_topics = true
  client_to_cluster_encryption = true
  pci_compliance_mode = false
  data_centre {
    cloud_provider = "AWS_VPC"
    name = "AWS_VPC_US_EAST_1"
    network = "10.0.0.0/16"
    node_size = "KFK-PRD-r6g.large-250"
    number_of_nodes = 3
    region = "US_EAST_1"
  }

  dedicated_zookeeper {
    zookeeper_node_count = 3
    zookeeper_node_size = "KDZ-PRD-m6g.large-80"
  }

  default_replication_factor = 3
  private_network_cluster = false
  kafka_version = "[x.y.z]"
  default_number_of_partitions = 3
  name = "MyKafkaCluster"
  sla_tier = "NON_PRODUCTION"
  allow_delete_topics = true
}

Output of pulumi about

CLI Version 3.127.0 Go Version go1.22.5 Go Compiler gc

Plugins KIND NAME VERSION resource pulumi_instaclustr 2.0.146 resource pulumi_random 3.6.2 language python unknown

Host OS darwin Version 14.1.1 Arch arm64

This project is written in python: executable='/Users/james/Code/demo-dynamic-terraform-provider/venv/bin/python' version='3.11.6'

Current Stack: initech/demo-dynamic-terraform-provider/dev

Found no resources associated with dev

Found no pending operations associated with dev

Backend Name pulumi.com URL https://app.pulumi.com/automagic User automagic Organizations automagic, team-ce, initech, demo Token type personal

Dependencies: NAME VERSION pip 24.2 pulumi_instaclustr 2.0.146 pulumi_random 3.6.2 setuptools 72.1.0 wheel 0.43.0

Pulumi locates its logs in /var/folders/b5/__9f51g104dbl435yq2tw8680000gn/T/ by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

automagic commented 1 month ago

Dupe of https://github.com/pulumi/pulumi-terraform-provider/issues/8