Venafi / terraform-provider-venafi

HashiCorp Terraform provider that uses Venafi to streamline machine identity (certificate and key) acquisition.
https://www.terraform.io/docs/providers/venafi/
Mozilla Public License 2.0
16 stars 20 forks source link

500 returned from API when creating a certificate #72

Closed jkodroff closed 2 years ago

jkodroff commented 2 years ago

Hello, Venafi.

I'm a developer for Pulumi. One of the acceptance tests for our Venfi provider (which at the time of writing uses terraform-provider-venafi v0.13 to make the actual Venafi API calls) is failing with a 500.

The following code (which should be simple to convert to the corresponding Terraform HCL, but happy to try to reproduce with TF if you would like):

import * as pulumi from "@pulumi/pulumi";
import * as venafi from "@pulumi/venafi";

const conf = new pulumi.Config();
const certPassword = conf.requireSecret("CertificatePassword")

const myCert = new venafi.Certificate("demo-certificate-ts", {
    commonName: "demo-ts.mycompany.io",
    sanDns: [
        "web01.venafi.example",
        "web02.venafi.example",
    ],
    algorithm: "RSA",
    rsaBits: 2048,
    keyPassword: certPassword,
});

export const expirationWindow = myCert.expirationWindow;

Returns this error:

  Diagnostics:
    venafi:index:Certificate (demo-certificate-ts):
      error: Unexpected status code on TPP Certificate Request.
       Status:
       500 Internal Server Error.
       Body:
       {"Error":"Internal error occurred."}

If the request is invalid, e.g. because there are incompatible attributes in the request, the API should return a 400 instead of a 500. If there's an actual unintended exception/panic occurring in the Venafi API and the 500 code is semantically correct, then we figured you'd like to know so you can put out a fix.

Thanks, and please don't hesitate to reach out if you need any additional info!

luispresuelVenafi commented 2 years ago

We currently don't support integration of our provider to be running along with Pulimi (hence things may not work as expected). If this is an error within our provider we can label it as bug. Could you share the Terraform HCL version of your code?

Could you also share which version of TPP are using?

stack72 commented 2 years ago

Hi @luispresuelVenafi

We actually developed the Pulumi Venafi provider in coordination with the Venafi team... so it's been tested and working

It looks like the upstream Venafi TPP has changed and we have our tests working again

You can close this out

Paul