pulumi / pulumi-confluentcloud

A Confluent Pulumi resource package, providing multi-language access to Confluent
Apache License 2.0
8 stars 3 forks source link

Upgrade pulumi-terraform-bridge to v3.63.1 #247

Closed pulumi-bot closed 1 year ago

pulumi-bot commented 1 year ago

This PR was generated via $ upgrade-provider pulumi/pulumi-confluentcloud --kind=bridge --target-bridge-version=v3.63.1 --pr-reviewers=t0yv0 --pr-description=.


github-actions[bot] commented 1 year ago

Does the PR have any schema changes?

Does the PR have any schema changes?

Looking good! No breaking changes found. No new resources/functions.

Maintainer note: consult the runbook for dealing with any breaking changes.

t0yv0 commented 1 year ago
 TypeError: __init__() got multiple values for argument 'resource_name'

  Resources:
      + 11 to create
t0yv0 commented 1 year ago

Something is not quite right with the latest version.

justinvp commented 1 year ago

Summary of the problem:

The KafkaAcl resource accepts a resourceName input property.

When projected into the resource's __init__ in python, it is resource_name_ with the _ suffix, so that it doesn't conflict with the standard resource_name arg that all python resources accept for the Pulumi resource name:

Standard resource_name arg:

https://github.com/pulumi/pulumi-confluentcloud/blob/8fa2e11729448ae47734ecefb49612bfaa0b0092/sdk/python/pulumi_confluentcloud/kafka_acl.py#L340

Input property resource_name_ with _ suffix:

https://github.com/pulumi/pulumi-confluentcloud/blob/8fa2e11729448ae47734ecefb49612bfaa0b0092/sdk/python/pulumi_confluentcloud/kafka_acl.py#L349

And this is how resource_name_ passed to RegisterResource:

https://github.com/pulumi/pulumi-confluentcloud/blob/8fa2e11729448ae47734ecefb49612bfaa0b0092/sdk/python/pulumi_confluentcloud/kafka_acl.py#L458

The KafkaAclArgs class on the other hand, doesn't have to use the _ suffix for resource_name, because it doesn't otherwise have a conflicting resource_name arg:

https://github.com/pulumi/pulumi-confluentcloud/blob/8fa2e11729448ae47734ecefb49612bfaa0b0092/sdk/python/pulumi_confluentcloud/kafka_acl.py#L24

The problem comes in with the introduction of _configure on KafkaAclArgs. It's expecting a resource_name keyword argument, but typically resource_name isn't specified by keyword. In the example in this repo, it's just the first positional arg:

confluent.KafkaAcl(name,

And the resource_name_ won't be properly passed through to _configure, because it's looking for a resource_name keyword argument, not resource_name_.

So anyway, upgrading to v3.91.1 pulumi codegen will get rid of _configure, and the misguided https://github.com/pulumi/pulumi-confluentcloud/pull/247/commits/a0b619589a16632fcbf591c665d8401279c5bf0d commit in this PR is not necessary. The example should remain setting resource_name_ with the _ suffix.