Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure bridge is aware of ExactlyOneOf #384

Closed
stack72 opened this issue Sep 2, 2021 · 1 comment · Fixed by #536
Closed

Ensure bridge is aware of ExactlyOneOf #384

stack72 opened this issue Sep 2, 2021 · 1 comment · Fixed by #536
Assignees
Labels
area/tfbridge Issues in pkg/tfbridge, which provides interop between Pulumi and TF providers kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@stack72
Copy link
Contributor

stack72 commented Sep 2, 2021

From pulumi/pulumi-aws#1531

we should also likely add first-class understanding of ExactlyOneOf to the Terraform Bridge similar to how we handle ConflictsWith, so that we never try to apply any defaults for fields that are ExactlyOneOf conflicts with something that was provided by the user.

stack72 added a commit that referenced this issue Jun 2, 2022
Fixes: #384

this will exclude any default values when exactlyOneOf is set in
the TF Schema and will stop programs like:

```
import pulumi
import pulumi_tls as tls

cert = tls.get_certificate(url="https://oidc.eks.us-west-2.amazonaws.com/id/<redacted>")

pulumi.export("cert", cert)
```

getting errors like

```
      File "./__main__.py", line 6, in <module>
        cert = tls.get_certificate(url="https://oidc.eks.us-west-2.amazonaws.com/id/<redacted>")
      File "/Users/stack72/code/test-tls/test-py-lookup/venv/lib/python3.8/site-packages/pulumi_tls/get_certificate.py", line 95, in get_certificate
        __ret__ = pulumi.runtime.invoke('tls:index/getCertificate:getCertificate', __args__, opts=opts, typ=GetCertificateResult).value
      File "/Users/stack72/code/test-tls/test-py-lookup/venv/lib/python3.8/site-packages/pulumi/runtime/invoke.py", line 166, in invoke
        raise invoke_error
    Exception: invoke of tls:index/getCertificate:getCertificate failed: Invalid combination of arguments: "url": only one of `content,url` can be specified, but `content,url` were specified. ()
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
```
@stack72 stack72 self-assigned this Jun 2, 2022
@stack72 stack72 modified the milestones: 0.73, 0.74 Jun 3, 2022
@jkodroff jkodroff added the area/tfbridge Issues in pkg/tfbridge, which provides interop between Pulumi and TF providers label Jun 22, 2022
@stack72 stack72 modified the milestones: 0.74, 0.75 Jun 27, 2022
stack72 added a commit that referenced this issue Jun 27, 2022
Fixes: #384

this will exclude any default values when exactlyOneOf is set in
the TF Schema and will stop programs like:

```
import pulumi
import pulumi_tls as tls

cert = tls.get_certificate(url="https://oidc.eks.us-west-2.amazonaws.com/id/<redacted>")

pulumi.export("cert", cert)
```

getting errors like

```
      File "./__main__.py", line 6, in <module>
        cert = tls.get_certificate(url="https://oidc.eks.us-west-2.amazonaws.com/id/<redacted>")
      File "/Users/stack72/code/test-tls/test-py-lookup/venv/lib/python3.8/site-packages/pulumi_tls/get_certificate.py", line 95, in get_certificate
        __ret__ = pulumi.runtime.invoke('tls:index/getCertificate:getCertificate', __args__, opts=opts, typ=GetCertificateResult).value
      File "/Users/stack72/code/test-tls/test-py-lookup/venv/lib/python3.8/site-packages/pulumi/runtime/invoke.py", line 166, in invoke
        raise invoke_error
    Exception: invoke of tls:index/getCertificate:getCertificate failed: Invalid combination of arguments: "url": only one of `content,url` can be specified, but `content,url` were specified. ()
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
```
@stack72 stack72 modified the milestones: 0.75, 0.76 Jul 25, 2022
@stack72 stack72 modified the milestones: 0.76, 0.77 Aug 15, 2022
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Aug 31, 2022
@pulumi-bot
Copy link
Contributor

Cannot close issue without required labels: kind/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tfbridge Issues in pkg/tfbridge, which provides interop between Pulumi and TF providers kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants