Giter VIP home page Giter VIP logo

Comments (7)

lukehoban avatar lukehoban commented on June 27, 2024

The fact that jsyaml.safeDump throws on undefineds is unfortunate here. Upstream tracking for that is here: nodeca/js-yaml#325. Presumably we should be handling that failure and providing better context given how unhelpful this failure mode is.

from pulumi-eks.

lukehoban avatar lukehoban commented on June 27, 2024

As well as fixing the error reporting, it's not clear whether this indicates user error (and what user error), or whether it's a bug in the library that allows undefineds to flow into this code. @metral?

from pulumi-eks.

casey-robertson avatar casey-robertson commented on June 27, 2024

Also having this issue. So also user error or a bug :-)

from pulumi-eks.

casey-robertson avatar casey-robertson commented on June 27, 2024

OK so in my particular case it was user error. We each develop in our own AWS account and my account was not provisioned with a couple of the roles I was trying to map into the cluster roleMappings. These roles were being grabbed via aws.iam.Role and then added to the roleMappings config as variable.arn. I think this code is where the issue lies:

const roleMappings = pulumi.all([pulumi.output(args.roleMappings || []), instanceRoleMappings])

Line 317 can then possibly return bad objects.

return jsyaml.safeDump([...mappings, ...instanceMappings].map(m => ({

Line 326

if (args.userMappings !== undefined) {

that does the userMappings checks for undefined and would skip that block. So this is a use case where the code is assuming a good aws.iam.Role because under default conditions (where no roleMappings are defined), the program operates OK with an empty array,
but is not checking if I pass it a bad/invalid object.

from pulumi-eks.

lukehoban avatar lukehoban commented on June 27, 2024

These roles were being grabbed via aws.iam.Role and then added to the roleMappings config as variable.arn.

Could you share any more details on this? Do you mean you were using aws.iam.Role.get()? And that was returning a Role with an undefined arn instead of throwing in the case that you didn't have that Role in your account?

from pulumi-eks.

casey-robertson avatar casey-robertson commented on June 27, 2024

Correct. A few of our accounts were hand-spun due to time constraints. I had assumed a couple of roles had been created when in fact they had not.

from pulumi-eks.

lukehoban avatar lukehoban commented on June 27, 2024

Got it. The root cause of that is pulumi/pulumi-terraform#262 which leads to the .get calls not reporting an error and isntead allowing you to see undefineds that you didn't expect. You can of course work around that by checking for undefined yourself, but it's not clear you should have to.

We will be looking into fixing that issue, as well as improving the error reporting on the YAML serialization in this package.

from pulumi-eks.

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.