Git Product home page Git Product logo

Comments (3)

swgillespie avatar swgillespie commented on May 14, 2024

I'll look into this in more detail today but I worry that there's not much we can do here. If we're ultimately bottoming-out with Terraform providers, their error messages when they fail to initialize will pretty much always be framed in terms of Terraform. With config keys, we're lucky in that we can inspect the schema for providers that use them and present an error before we involve Terraform providers at all.

If the AWS provider returns some sort of structured error, perhaps we can intercept it and present a better error message, but I suspect that we're going to get back a string error message (and in general, from the TF bridge level, we can't make any assumptions about the kinds of errors that get spit out).

Also, I'm not sure what we'd want this error message to say instead of what it does. We are using a Terraform provider, so it makes sense that we'd link to Terraform docs about how to authenticate with the provider. If we didn't, we'd have to write docs of our own that basically re-phrase exactly what the Terraform docs say.

from pulumi-aws.

lukehoban avatar lukehoban commented on May 14, 2024

FWIW - It's also not clear we could/would have been reporting a better error previously. We didn't ever have any of our own validation of AWS credentials, so we would always have been hitting the TF provider to be the place this error would get reported in a case that it does.

The only way I can imagine fixing this is to replicate all of the TF providers logic around configuration into our package, so that we can return our own error messages in all the failure cases instead of letting TF produce errors.

The only other option will be to string match errors with regexs and transform them. Feels pretty brittle, but maybe worth it if we think this is common?

from pulumi-aws.

swgillespie avatar swgillespie commented on May 14, 2024

I spent some time investigating with this and I agree with this 100%:

The only way I can imagine fixing this is to replicate all of the TF providers logic around configuration into our package, so that we can return our own error messages in all the failure cases instead of letting TF produce errors.

Our terraform wrapper in pulumi-aws is so thin that I don't see any good place for us to interpose on this error message. We could do so in pulumi-terraform, but it feels extremely wrong to me to try and regex parse error messages for specific providers in there. We can certainly do it, of course, but even if we did I'm not sure what the error message would say that it doesn't already say. If we're using the TF provider to handle authentication, we're going to have to direct people to the TF provider's documentation so they can see exactly how the provider is doing it.

from pulumi-aws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.